Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   GScript <-> GScript2 (https://forums.graalonline.com/forums/showthread.php?t=55859)

Andares 10-29-2004 08:38 PM

GScript <-> GScript2
 
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.

Quote:

Originally Posted by Kaimetsu
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

Quote:

Originally Posted by Slash-P2P
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

Quote:

Originally Posted by Lance
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

Quote:

Originally Posted by Dach
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

Quote:

Originally Posted by Slash-P2P
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

Quote:

Originally Posted by Loriel
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

Quote:

Originally Posted by Slash-P2P
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

Quote:

Originally Posted by Kaimetsu
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

Quote:

Originally Posted by Slash-P2P
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

Quote:

Originally Posted by Kaimetsu
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

Quote:

Originally Posted by Kaimetsu
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.

Quote:

Originally Posted by Stefan
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?

Quote:

Originally Posted by Slash-P2P
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

Quote:

Originally Posted by Dach
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

NPC Code:

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

Quote:

Originally Posted by Stefan
NPC Code:

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

Quote:

Originally Posted by Stefan
NPC Code:

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

Quote:

Originally Posted by SlashP2P
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

Quote:

Originally Posted by falco10291029
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

Quote:

Originally Posted by falco10291029
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

Quote:

Originally Posted by Stefan
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

Quote:

Originally Posted by Slash-P2P
That's supposed to be simple?

Looks simple. Current gScript looks more complicated to me.

Slash-P2P 11-09-2004 06:13 AM

Quote:

Originally Posted by LogicBot
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

Quote:

Originally Posted by Kaimetsu
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:
NPC Code:

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

Quote:

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


All times are GMT +2. The time now is 03:20 AM.

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