![]() |
triggeractions in classes
On Uprising we are using a class for dropped items. It's joined with putnpc2. But, we need to use triggeraction, but we can't get them to work the way you use them in weapons. Can anyone tell me how to use triggeractions in classes joined to npcs layed with putnpc2? Oh, and in normal NPCs as well.
|
There shouldn't be differences to normal npc scripts. What exactly do you try to do with the trigger?
|
Well, the person who was doing it was trying to get it to trigger to serverside to destroy when the player clicked on it. Of course, then I realized the onActionLeftMouse() worked serverside. lol
|
Haha, that's correct =]
|
Quote:
For future reference, you trigger to the serverside in class npcs the same you would in a level PHP Code:
EXAMPLE: PHP Code:
The format is different from the way it's set up for weapon npcs. Also take note that everything you put in the params will start with params[0] and not params[1]. |
PHP Code:
|
Well...I still haven't been able to get triggeractions in level npcs working. I've tried just about everything, including what you guys have mentioned.
Last thing I tried was this: NPC Code: |
You need to set a shape to the npc so that an object is set, and you need to specify an x and y when triggering in a level/class npc.
PHP Code:
|
Ah! Thank you very much. =0
|
I am not too sure, but I am pretty sure you can use triggerserver, I think I've seen it used before inside a class...
Make a new function that finds the NPC and also sends the action to the serverside function onCreated() { this.tiggerServer(pars); } That basically finds the current NPC (findNPC()) and then do the actionServerside part! |
I've never heard nor seen triggerserver being used in classes/level npcs, for I've always been under the impression that it is not possible. Why don't you test it out and report your results?
|
Quote:
''http://forums.graalonline.com/forums/showthread.php?p=1248203#post1248203'' |
| All times are GMT +2. The time now is 08:39 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.