Thread: Trigger Action
View Single Post
  #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