Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Announcements (https://forums.graalonline.com/forums/forumdisplay.php?f=240)
-   -   Gs3 (https://forums.graalonline.com/forums/showthread.php?t=134268072)

Cubical 05-22-2013 01:45 PM

I also had this problem when I initially tried it.

Twinny 05-22-2013 01:54 PM

Quote:

Originally Posted by Cubical (Post 1718192)
I also had this problem when I initially tried it.

And you resolved it....how?

Cubical 05-22-2013 03:57 PM

I never tried again because I stopped developing and playing for the most part due to the lag not only on the classic servers but on my UC playerworld.

BlueMelon 05-22-2013 08:54 PM

Twinny it will probably take a while for it to be enabled...

Cubical 05-22-2013 09:01 PM

Quote:

Originally Posted by Stefan (Post 1716075)
The progress

We are already working on a converter which helps to convert scripts from GS2 to GS3. So a lot of work will be lifted from the programmer, and you can also use this tool for testing how the new scripting will look like.
Additional following things can be important to know:
- existing scripts will still run, we don't force the new syntax and semantic, but it can be interesting for server-side logic and also new client-side code
- just add a //#GS3 line to your script to use the new syntax and semantic
- some syntax of the new Graal script is already supported but currently ignored (like var statements)

That is implying that it is already enabled

MysticalDragon 05-22-2013 11:38 PM

Its currently enabled on Zone Iphone but not Delteria Iphone. The reason probably is because its half done? It works in NPC Weapons but not classes.

callimuc 05-23-2013 12:51 AM

it is also disabled on Era iPhone

BlueMelon 05-23-2013 01:47 AM

PHP Code:

//#GS3

function onCreated() {
  echo(
getAddition(1,2));
}

function 
getAddition(a:numberb:number):number 
  var 
result:number b
  return 
result


Works on era, but the class example does not.

Admins 05-23-2013 01:52 AM

We have not enabled it yet on Graal servers. Part of the syntax has already been accepted (but ignored) for a few years.

Twinny 05-23-2013 04:22 AM

Quote:

Originally Posted by BlueMelon (Post 1718214)
PHP Code:

//#GS3

function onCreated() {
  echo(
getAddition(1,2));
}

function 
getAddition(a:numberb:number):number 
  var 
result:number b
  return 
result


Works on era, but the class example does not.

Guess it's very lenient..i figured it would have kicked up a shitstorm considering you didn't specify a return type for onCreated() (i.e. void)

So how do we go about getting it enabled?

Skyld 06-03-2013 06:23 PM

For what it's worth the V8 NPC-Server prototype that we tested was a much better idea than this. :(

Twinny 06-05-2013 11:39 AM

Quote:

Originally Posted by Skyld (Post 1718776)
For what it's worth the V8 NPC-Server prototype that we tested was a much better idea than this. :(

You should have made it work then >: (

Gunderak 06-16-2013 07:16 AM

Just tested this on Zone, why... It didn't give any error at all.
PHP Code:

  var list:int[];
  list = {
12"Test"}; 

Also curious, why this didn't work.
PHP Code:

//#GS3
class Person extends TStaticVar{
  var 
nickname:string;
}
function 
onCreated():void{
  
//Create an array of type Person
  
var list:Person[];
  
//Create some Person objects.
  
var me:Person = new Person();
  
me.nickname "Nick";
  var 
them:Person = new Person();
  
them.nickname "Someone";
  
//Add them to the list
  
list.add(me);
  list.
add(them);
  
//Echo each Person element in the list
  
for(var someone:Person in list){
    echo(
"Name: "@someone.nickname);
  }


It does nothing, no errors either.

Also will there be constructors?

Sorry for the spam, but will we be able to extend a TSocket :D?

Admins 06-16-2013 01:54 PM

Yes arrays seem to be bugged, we will work on it.

Twinny 06-16-2013 04:58 PM

My desires:

Constructors (being able to overload would also be awesome but perhaps taking it too far)
PHP Code:

class Test {
  var 
myname string;
  var 
myage int;

  function 
Test(mynamestring) {
    
this.myname myname;
  }
  
//Because overloading is fun
  
function Test(myname stringmyage number) {
    
this.myname myname;
    
this.myage myage;
  }

  function 
echoValues() : void {
    
printf("My name is %s and my age is %i"this.myname, (this.myagethis.myage "Unknown"));
  }
}

function 
onCreated() : void {
  var 
TestObj Test = new Test("Twinny"25);
  
TestObj.echoValues(); 

I know getters/setters will be on the way but this just seems more natural.

I added that printf as it will fail since it's not being referenced in that class(see: extern). For this, perhaps being able to simply prepend global. to global functions would be better. On a similar note, i've not tried but i hope we could use something like super.whatever to access base class items we inherited from :o


All times are GMT +2. The time now is 11:07 PM.

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