PDA

View Full Version : GScript <-> GScript2


Andares
10-29-2004, 08:38 PM
I think that servers should be able to use both gscript and gscript2 on their server. Alot of the owners aren't going to want to rescript their entire systems, or stay using gscript alone. So why not make them backwards compatible or something? :)

Kaimetsu
10-29-2004, 09:15 PM
GS2 is backwards-compatible. To my disapproval.

Slash-P2P
10-29-2004, 09:17 PM
If I have to re-learn scripting, I'm gonna quit developing...

zell12
10-29-2004, 10:38 PM
Re-learn scripting? It is pretty much the same...

Dach
10-29-2004, 10:57 PM
You must have missed the memo. As Kai stated, it's already backwards compatible.

GS2 is backwards-compatible. To my disapproval.
Why is that? Are we losing functionality/efficiency from this? (I'm asking because I seriously don't know)

Slash-P2P
10-30-2004, 03:02 AM
I know its backwards compatible but...I don't want to learn a bunc of new scripting commands to do certain things only GS2 allows.

Lance
10-30-2004, 03:22 AM
I know its backwards compatible but...I don't want to learn a bunc of new scripting commands to do certain things only GS2 allows.

You do not wish to learn? How sad.

Slash-P2P
10-30-2004, 03:35 AM
You do not wish to learn? How sad.

I don't wish to have to learn a whole script language over again :redface:

Maybe if I heard more about GScript2 I would be more interested in it...

Kaimetsu
10-30-2004, 10:11 AM
Why is that?

Because nobody should be mixing GS1 with GS2. I would prefer to see a system where the language used is specified in some kind of directive at the top (like '//#GS1' or so).

Loriel
10-30-2004, 10:39 AM
If I have to re-learn scripting, I'm gonna quit developing...
Good bye.
Old gscript is deprecated, playerworlds will not want to hire people who can only develop in an outdated language.

Admins
10-30-2004, 12:11 PM
It's backwards compatible, you can mix old and new scripting language, you can do stuff like
player.chat = "hello " @ #a;
As long as your server wants to support Graal v2, you will need to keep the client-side scripts in old scripting though. The only thing that is not compatible with old scripting engine right now is the use of things like "this.x" which is a simple variable in old engine, while it is redirecting to the x position of the current object/npc in the new engine, will need to check what i can do about that.

LogicBot
10-30-2004, 05:13 PM
I heard that GScript2 is supposed to be easier.

And quitting just because you don't want to learn the new scripts is just arogance.

Slash-P2P
10-30-2004, 06:21 PM
Good bye.
Old gscript is deprecated, playerworlds will not want to hire people who can only develop in an outdated language.

I'm not looking to work on someones server. I own my own server.

falco10291029
10-30-2004, 06:47 PM
I'll probably learn some of it at least, but i'm not going to take the time to get as good at it as i am with good ol gscript1

Loriel
10-30-2004, 07:29 PM
Which will be incredibly inferior to those that take full advantage of the great and dynamic strengths of object oriented NPCs!

Slash-P2P
10-30-2004, 07:54 PM
I admit I'll try to learn GS2 but I don't know exactly what could make GS2 so much greater than GS1. I've barely heard anything about GS2 or seen any code examples.

falco10291029
10-30-2004, 09:08 PM
same here

Kaimetsu
10-30-2004, 09:41 PM
I admit I'll try to learn GS2 but I don't know exactly what could make GS2 so much greater than GS1

Have you ever programmed in such languages as C?

Slash-P2P
10-30-2004, 09:56 PM
Have you ever programmed in such languages as C?

No. I've used a little bit of Visual Basic but thats it.

falco10291029
10-31-2004, 12:59 AM
I know a little bit of basic, and i know the basic format of C, but that's it

Kaimetsu
10-31-2004, 11:59 AM
No

Then I cannot blame you for being unable to see the possibilities. But do not assume that they don't exist.

Slash-P2P
10-31-2004, 04:41 PM
Then I cannot blame you for being unable to see the possibilities. But do not assume that they don't exist.

I said I don't know what can make it so much better. I'm not doubting these ways exist.

Dach
11-05-2004, 09:23 PM
Because nobody should be mixing GS1 with GS2. I would prefer to see a system where the language used is specified in some kind of directive at the top (like '//#GS1' or so).
Oh, I see what you're getting at now. That'll definitely become something of a problem.

As long as your server wants to support Graal v2, you will need to keep the client-side scripts in old scripting though.
Are you saying client-side won't support GS2?

I admit I'll try to learn GS2 but I don't know exactly what could make GS2 so much greater than GS1. I've barely heard anything about GS2 or seen any code examples.
From what I've seen you shouldn't have much trouble moving from GS1 to GS2.

Kaimetsu
11-05-2004, 09:36 PM
Are you saying client-side won't support GS2?

v3.1 and upwards will support GS2, but not v2. I'm assuming Stefan will allow use of the earlier versions for a while after the new generation is released.

Slash-P2P
11-07-2004, 10:48 AM
Does anyone have any real code examples or GS2?
All I've seen is something like:
player.chat="hello" or something

Admins
11-07-2004, 03:25 PM
function compileScript() {
script = "";
script.add("function onCreated() {");

for (con: this.containers)
addControlCreationScript(script.link(),con,0);

script.add("}");
script.savelines("weapon.txt",0);

ScriptEditor.openScriptWindow(script);
}

Here an example of writing into a file (savelines), the new for-each operator, calling functions with parameters (addControlCreationScript), and calling public functions of other scripts/objects (ScriptEditor.openScriptWindow).
You can do similar things with addstring script,... instead of script.add, passing parameters by setting this. variables, and doing callnpc, but with the new script it's more simple (e.g. the functions of other objects can return values).

xAndrewx
11-07-2004, 04:10 PM
function compileScript() {
script = "";
script.add("function onCreated() {");

for (con: this.containers)
addControlCreationScript(script.link(),con,0);

script.add("}");
script.savelines("weapon.txt",0);

ScriptEditor.openScriptWindow(script);
}

Here an example of writing into a file (savelines), the new for-each operator, calling functions with parameters (addControlCreationScript), and calling public functions of other scripts/objects (ScriptEditor.openScriptWindow).
You can do similar things with addstring script,... instead of script.add, passing parameters by setting this. variables, and doing callnpc, but with the new script it's more simple (e.g. the functions of other objects can return values).
Holy, thats new graal script? :O

Slash-P2P
11-07-2004, 08:23 PM
the most confusing thing i've ever seen

Here an example of writing into a file (savelines), the new for-each operator, calling functions with parameters (addControlCreationScript), and calling public functions of other scripts/objects (ScriptEditor.openScriptWindow).
You can do similar things with addstring script,... instead of script.add, passing parameters by setting this. variables, and doing callnpc, but with the new script it's more simple (e.g. the functions of other objects can return values).

That's supposed to be simple?

falco10291029
11-08-2004, 02:31 AM
That's supposed to be simple?


I agree with slash wholeheartedly, that looks very advanced, or maybe you didn't explain it correctly, either way, it won't be easy to change over to Gscript2 :-/

Dach
11-08-2004, 09:41 PM
I agree with slash wholeheartedly, that looks very advanced, or maybe you didn't explain it correctly, either way, it won't be easy to change over to Gscript2 :-/
That would be an example of are more complex operation.

It really wasn't that hard to follow anyway, granted you have some programming knowledge.

He created a weapon file, put "function OnCreated() {" in there, used that cool for-each thing to most likely put some code in there, then added a "}", then saved the file and called the script editor to open the window.
and I just made a crappy run-on sentence of me babbling

falco10291029
11-08-2004, 11:44 PM
I got mos tof it, like the fact that it was creating something, it's just complex and a little hard to follow, and seems like it will be ahrder than gscript 1

Ajira
11-09-2004, 12:08 AM
I, personally, cannot wait. :D

Admins
11-09-2004, 03:22 AM
I got mos tof it, like the fact that it was creating something, it's just complex and a little hard to follow, and seems like it will be ahrder than gscript 1

No it's simplier, try the same with the old engine ...
e.g. imagine this:

setstring clientr.hp,#v(strtofloat(#s(clientr.hp)) + 1);

in new script is

clientr.hp++;

falco10291029
11-09-2004, 04:10 AM
No it's simplier, try the same with the old engine ...
e.g. imagine this:

setstring clientr.hp,#v(strtofloat(#s(clientr.hp)) + 1);

in new script is

clientr.hp++;

*tears of joy* Wow, editing strings with ++? It's so beautiful. But on a more serious note, i obviously meant the script you showed, not all of it since I can't possibly know what all the commands/ transformations will be like.

LogicBot
11-09-2004, 04:12 AM
That's supposed to be simple?
Looks simple. Current gScript looks more complicated to me.

Slash-P2P
11-09-2004, 06:13 AM
Looks simple. Current gScript looks more complicated to me.

Some parts look complicated (such as Stefan's example), and some parts look easy such as changing a string with ++

Kaimetsu
11-09-2004, 08:12 PM
Dudes, that wasn't a string.

protagonist
11-09-2004, 09:59 PM
Dudes, that wasn't a string.



It was a spicey meatball! How could you all have been so mistaken!?

Admins
11-09-2004, 10:18 PM
In new scripting engine all variables are variant and are handled depending on the operation, so if you do + then it is automatically converting string to float. When changing "clientr.hp" it is also automatically sending it to the client (transferred as flag/string like before).

A simplier example:

for (pl: allplayers) {
if (!(pl.x in |577,1008| && pl.y in |-200,320|)) {
pl.x = 768 + random(-5,5);
pl.y = 44 + random(-5,5);
pl.sendrpgmessage("Sorry you cannot walk out of this yet.");
}
}


This is for warping people back to the town (on graal3d) if they go out of the town. As you can see it is using the new for-each command, and you don't need to use the with-command so often anymore, since you can call functions of the object easier.

Ajira
11-09-2004, 10:33 PM
This is for warping people back to the town (on graal3d) if they go out of the town. As you can see it is using the new for-each command, and you don't need to use the with-command so often anymore, since you can call functions of the object easier.

I love it. :D

falco10291029
11-09-2004, 11:57 PM
I wished that would have crashed when i was allowed on G3d, i REALLY wanted to go play with the dragons :)

Hmm that example makes gscript 2 look better. Seems as if for certain things converting to it won't be too hard. Im geussing the for (pl: allplayers) means that it is defining pl as allplayers and will be looking at everyone's values for that.

Slash-P2P
11-10-2004, 12:50 AM
A simplier example:

for (pl: allplayers) {
if (!(pl.x in |577,1008| && pl.y in |-200,320|)) {
pl.x = 768 + random(-5,5);
pl.y = 44 + random(-5,5);
pl.sendrpgmessage("Sorry you cannot walk out of this yet.");
}
}


I understand it ^^

Benm00t
11-10-2004, 01:29 AM
I understand it ^^

So do i, and Gscript1 just went right over my head.

<3 for GScript2. Like Kai said before, if you've ever used a language like C then you should be right at home with GScript2. :-D

Slash-P2P
11-10-2004, 01:59 AM
So do i, and Gscript1 just went right over my head.

<3 for GScript2. Like Kai said before, if you've ever used a language like C then you should be right at home with GScript2. :-D

I've been using gscript1 since I first started playing Graal back in like 99 or so..

LogicBot
11-10-2004, 02:04 AM
I've been using gscript1 since I first started playing Graal back in like 99 or so..
"I started playing Graal in 1982, but then we called it 'Zelda Offline' in those days.."

:rolleyes:

And the simpler one looks more complicated. I hate it when you have to put it in: "&&.{#, script enabled}[email protected]#.. @!}" or at least thats how it looks to me. I'll get used to it. >_<

Loriel
11-10-2004, 02:21 AM
function compileScript() {
script = "";
script.add("function onCreated() {");

for (con: this.containers)
addControlCreationScript(script.link(),con,0);

script.add("}");
script.savelines("weapon.txt",0);

ScriptEditor.openScriptWindow(script);
}

Ruby (hackish):

def compile_script
script = "function onCreated() {\n"\
" #{@containers.map{|con| control_creation_script(con, 0)}.join("\n ")}\n"\
"}"
File.open('weapon.txt', 'w') {|f| f.puts script }
ScriptEditor.open_script_window(script)
end

Andares
11-10-2004, 03:28 AM
Ruby (hackish):

def compile_script
script = "function onCreated() {\n"\
" #{@containers.map{|con| control_creation_script(con, 0)}.join("\n ")}\n"\
"}"
File.open('weapon.txt', 'w') {|f| f.puts script }
ScriptEditor.open_script_window(script)
end


I'm a ruby nuby, please explain it :O.
Btw, I'd love -c on #gscript, pls.

Ajira
11-10-2004, 03:49 AM
Is there an 'estimated' date for the release of a solid v3/GScript2?

Slash-P2P
11-10-2004, 04:50 AM
Is there an 'estimated' date for the release of a solid v3/GScript2?

This is Graal Online...so...nope ^^

falco10291029
11-10-2004, 05:21 AM
This is Graal Online...so...nope

Exactly, and if they did say one....well let's just all look at G3D lol

Slash-P2P
11-10-2004, 06:27 AM
Exactly, and if they did say one....well let's just all look at G3D lol

There was supposed to be a preview in first quarter 2003 haha.

falco10291029
11-10-2004, 10:33 PM
There was supposed to be a preview in first quarter 2003 haha.

My sentiments exactly.

Loriel
11-10-2004, 11:32 PM
I'm a ruby nuby, please explain it :O.
Btw, I'd love -c on #gscript, pls.
Query me on freenode ;)

zokemon
11-13-2004, 06:38 AM
It looks simple to me o.o
Although I did learn Torque Engine script in 2 hours just from looking at the sample files...

Kaimetsu
11-13-2004, 01:50 PM
Although I did learn Torque Engine script in 2 hours just from looking at the sample files...

I am completely and unsarcastically certain that this is true!

Crono
11-13-2004, 02:15 PM
Stefan that warping script for graal 3d looks simple. Even I understand it.

zokemon
11-13-2004, 08:53 PM
I am completely and unsarcastically certain that this is true!

Ehh...?

falco10291029
11-15-2004, 02:46 AM
hey, question. WIll you be able to use Gscript 1 and 2 in the exact same script, like:

if (playerenters) {
for (q: players//not sure if this is usable, just trying to use a gs2 command) {

if (q.x>30) setplayerprop#c, HOLY CRAP! I have been seen with my x above 30 with a combined script that uses GS1 and 2!;

}


}

Kaimetsu
11-15-2004, 03:47 AM
WIll you be able to use Gscript 1 and 2 in the exact same script

This has already been answered in the thread. Recap: Yes, but don't.

falco10291029
11-15-2004, 03:59 AM
Oh, geuss i misunderstood that part

MysticalDragon
11-18-2004, 05:10 PM
it should be released soon :( ,expecially for the ones that want everything to be done in Gscript2 like Element.

Ajira
11-18-2004, 09:37 PM
it should be released soon :( ,expecially for the ones that want everything to be done in Gscript2 like Element.
Hope you're right...

falco10291029
11-18-2004, 09:39 PM
I'll most likely use mainly Gscript1 but adding in things from gscript2 that make the script more efficient.

Slash-P2P
11-18-2004, 10:27 PM
I'll probably redo Element in GS2.

zokemon
11-19-2004, 12:22 AM
it should be released soon :( ,expecially for the ones that want everything to be done in Gscript2 like Element.
I'll probably redo Element in GS2.

;)

Admins
11-19-2004, 12:40 PM
We are currently testing the new scripting engine and new mudlib with Graal Kingdoms (on hidden server "Scriper Server"). Those are the incompatibilities which I have seen yet:

- this.timeout, this.x, this.y etc. are mapped to timeout,x,y in the new engine, while in the old engine they are normal variables; this is not simple to fix, so it would be better if the scripts are fixed, the npcserver could eventually give a warning if such variables are found when compiling the script

- if (x,y in |0,64|) doesn't work because the comma makes problems; it would be better to write if (x in |0,64| && y in |0,64|)

- function SetAni() { setani sword,; } doesn't work, because "setani sword,;" is internally converted to "setani("sword","")" and function names are case-insensitive, so it would either cause an "endless" loop (if it is allowed to overwrite default functions, like it is currently), or calls to SetAni() wouldn't work because it would call the default function (if overwriting of default functions is not allowed); in the old engine it was not a problem because functions and commands were handled differently

zokemon
11-19-2004, 07:08 PM
Sounds much better handled then Gscript1 :)

Slash-P2P
11-20-2004, 12:15 AM
We are currently testing the new scripting engine and new mudlib with Graal Kingdoms (on hidden server "Scriper Server").

Release the old mudlib for Graal Kingdoms :cool:

zokemon
11-20-2004, 02:47 AM
Release the old mudlib for Graal Kingdoms :cool:

Give me money :cool: