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-23-2001, 07:31 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
triggeraction

will someone please help me to comprende' the triggeraction params cause i just dont have a really good idea bout em ....
Reply With Quote
  #2  
Old 09-23-2001, 09:12 PM
IceHawk IceHawk is offline
Jenseits von Gut und Böse
IceHawk's Avatar
Join Date: Mar 2001
Location: Vancouver BC, Canada
Posts: 4,704
IceHawk will become famous soon enough
Send a message via AIM to IceHawk
[PENCHOO]
triggeraction is the easiest yet most advanced command I know..

so I say..

"triggeraction, making newbie scripters look good"
__________________
Reply With Quote
  #3  
Old 09-24-2001, 01:01 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Re: triggeraction

Quote:
Originally posted by nyghtGT
will someone please help me to comprende' the triggeraction params cause i just dont have a really good idea bout em ....
triggeraction x,y,action,params;

Take this example:
NPC Code:

if (weaponfired) {
triggeraction playerx+1.5+vecx(playerdir)*2,playery+2+vecy(playe rdir)*2,myaction,#a;
}


That will trigger an action at the specified X and Y coordinates. The action name is myaction. There is 1 parameter, which is the account name of the player.
NPC Code:

if (actionmyaction) {
message #p(0);
}


If this npc gets activated by the weapon triggeraction, it displays the first parameter as it's message.

#p(n) is a string value which holds the nth action. n is any number between 0 and whatever Stefan made the maximum value be, which I think is 4.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #4  
Old 09-24-2001, 05:30 AM
SSRobgeta SSRobgeta is offline
Ebil Cloud = l337 *kupo*
SSRobgeta's Avatar
Join Date: Aug 2001
Location: Monroeville, PA
Posts: 1,084
SSRobgeta is on a distinguished road
Send a message via AIM to SSRobgeta
I don't even care!
__________________
Rob Getashu
Anyone can show you the way, but the real adventure is finding it yourself..
Reply With Quote
  #5  
Old 09-25-2001, 11:08 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
ok so ...

ok so if i did ....

if (weaponfred) {triggeraction 24,34,my action,#a;
}

if (my action) {
putexplosion3,x,y;
}

That would put an explosion there right ? (at 24,34)
Reply With Quote
  #6  
Old 09-25-2001, 11:44 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Re: ok so ...

Quote:
Originally posted by nyghtGT
ok so if i did ....

if (weaponfred) {triggeraction 24,34,my action,#a;
}

if (my action) {
putexplosion3,x,y;
}

That would put an explosion there right ? (at 24,34)
No.

triggeraction x,y,action,param;

X and Y are the coordinates of the triggeraction event. Action is the action. Param are the parameters.

NPC Code:

if (weaponfired) {
this.x=24;
this.y=34;
triggeraction playerx+1.5+vecx(playerdir),playery+2+vecy(playerd ir),explosion,#v(this.x),#v(this.y);
}

if (actionexplosion) {
this.explosionX=strtofloat(#p(0));
this.explosionY=strtofloat(#p(1));
putexplosion 3,this.explosionX,this.explosionY;
}


In this code, it sends a triggeraction with the parameters 24 and 34. 24 is saved in the string #p(0) and 34 in the string #p(1). Once the NPC which holds the action is activated, it sets the values of #p(0) and #p(1) into the variables this.explosionX and this.explosionY. It then uses those variables to create the explosion.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #7  
Old 09-25-2001, 12:17 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Re: Re: ok so ...

Quote:
Originally posted by BocoC

NPC Code:

if (weaponfired) {
this.x=24;
this.y=34;

triggeraction playerx+1.5+vecx(playerdir),playery+2+vecy(playerd ir),explosion,#v(this.x),#v(this.y);
}

if (actionexplosion) {
this.explosionX=strtofloat(#p(0));
this.explosionY=strtofloat(#p(1));
putexplosion 3,this.explosionX,this.explosionY;
}


Please explain the 'vecx(playerdir),playery+2+vecy(playerdir)
what does the vecx and vecy stand for ? (vecinity ??)
Reply With Quote
  #8  
Old 09-26-2001, 04:02 AM
SSRobgeta SSRobgeta is offline
Ebil Cloud = l337 *kupo*
SSRobgeta's Avatar
Join Date: Aug 2001
Location: Monroeville, PA
Posts: 1,084
SSRobgeta is on a distinguished road
Send a message via AIM to SSRobgeta
Quote:
Originally posted by SSRobgeta
I don't even care!
WHAT A *****!
__________________
Rob Getashu
Anyone can show you the way, but the real adventure is finding it yourself..
Reply With Quote
  #9  
Old 09-26-2001, 04:08 AM
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~

*zips in to beat Boco*

Quote:
Please explain the 'vecx(playerdir),playery+2+vecy(playerdir)
As stated in commands.doc:
Quote:
vecx( dir ) vertical movement vector (0,-1,0,1)

vecy( dir ) horizontal movement vector (-1,0,1,0)
If you know arrays, you'll know that it will call one of those four numbers based on the players direction.

And that's the best I'm explaining ^_^;
__________________


If the post says ~AlphaFlame~, that's who's posting. If not, it's Entravial (owner)
Reply With Quote
  #10  
Old 09-26-2001, 08:45 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
ok

i think i have a somewhat ok understanding now ...
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:03 PM.


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