Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #30  
Old 12-28-2003, 02:47 AM
MysticHaste MysticHaste is offline
Registered User
Join Date: Dec 2003
Location: Australia
Posts: 109
MysticHaste is on a distinguished road
Send a message via AIM to MysticHaste
Okay, A Param (Parameter) is just like a trailing piece of information on an object for the most part in graal script.

setshootparams isfire,#v(this.firepower);

Could be used to tell the client that is hit (if (actionprojectile) ...) or the Server (if (actionprojectile2) ...) The parameters above might be used like this in a weapon:
(In the -Systems npc or something that all players have)
if (actionprojectile) {
// This (#p(2) is the first thing in setshootparams, so its param2 (param0 and param1 are the X,Y positions of the impact)
if (strequals(#p(3),isfire) {
damage=strtofloat(#p(1))*2; // Times by 2 because hurt works in halfhearts.
hurt damage;
}
}

if (actionprojectile2) {
if (strequals(#p(2),isfire)) {
putnpc2 strtofloat(#p(0)),strtofloat(#p(1)),{
if (created) {
setimg fire.gif;
}
}
}
}
//This puts the npc and makes it fire.gif in the position of the impact of the projectile, this code above would be in the control-npc of your server, These are just examples of how to use Params with projectiles, any mistakes I may have made please feel free to correct me, its been 3 or 4 months since I had a server to script on.

More on Params.
Params are used with almost everything.
setplayerprop #P(20) is playerprop 20 if used in the current Gani.

Triggeractions Use Params, This is how many actions are carried player to player and player to server, npc to player, npc to server etc. with serverside Scripting.

triggeraction x,y,serverside,serverwarp,#a,newx,newy,newlevel;
(With params being serverwarp,#a,newx,newy,newlevel)
(this triggers an actionserverside)
if (actionserverside) {

}

was a commonly used server action, but is not used now, because of the ease of use for a 'hacker/trainer' user to abuse the fact that almost all servers used "serverwarp" in that format they could warp themselves using it.

I found that just messing around (Fiddling around with commands) is the best way to learn, Start from the basics though.
__________________
spread the herat <3

Quote:
Originally posted by unixmad
Still not sure if it was not someone smoking to mush
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:47 AM.


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