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 10-17-2002, 04:59 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
if (actionblahblahblah) question.

Now, on NPCServer servers, there are various "actions"

I want to know how to "create" those actions.

Like, when someone uses the apple seed NPCW, it "does" the action "actionseed"

But how?
__________________
Reply With Quote
  #2  
Old 10-17-2002, 05:24 AM
amonrabr amonrabr is offline
Scripter
Join Date: Nov 2001
Location: Brazil
Posts: 374
amonrabr is on a distinguished road
hmm this "actions" atre from triggeractions.. example..

you put this script clientsided;

triggeraction 0,0,serverwarp,#a,onlienstartlocal.graal,30,30;


on your npc control you can have:

if (actionserverwarp){
with(getplayer(#p(0))){setlevel2 #p(1),strtofloat(#p(2)),strtofloat(#p(3))}

}

see? you put "action<something>" for triggeractions <x>,<y>,<something>,<param 1>....
Reply With Quote
  #3  
Old 10-17-2002, 05:30 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Triggeraction.

example:
[/code]
if (actionserverside){
do stuffs;
}

//#CLIENTSIDE
if (weaponfired){
triggeraction 0,0,serverside,Apple Seed,;
}

[/code]

Explaination:
The triggeraction in this NPC Weapon works like this:
NPC Code:

triggeraction x,y,serverside,Weapon Name,params;


In this case, you don't really need an x/y, so I set it to 0.
I put serverside to trigger the action SERVERSIDE. Hence the actionserverside above the clientside part of the script.
params, I'll explain them when you need them. They're tidbits of information, read by #p(NUMBER OF PARAM);

ANYWAYS.
Another example of triggeraction:
NPC Code:

if (actionseed){
do stuffs;
}

//#CLIENTSIDE
if (weaponfired){
triggeraction X,Y,seed,;
}



Explaination:
NPC Code:

triggeraction X,Y,action name,params;


Again, X/Y is the X/Y you want to trigger this action.
The action name is seen in
(actionseed).
Then there are params again.


IMPORTANT
The ACTON-whatevers are Case sensitive.
For instance, if you had WeAPon as the NPC Weapon name:
you would have to use
triggeraction 0,0,serverside,WeAPon,;
in order for it to work.

Hope it helped.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #4  
Old 10-17-2002, 05:31 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by amonrabr

if (actionserverwarp){
with(getplayer(#p(0))){setlevel2 #p(1),strtofloat(#p(2)),strtofloat(#p(3))}

}
You don't need to use getplayer because NPC Server already knows you're editing the client by using setlevel2. If the client executes the script, it will know that that is the account it's supposed to warp.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #5  
Old 10-17-2002, 10:01 AM
user13-xo user13-xo is offline
Registered User
Join Date: Nov 2001
Location: California
Posts: 297
user13-xo is on a distinguished road
Send a message via AIM to user13-xo
There is others that isnt triggeraction like:

actionleftmouse
actionmiddlemouse
actionrightmouse
actiondoublemouse
actionpushed
actionpulled
Reply With Quote
  #6  
Old 10-17-2002, 10:11 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by user13-xo
There is others that isnt triggeraction like:

actionleftmouse
actionmiddlemouse
actionrightmouse
actiondoublemouse
actionpushed
actionpulled
so...?
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #7  
Old 10-17-2002, 10:17 AM
user13-xo user13-xo is offline
Registered User
Join Date: Nov 2001
Location: California
Posts: 297
user13-xo is on a distinguished road
Send a message via AIM to user13-xo
Quote:
Originally posted by osrs


so...?
I can see youre still mad at me. :o
Reply With Quote
  #8  
Old 10-17-2002, 03:26 PM
HoudiniMan HoudiniMan is offline
Playerworld Administrator
HoudiniMan's Avatar
Join Date: Dec 2001
Location: Calfiornia - USA
Posts: 3,512
HoudiniMan will become famous soon enough
Quote:
Originally posted by osrs


so...?
I can see why; because you just posted commands with no explanation, how is that supposed to help the person asking?
__________________
-HoudiniMan (Chief Playerworld Administrator)
Compulsive Support Center Checker - 5 Years and Change
Graal Support Center

Reply With Quote
  #9  
Old 10-17-2002, 08:53 PM
user13-xo user13-xo is offline
Registered User
Join Date: Nov 2001
Location: California
Posts: 297
user13-xo is on a distinguished road
Send a message via AIM to user13-xo
So would this help?

if (actionleftmouse) message Left Click;
if (actionmiddlemouse) message Middle Button Click;
if (actionrightmouse) message Right Click;
if (actiondoublemouse) message Double Click;
Reply With Quote
  #10  
Old 10-17-2002, 11:29 PM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
I assume that since it starts with if (action...) then those certain mouse commands use triggeractions then... perhaps... who knows, oh well. but yes, you can do server or clientside triggeractions. server ones are VERY useful, but sometimes you need client ones for things such as an HP sys etc.
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #11  
Old 10-18-2002, 03:11 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by emortylone
I assume that since it starts with if (action...) then those certain mouse commands use triggeractions then... perhaps... who knows, oh well. but yes, you can do server or clientside triggeractions. server ones are VERY useful, but sometimes you need client ones for things such as an HP sys etc.
---Shifter
You don't need to use triggeraction to trigger the mouse commands.

It's just
NPC Code:

if (actionleftmouse){ //THE LEFT MOUSE BUTTON WAS CLICKED ON THE NPC
script here;
}

__________________
Quote:
Originally posted by Spark910
Think befreo you type.
Reply With Quote
  #12  
Old 10-18-2002, 06:10 AM
emortylone emortylone is offline
Registered User
Join Date: Apr 2002
Location: Control-NPC
Posts: 834
emortylone is on a distinguished road
LOL! I am QUITE aware of that =P I was SAYING that perhaps the mouse commands use triggeraction comparing it... nvm then
---Shifter
__________________
Quote:
*Stefan: it seems sometimes they hire newbie scripters everywhere x-x
*Stefan: scripters are sometimes like people that draw paintings
*Stefan: all that counts is that it looks nice
Reply With Quote
  #13  
Old 10-18-2002, 06:13 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally posted by emortylone
LOL! I am QUITE aware of that
---Shifter
Then don't state you assume that if it starts with if (action...) you think it's triggeraction'ed. You didn't sound "QUITE" aware of it in your post.
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
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 02:48 AM.


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