Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Triggering More Than One Level NPC (https://forums.graalonline.com/forums/showthread.php?t=134268335)

baseman101 06-19-2013 10:15 PM

Triggering More Than One Level NPC
 
Hello. I am making an event, and I need to trigger more than one NPC in the level to change color. Basically, say NPCa is the 'control npc' of the level. Say I want to trigger a lot of other NPCs in the level, but I don't want to make things hard and exceed myself. If I just duplicate the NPCs, only one will work by the way.
NPC A (control npc):
PHP Code:

function onPlayerChats() {
  
level.npcb.onFoo(player.chat); //send to more than one npc, identical to npcb


NPC B:
PHP Code:

//let's pretend this code works. I may have messed up, doing this quickly
function onCreated() {
  
level.npcb this;
}
public function 
onFoo(temp.baz) {
  
this.chat temp.baz;


Say I wanted the code to be sent to more than one NPC? I don't want to change the code to each NPC individual though when I duplicate the first, because that would be hard :(

Cubical 06-19-2013 11:52 PM

Chris and Jerret both posted about this I just happened to be able to find jerrets first.

http://forums.graalonline.com/forums...98&postcount=3

baseman101 06-19-2013 11:58 PM

Quote:

Originally Posted by Cubical (Post 1719436)
Chris and Jerret both posted about this I just happened to be able to find jerrets first.

http://forums.graalonline.com/forums...98&postcount=3

Thanks, I wasn't able to find this useful post.


All times are GMT +2. The time now is 11:08 PM.

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