Graal Forums

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

Zanzel 07-01-2008 11:16 PM

Triggering a class
 
I would like to know if you could help me, Vulgar has been working on trying to trigger a class to a class using multiple triggeractions, he has had no luc kand I don't really know what to say to him. :confused:

Would there be any way of doing this ?
He is trying to trigger an event in he class just like you do in a normal weapon using a triggeraction or triggerserver only they won't work.

Thnaks for your help :D

Skyld 07-01-2008 11:20 PM

You do not trigger the class itself. You trigger the NPC that the class is joined to, since all a class does is extend the NPC's functions with those defined in the class. For a level NPC, a normal triggeraction will suffice. For a database NPC or weapon, triggerserver will work.

Zanzel 07-01-2008 11:23 PM

Oh, really.. Thanks, the way Malora has its spells set up I think each spell is a class and well that wont work too well if that is the case xD

Well Maloria has hit a bump in the road this time until something's sorted out;
Thanks anyway Skyld.

zokemon 07-02-2008 01:07 AM

Just think of a class as an inlined set of functions.

Tigairius 07-02-2008 01:41 AM

Quote:

Originally Posted by Zanzel (Post 1400419)
Oh, really.. Thanks, the way Malora has its spells set up I think each spell is a class and well that wont work too well if that is the case xD

Well Maloria has hit a bump in the road this time until something's sorted out;
Thanks anyway Skyld.

If it's the correct object, why can't you just trigger the object? If it's not the correct object, why don't you just define some functions in a weapon and trigger that weapon?
For example, if you have a block in a level and you need to trigger it from clientside to serverside you could just put this in the class it's joined to:
PHP Code:

function onCreated() {
  
setshape(13232);
}
function 
onActionTrigger() {
  
chat params[0];
}
//#CLIENTSIDE
function onPlayerTouchsme() {
  
triggeraction(this.0.5this.0.5"Trigger""hi");




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

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