PDA

View Full Version : New GS2 commands.rtf


_Z3phyr_
10-11-2006, 04:03 AM
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)

Rapidwolve
10-11-2006, 04:41 AM
Nice :)

xXziroXx
10-11-2006, 04:52 AM
'Nice', but I most likely wont use it..

_Z3phyr_
10-11-2006, 05:07 AM
'Nice', but I most likely wont use it..

you're welcome

ApothiX
10-11-2006, 06:12 AM
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.

Tolnaftate2004
10-11-2006, 07:37 AM
// 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)

_Z3phyr_
10-11-2006, 07:49 AM
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.

ApothiX
10-11-2006, 03:10 PM
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:
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.

_Z3phyr_
10-11-2006, 04:27 PM
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

Mykel
10-11-2006, 04:51 PM
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 outYou 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.

_Z3phyr_
10-11-2006, 04:59 PM
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?)

Tolnaftate2004
10-12-2006, 01:04 AM
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.

Skyld
10-12-2006, 01:05 AM
#messagecodes are obsolete.

_Z3phyr_
10-13-2006, 05:03 AM
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

_Z3phyr_
01-30-2007, 09:00 AM
bizzump because it doesn't sizzuck

PrinceDark
02-02-2007, 07:46 AM
Does this have mostly everything or does it still have a ways to go?

Tolnaftate2004
02-02-2007, 10:42 PM
It's neither finished nor particularly accurate.

_Z3phyr_
02-03-2007, 02:25 AM
Does this have mostly everything or does it still have a ways to go?
Well of course it doesn't have -everything- in the sense of "you can do ___ with a ___" or whatever, but its basically a list of commands for people who know GS1 and want quick clarification of stuff for GS2.

And if anyone have a problem with how innaccurate it is, feel free to post a new version or PM me an updated one.

Chandler
02-03-2007, 08:14 AM
Well of course it doesn't have -everything- in the sense of "you can do ___ with a ___" or whatever, but its basically a list of commands for people who know GS1 and want quick clarification of stuff for GS2.

And if anyone have a problem with how innaccurate it is, feel free to post a new version or PM me an updated one.

There is a wiki full of this information...

PrinceDark
02-03-2007, 08:20 AM
Ahh you might wanna eliminate the message codes. Reference stuff like player.head, player.shield, player.colors[index], and so on instead.

Keep up the work though. Something like this is good to have as reference, just be sure to correct and take note on peoples suggestions. :)

godofwarares
02-03-2007, 02:41 PM
Message codes . . . Bleh.