Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-11-2001, 09:09 AM
lordhelmut lordhelmut is offline
Registered User
lordhelmut's Avatar
Join Date: Aug 2001
Posts: 710
lordhelmut is on a distinguished road
Send a message via ICQ to lordhelmut Send a message via AIM to lordhelmut Send a message via Yahoo to lordhelmut
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.
__________________

Check out the development at:
http://razza.org/lordhelmut/FantasyTales/index
Reply With Quote
  #2  
Old 09-11-2001, 09:11 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
all I know is that it makes stuff happen :o
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #3  
Old 09-11-2001, 09:39 AM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to 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
__________________
Thanks,
-KJL
Reply With Quote
  #4  
Old 09-11-2001, 10:13 AM
aesquivel aesquivel is offline
Registered User
Join Date: Sep 2001
Location: Whitewright
Posts: 346
aesquivel is on a distinguished road
Send a message via AIM to aesquivel
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
__________________
Reply With Quote
  #5  
Old 09-11-2001, 12:39 PM
entravial entravial is offline
Registered User
entravial's Avatar
Join Date: Mar 2001
Posts: 825
entravial is on a distinguished road
Send a message via ICQ to entravial Send a message via AIM to entravial Send a message via Yahoo to entravial
~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.
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #6  
Old 09-11-2001, 05:49 PM
toad1413 toad1413 is offline
toad@graal:~$ ./Oldbie
Join Date: May 2001
Location: Aust.
Posts: 3,819
toad1413 is on a distinguished road
Send a message via ICQ to toad1413
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?
__________________
Creator of the original 'spam' icon. Worst mistake I ever made on these forums.
Reply With Quote
  #7  
Old 09-11-2001, 08:18 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster


Yes, it triggers both.
Reply With Quote
  #8  
Old 09-12-2001, 04:45 AM
ownerofbabylon ownerofbabylon is offline
Lord Helmut
ownerofbabylon's Avatar
Join Date: Jun 2001
Location: Gainesville FL
Posts: 1,763
ownerofbabylon is on a distinguished road
Send a message via ICQ to ownerofbabylon Send a message via AIM to ownerofbabylon
what kinda stuff can u put into the params part of it?
__________________


Warrior of Light

WWW.BABYLONSERVER.COM
Reply With Quote
  #9  
Old 09-12-2001, 06:04 AM
Silver Knight Silver Knight is offline
The Ice Cream Social
Silver Knight's Avatar
Join Date: Jun 2001
Location: SoCal
Posts: 541
Silver Knight is on a distinguished road
Send a message via AIM to Silver Knight
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.
__________________
Reply With Quote
  #10  
Old 09-12-2001, 09:32 AM
toad1413 toad1413 is offline
toad@graal:~$ ./Oldbie
Join Date: May 2001
Location: Aust.
Posts: 3,819
toad1413 is on a distinguished road
Send a message via ICQ to toad1413
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...
__________________
Creator of the original 'spam' icon. Worst mistake I ever made on these forums.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:24 PM.


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