Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-11-2006, 03:03 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
New GS2 commands.rtf

I'm not sure if this would count as a script, but I'm rather sure that this deserves to be put in this forum board nonetheless.

I have recently finished converting the most recent commands.rtf I could find into GS2.

Now before you cream your pants or whatever, I have to say that I haven't been able to check everything with the wiki. I want scripters to work together on it. This doesn't mean that I'm an idiot with GS2 or anything though, but to be on the safe side I took the liberty of leaving various message codes, built-in functions, things I wasn't sure about, and whatnot alone -- I would appreciate it if people could PM me or post here with a translation.

I actively encourage any and all -knowledgeable- scripters (i.e. people who don't suck at scripting) to make edits and PM me with them so I can update this post or, if you're too lazy, to post edits that I can incorporate when I get around to it. Keep in mind that its important to be as concise as possible.

Although some commands are still there from GS1 and whatnot, I can guarantee that all the given commands and formats are correct (unless someone chimes in otherwise in a following post or I say otherwise).

I did my best to stay true to the original commands.rtf by following its formats and diction. Please post praise/worship/compliments/corrections/editions/etc. If you make a new edition pelase forum PM it to me so I can replace yours with this one (provided that its not wrong or anything).




edit -- Things I do not want the commands.rtf to become:
  • A GS2 tutorial
  • 100 pages long
  • A bad reference guide
Keep these in mind if you PM me with your own edition.
(Also please recognize that I didn't put my name -anywhere- in here so don't try to put yours in. Dach and ace2896 and all the other people in the past never did it with theirs so don't be an ostentatious homo)

This may not be perfect or exactly "politically correct" so to speak, but this is definately a working commands.rtf and does its job.

(Latest Edition: 11 Oct 2006)
Attached Files
File Type: zip commands.zip (14.0 KB, 872 views)

Last edited by _Z3phyr_; 10-11-2006 at 07:03 AM..
Reply With Quote
  #2  
Old 10-11-2006, 03:41 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Nice
Reply With Quote
  #3  
Old 10-11-2006, 03:52 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
'Nice', but I most likely wont use it..
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #4  
Old 10-11-2006, 04:07 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
Quote:
Originally Posted by xXziroXx View Post
'Nice', but I most likely wont use it..
you're welcome
Reply With Quote
  #5  
Old 10-11-2006, 05:12 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
function funcname() { operations; }
should probably be:
function funcname(parameters) { operations; }

--

return; ends the function immediatelly and returns to the function caller
Might be:
return value; ends the function immediatelly and returns the value specified. (If no value is specified 'null' or 0 is returned)

--

triggeraction(x,y,actionname,params); triggers an ‘if (action<action>)...’ on the objects on (x,y)
should be updated to gscript2 aswell:
triggeraction(x,y,actionname,params); triggers an ‘onAction<Action>()...’ on the objects on (x,y)

--

This is no longer correct:
this. variables that start with ‘this.’ are only accessible for the npc itself
and something should be written up for 'temp.' and non-prefixed variables aswell.

--

Built-in Flags/Events (function on...() {) true when:
...
onwall( x, y ) the specified field is blocked

You can't use functions with the syntax onOnWall(x,y)() etc. This section should be revised to differentiate functions from flags.

--

str SPC str inserts a space between two strings
should be appended after:
str NL str line break ( NL is an abbreviation for 'newline' )

These should be moved to the operators section, aswell.

--

@ should be added to the operators section, as a string concatination method.

--

Some things need to be marked as deprecated, and some things in that no longer work correctly.


These are the things I've noticed at first glance. If I have time tomorrow or something I will go through it again and possibly write up something for the ones I didn't provide much information for.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #6  
Old 10-11-2006, 06:37 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
// for program execution
for (needle: haystack)
do { ... } while(condition);
switch (variable)
case value:
default:

// complex npc operations:
...
echo( string ) outputs 'string' to the player's log on clientside or in the NPC-Control on serverside

"Special Symbols" (??? Operators)
| bitwise or
xor bitwise xor
<< bitwise shift left
>> bitwise shift right
& bitwise and
{} array constructor
[] array reference (or new [size] array)
new Object constructor
?a:b tertiary operator (condition?true-case:false-case)
:: class scope operator

timeout should not be removed from built-in variables.

Uh yeah, I'll come up with more, no doubt.

#v(var) -> var
#f -> image
#e(start,len,str) -> str.substring(start,len)
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #7  
Old 10-11-2006, 06:49 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
btw guys I have a life too so don't expect me to do it immediately or within the next few days if I don't feel up to it...

You're more than welcome to attach your own edited one and say the stuff you changed -- I'll be more than happy to put the most up-to-date one in the original post.





edit -- all stuff above this post has been edited in, except for the 'for (needle: haystack)' because I'm not 100% on how to explain it so I need a description. Also I'll add the 'do while' thing in a bit because I left it out. I'll edit this again

I'd appreciate it if you'd PM me the changes and stuff instead of post them here because I don't want people to look at the thread and then scroll down to see everything that might be wrong with it.

Last edited by _Z3phyr_; 10-11-2006 at 07:05 AM..
Reply With Quote
  #8  
Old 10-11-2006, 02:10 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by _Z3phyr_ View Post
I'd appreciate it if you'd PM me the changes and stuff instead of post them here because I don't want people to look at the thread and then scroll down to see everything that might be wrong with it.
Well, judging by the first thing you said:
Quote:
Originally Posted by _Z3phyr_ View Post
btw guys I have a life too so don't expect me to do it immediately or within the next few days if I don't feel up to it...
I think it would be better to post corrections here, so that if you don't 'feel up to it', people will still know what needs to be changed.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #9  
Old 10-11-2006, 03:27 PM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
I hate it when you people take everything other people say word for word and then make a post with multiple quotes to make it look like you're arguing word by word.


w/e as long as it works out
Reply With Quote
  #10  
Old 10-11-2006, 03:51 PM
Mykel Mykel is offline
:o
Mykel's Avatar
Join Date: May 2002
Location: Canton, Ohio.
Posts: 5,526
Mykel has a spectacular aura about
Send a message via AIM to Mykel Send a message via MSN to Mykel
Quote:
Originally Posted by _Z3phyr_ View Post
I hate it when you people take everything other people say word for word and then make a post with multiple quotes to make it look like you're arguing word by word.


w/e as long as it works out
You said it. He is just commenting about something you said, not tearing apart every single thing. He's just proving his point. Don't get so defensive.
__________________
(Married to Skyld)
Reply With Quote
  #11  
Old 10-11-2006, 03:59 PM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
w/e lets keep on topic


please post editions and whatnot (and if the moderator wouldn't mind deleting posts from "btw guys..." to this one?)
Reply With Quote
  #12  
Old 10-12-2006, 12:04 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
it's not case default: in switch, it's just default:
also, it's not evaluating a condition, it's more reporting the value of a variable.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #13  
Old 10-12-2006, 12:05 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
#messagecodes are obsolete.
Reply With Quote
  #14  
Old 10-13-2006, 04:03 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
Quote:
Originally Posted by me
but to be on the safe side I took the liberty of leaving various message codes, built-in functions, things I wasn't sure about, and whatnot alone -- I would appreciate it if people could PM me or post here with a translation.
umm

Last edited by _Z3phyr_; 10-13-2006 at 04:10 AM.. Reason: rr
Reply With Quote
  #15  
Old 01-30-2007, 09:00 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
bizzump because it doesn't sizzuck
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 10:22 PM.


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