Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-12-2007, 07:28 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
FindNpc to find putnpc2 npc?

I want an NPC in a level using putnpc2. If it's not there i want to create it, if it is i want to send data to it.

However, how can I use findnpc() to find an npc that has been placed by putnpc2?

Thanks.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #2  
Old 03-12-2007, 07:36 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
In theory you can do something like:
PHP Code:
with (putnpc2())
{
  
// code

Also, the value of the this.name variable inside the putnpc2 NPC can be used with findNPC() in the same way that a Database NPC's name can be used.
__________________
Skyld
Reply With Quote
  #3  
Old 03-12-2007, 08:06 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
ah, thanks, i'll use this.name.

I need the NPC accessible from multiple level NPCs so using with(putnpc2()) wont work.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #4  
Old 03-12-2007, 09:35 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Yeah, you would have to store the this.name somehow in the npc that created it.
__________________
Do it with a DON!
Reply With Quote
  #5  
Old 03-12-2007, 10:00 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by zokemon View Post
Yeah, you would have to store the this.name somehow in the npc that created it.
Same I use other variables such as this.type, this.nname, etc..
Reply With Quote
  #6  
Old 03-12-2007, 11:06 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
this.foo =D
__________________
Deep into the Darkness peering...
Reply With Quote
  #7  
Old 03-12-2007, 11:31 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
What I do is:
PHP Code:
this.pnpc putnpc2stuff....);
this.pnpc.foo "lala"
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #8  
Old 03-12-2007, 11:39 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
yeah, but i need to call the putnpc2'd NPC from NPCs other than the one that created it.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #9  
Old 03-12-2007, 11:42 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by JkWhoSaysNi View Post
yeah, but i need to call the putnpc2'd NPC from NPCs other than the one that created it.
I am thinking perhaps this concept article I wrote may be of some use to you: http://wiki.graal.net/index.php/Crea..._Communication
__________________
Skyld
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.