Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Converting GS1 to GS2 (https://forums.graalonline.com/forums/showthread.php?t=74942)

PrinceOfKenshin 06-28-2007 09:02 PM

Converting GS1 to GS2
 
I am bored at my brother's place so if anyone wants some of their GS1 scripts converted to GS2 post them and i will see what i can do. :D

PrinceOfKenshin 06-29-2007 01:38 AM

:cry: no one? lol come on..you can pm me your script if you don't want people looking at it.

kia345 06-29-2007 01:46 AM

All of Delteria.

PrinceOfKenshin 06-29-2007 02:08 AM

Haha sure why not? I can try.:D

Gambet 06-29-2007 03:10 AM

Quote:

Originally Posted by kia345 (Post 1323679)
All of Delteria.




What many people fail to realize is that servers do not need to convert everything in NC to GS2. You only need to convert the things that don't work when transferred over to the GS2 engine.

Inverness 06-29-2007 04:17 AM

Indeed, however, everything should be GS2 >:P

coreys 06-29-2007 08:12 AM

Quote:

Originally Posted by Inverness (Post 1323717)
Indeed, however, everything should be GS2 >:P

<3

And, if that were the case Gambet...a LOT would need to be made GS2...basically anything with a serverside portion.

Gambet 06-29-2007 08:43 PM

Quote:

Originally Posted by coreys (Post 1323765)
<3

And, if that were the case Gambet...a LOT would need to be made GS2...basically anything with a serverside portion.



Not exactly, I mean, a large portion of Zone is still in GS1 because it works fine.

PrinceOfKenshin 06-29-2007 08:45 PM

Quote:

Originally Posted by Gambet (Post 1323925)
Not exactly, I mean, a large portion of Zone is still in GS1 because it works fine.

The only reason for converting everything to gs2 is so that its just all the same language. I mean i personally agree if it works in gs1 then leave it be. But some people want to keep it all in the same language.

theHAWKER 06-29-2007 09:19 PM

heres one ;D
PHP Code:

//#CLIENTSIDE
if (playerenters) {
hide;
playerx=int(playerx);
playery=int(playery);
playerdir=3;
timeout=0.05;
theHAWKER.isKickAss true;
}
if (
timeout) {
if (!
antigravity) {
if (
keydown(0)&&playersprite>=1&&playersprite<=8playery+=0.5;
if (
playerdir==0||playerdir==2playerdir=gravdir;
if (
onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)) {
velocity=0;
playery=int(playery);
if (
keydown(6)) velocity=-2;

}
else if (
keydown(2)&&playersprite>=1&&playersprite<=8playery-=0.5;
if (
onwall(playerx+0.5,playery-0.1)||onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)||onwall(playerx+1.5,playery-0.1)) velocity=0.1;
else {
if (
velocity>-0.1&&velocity<=0velocity=0.1;
if (
velocity>3velocity=3;
}
if (
abs(velocity)>0) {
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
if ((
velocity>0&&(onwall(playerx+0.5,playery+3)||onwall(playerx+1.5,playery+3)))||(velocity<0&&(onwall(playerx+0.5,playery)||onwall(playerx+1.5,playery)))) playery=int(playery);
else 
playery+=velocity/6;
}
velocity+=abs(velocity/4);
if (
this.shot==9) {
hideimg 345;
this.shot=0;
}
if (
this.shot>0) {
if (
this.sd==1this.sx-=0.75;
if (
this.sd==3this.sx+=0.75;
showimg 345,busterl2d#v(this.sd).gif,this.sx,this.sy;
if (this.sd==1) {
if (
testplayer(this.sx,this.sy)>-2hitplayer testplayer(this.sx,this.sy),2,playerx,playery;
if (
testnpc(this.sx,this.sy)>-2hitnpc testnpc(this.sx,this.sy),2,playerx,playery;
if (
testcompu(this.sx,this.sy)>-2hitcompu testcompu(this.sx,this.sy),2,playerx,playery;
}
if (
this.sd==3) {
if (
testplayer(this.sx+1,this.sy)>-2hitplayer testplayer(this.sx+1,this.sy),2,playerx,playery;
if (
testnpc(this.sx+1,this.sy)>-2hitnpc testnpc(this.sx+1,this.sy),2,playerx,playery;
if (
testcompu(this.sx+1,this.sy)>-2hitcompu testcompu(this.sx+1,this.sy),2,playerx,playery;
}
this.shot++;
}
if (
playersprite==11&&playerhearts==playerfullhearts) {
this.shot=1;
this.sd=playerdir;
if (
this.sd==1) {
this.sx=playerx-2;
this.sy=playery+1;
}
if (
this.sd==3) {
this.sx=playerx+2;
this.sy=playery+1;
}
showimg 345,busterl2d#v(this.sd).gif,this.sx,this.sy;
}
if ((
keydown(0)||keydown(2))&&!(keydown(1)||keydown(3))) playersprite=0;
if (
keydown(1)&&!keydown(3)) playerdir=1;
if (
keydown(3)&&!keydown(1)) playerdir=3;
gravdir=playerdir;
}
timeout=0.05;
}
if (
created) {
if (
keydown(6)) {setani jumpnrun,;}



coreys 06-30-2007 01:21 AM

PHP Code:

//#CLIENTSIDE
function onPlayerEnters() {
  
hide();
  
player.int(player.x);
  
player.int(player.y);
  
player.dir 3;
  
setTimer(0.05);
  
coreys.isKickAss true;
}
function 
onTimeOut() {
  if (!
antigravity) {
    if (
keydown(0) && playersprite >= && playersprite <= 8player.+= 0.5;
    if (
playerdir == 0||playerdir == 2player.dir gravdir;
    if (
onwall(player.0.5,player.3)||onwall(player.1.5,player.3)) {
      
velocity=0;
      
player.y=int(player.y);
      if (
keydown(6)) velocity=-2;
    }
    else if (
keydown(2) && playersprite >= && playersprite<=8player.-= 0.5;
    if (
onwall(player.0.5,player.0.1)||onwall(player.0.5,player.y)||onwall(player.1.5,player.y)||onwall(player.1.5,player.0.1)) velocity 0.1;
    else {
      if (
velocity > -0.1 && velocity <= 0velocity 0.1;
      if (
velocity 3velocity 3;
    }
    if (
abs(velocity) > 0) {
      
player.+= velocity/6;
      if ((
velocity && (onwall(player.0.5,player.3) || onwall(player.1.5,player.3))) || (velocity && (onwall(player.0.5,player.y) || onwall(player.1.5,player.y)))) player.int(player.y);
      else 
player.+= velocity/6;
      if ((
velocity && (onwall(player.0.5,player.3) || onwall(player.1.5,player.3))) || (velocity && (onwall(player.0.5,player.y) || onwall(player.1.5,player.y)))) player.int(player.y);
      else 
player.+= velocity/6;
    }
    
velocity += abs(velocity/4);
    if (
this.shot == 9) {
      
hideimg(345);
      
this.shot=0;
    }
    if (
this.shot 0) {
      
showimg(345,"busterl2d" this.sd ".gif",this.sx,this.sy);
      if (
this.sd == 1) {
        
this.sx -= 0.75;
        if (
testplayer(this.sx,this.sy) > -2hitplayer(testplayer(this.sx,this.sy),2,player.x,player.y);
        if (
testnpc(this.sx,this.sy) > -2hitnpc(testnpc(this.sx,this.sy),2,player.x,player.y);
        if (
testcompu(this.sx,this.sy) >- 2hitcompu(testcompu(this.sx,this.sy),2,player.x,player.y);
      }
      if (
this.sd == 3) {
        
this.sx += 0.75;
        if (
testplayer(this.sx+1,this.sy) >- 2hitplayer(testplayer(this.sx+1,this.sy),2,player.x,player.y);
        if (
testnpc(this.sx+1,this.sy) >- 2hitnpc(testnpc(this.sx+1,this.sy),2,player.x,player.y);
        if (
testcompu(this.sx+1,this.sy) >- 2hitcompu(testcompu(this.sx+1,this.sy),2,player.x,player.y);
      }
      
this.shot++;
    }
    if (
playersprite == 11 && player.hearts == player.fullhearts) {
      
this.shot 1;
      
this.sd player.dir;
      if (
this.sd == 1) {
        
this.sx player.2;
        
this.sy player.1;
      }
      if (
this.sd == 3) {
        
this.sx player.2;
        
this.sy player.1;
      }
      
showimg(345,"busterl2d" this.sd ".gif",this.sx,this.sy);
    }
    if ((
keydown(0) || keydown(2)) && !(keydown(1) || keydown(3))) playersprite 0;
    if (
keydown(1) && !keydown(3)) player.dir 1;
    if (
keydown(3) && !keydown(1)) player.dir 3;
    
gravdir player.dir;
  }
  
setTimer(0.05);
}
function 
onCreated() if (keydown(6)) setani("jumpnrun",NULL); 

No guarantee's it all works. I'm not exactly the best scripter in the world.

Twinny 06-30-2007 05:13 AM

Quote:

Originally Posted by Gambet (Post 1323925)
Not exactly, I mean, a large portion of Zone is still in GS1 because it works fine.

I thought having both languages run at the same time was more inefficient than just having GS1 :confused:

Gambet 06-30-2007 08:51 AM

Quote:

Originally Posted by Twinny (Post 1324101)
I thought having both languages run at the same time was more inefficient than just having GS1 :confused:



GS2 allows you to do things GS1 doesn't, yes, but if the GS1 code is efficient itself, then there is no need in converting it unless one must alter it in a way that would be more efficient in GS2.

It all depends on whether or not converting to GS2 would make a difference in efficiency in that certain script.

zokemon 06-30-2007 10:07 AM

But GS1 is ugly! :frown:

Gambet 06-30-2007 11:05 PM

Quote:

Originally Posted by zokemon (Post 1324138)
But GS1 is ugly! :frown:



GS1 is more challenging than GS2 since GS2 comes with a lot of predefined functions such as the GUI Ctrls and so forth, while GS1 is much more limiting and requires everything to be done custom.


But, yes, I dislike GS1 as well. :)

Inverness 06-30-2007 11:43 PM

GS1 is highly illogical >_>.

theHAWKER 07-01-2007 02:26 AM

but its a lot easyer to just put:
message hey jeff!;
instead of:
this.chat = "hey jeff!";

coreys 07-01-2007 03:18 AM

Not really. About the same, really.
You can still use message() too, ya know...

Inverness 07-01-2007 04:04 AM

Quote:

Originally Posted by theHAWKER (Post 1324446)
but its a lot easyer to just put:
message hey jeff!;
instead of:
this.chat = "hey jeff!";

So?

That doesn't mean its proper, and thats not even quite the same thing. message() worked for all npcs even if they weren't a 'character', the 'chat' variable is for character, npc or player.


All times are GMT +2. The time now is 04:53 AM.

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