Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Trigger Action (https://forums.graalonline.com/forums/showthread.php?t=11611)

lordhelmut 09-11-2001 09:09 AM

Trigger Action
 
Anyone feel like explaining how to use triggeraction to me? I cant find anywhere that explains it and shows u how to use it.

ownerofbabylon 09-11-2001 09:11 AM

all I know is that it makes stuff happen :o

KJS 09-11-2001 09:39 AM

here is a good example...

NPC Code:

triggeraction 1,1,warp,;



then put this coding in npc #2

NPC Code:

if (created)
setshape 1,32,32;
if (actionwarp)
setlevel2 frolic_falldown_beg.graal,34,30;


make sure this npc is at the x and y of 0,0

and make sure the picture is like bigger then 16*16 pixels (I recommand like 32*32 pixels)

oh yea make sure you dont hide it also otherwise it wont work

aesquivel 09-11-2001 10:13 AM

Quote:

Originally posted by KJS
here is a good example...

NPC Code:

triggeraction 1,1,warp,;



then put this coding in npc #2

NPC Code:

if (created)
setshape 1,32,32;
if (actionwarp)
setlevel2 frolic_falldown_beg.graal,34,30;


make sure this npc is at the x and y of 0,0

and make sure the picture is like bigger then 16*16 pixels (I recommand like 32*32 pixels)

oh yea make sure you dont hide it also otherwise it wont work


OKAY LETS TRY THAT AGAIN BUT THIS TIME S..L..O..W ..D..O..W..N PLEASE THATS LIKE TALKING SPANISH TO ME :confused:

entravial 09-11-2001 12:39 PM

~AlphaFlame~

Trigger action causes an action to happen at a specified x/y... format:

triggeraction x,y,name,params;

A NPC can detect a triggeraction by using if (actionname ).

By the way, the triggeraction has to be at the x/y of a non-transparent, visible part of the NPC...

Now, take KJS's example. It causes an action "warp" to be happened at 1,1. The NPC at 0,0 then picks up this action with it's if (actionwarp) line, and then proceeds to warp the player.

toad1413 09-11-2001 05:49 PM

Quote:

Originally posted by Kaimetsu
Hmm... If two NPCs/players occupy the same space, then do both get triggered? I'm too lazy to test it myself.
Maybe it's also because your graal is too outdated? ;)

Slaktmaster 09-11-2001 08:18 PM

:)

Yes, it triggers both.

ownerofbabylon 09-12-2001 04:45 AM

what kinda stuff can u put into the params part of it?

Silver Knight 09-12-2001 06:04 AM

Here, I shall give an example of triggeraction.
NPC Code:
if (playertouchsme) toweapons Freezing-Weapon;
if (weaponfired) {
triggeraction playerx+1.5+vecx(playerdir)*2,
playery+2+vecy(playerdir)*2,hurt,;
}
if (actionhurt) {
setani hurt,;
setplayerprop #c,Ugh;
}


Okay, I will take you through it step by step.
NPC Code:
if (weaponfired) {
triggeraction playerx+1.5+vecx(playerdir)*2,
playery+2+vecy(playerdir)*2,hurt,;
}


This part sets the action at the specified location.
NPC Code:
playerx+1.5+vecx(playerdir)*2,
playery+2+vecy(playerdir)*2,


The equation states that the action will be conducted in front of the player. This equation will always make the action be conducted in the direction of the player.
The rest is self-explainatory.

toad1413 09-12-2001 09:32 AM

Quote:

Originally posted by Kaimetsu


Hey, my Graal has feelings too. It's not outdated; it's like a vintage wine that matures with age :)

Heh. That's what they all say...


All times are GMT +2. The time now is 05:29 PM.

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