![]() |
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? :)
|
GS2 is backwards-compatible. To my disapproval.
|
If I have to re-learn scripting, I'm gonna quit developing...
|
Re-learn scripting? It is pretty much the same...
|
You must have missed the memo. As Kai stated, it's already backwards compatible.
Quote:
|
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.
|
Quote:
|
Quote:
Maybe if I heard more about GScript2 I would be more interested in it... |
Quote:
|
Quote:
Old gscript is deprecated, playerworlds will not want to hire people who can only develop in an outdated language. |
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. |
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. |
Quote:
|
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
|
Which will be incredibly inferior to those that take full advantage of the great and dynamic strengths of object oriented NPCs!
|
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.
|
same here
|
Quote:
|
Quote:
|
I know a little bit of basic, and i know the basic format of C, but that's it
|
Quote:
|
Quote:
|
Quote:
Quote:
Quote:
|
Quote:
|
Does anyone have any real code examples or GS2?
All I've seen is something like: player.chat="hello" or something |
NPC Code: 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). |
Quote:
|
Quote:
|
Quote:
|
Quote:
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 |
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
|
I, personally, cannot wait. :D
|
Quote:
e.g. imagine this: setstring clientr.hp,#v(strtofloat(#s(clientr.hp)) + 1); in new script is clientr.hp++; |
Quote:
|
Quote:
|
Quote:
|
Dudes, that wasn't a string.
|
Quote:
It was a spicey meatball! How could you all have been so mistaken!? |
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: 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. |
Quote:
|
| 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.