Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Triggering DB-NPCs (https://forums.graalonline.com/forums/showthread.php?t=134263263)

iBeatz 05-17-2011 07:28 PM

Triggering DB-NPCs
 
Okay, so this has been annoying me for a while now.
Basically, I want to trigger a script in a DB-NPC called... Test, let's say.

I want to trigger it from a class NPC, if this is possible.
I've seen the triggersever() command used like this:

NPC Code:
triggerserver("npc",name,...);



Does the "npc" part trigger DB-NPCs, and as for the string variable in the triggerserver command, does it need to be the name of the DB-NPC you want to trigger?

And one more thing, is there a certain command I would need to put into the DB-NPC to make it work?

Thanks!

Seich 05-17-2011 09:10 PM

If I am not wrong, you can do something like this on the serverside:
PHP Code:

Test.someFunction(); 


Mark Sir Link 05-17-2011 09:34 PM

whenever triggerserver is used, it always passed to the event

PHP Code:

onActionServerside(params

to write the triggerserver, you would use

PHP Code:

triggerserver("npc""TestNPC""test""foo"); 

after doing this, onActionServerside would be invoked in that NPC, with params[0] being "test", and params[1] being "foo".


If all this is already happening on the serverside instead of the clientside, as Seich said, you can directly access the function in the NPC itself as long as the function is defined as a public function

iBeatz 05-17-2011 11:00 PM

Thanks very much!
I love you guys! ^^


All times are GMT +2. The time now is 12:10 PM.

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