Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   FindNpc to find putnpc2 npc? (https://forums.graalonline.com/forums/showthread.php?t=72785)

JkWhoSaysNi 03-12-2007 07:28 PM

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.

Skyld 03-12-2007 07:36 PM

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.

JkWhoSaysNi 03-12-2007 08:06 PM

ah, thanks, i'll use this.name.

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

zokemon 03-12-2007 09:35 PM

Yeah, you would have to store the this.name somehow in the npc that created it.

Rapidwolve 03-12-2007 10:00 PM

Quote:

Originally Posted by zokemon (Post 1287901)
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..

Angel_Light 03-12-2007 11:06 PM

this.foo =D

contiga 03-12-2007 11:31 PM

What I do is:
PHP Code:

this.pnpc putnpc2stuff....);
this.pnpc.foo "lala"


JkWhoSaysNi 03-12-2007 11:39 PM

yeah, but i need to call the putnpc2'd NPC from NPCs other than the one that created it.

Skyld 03-12-2007 11:42 PM

Quote:

Originally Posted by JkWhoSaysNi (Post 1287962)
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


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

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