Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   MASM/Vb6 to GS2 (https://forums.graalonline.com/forums/showthread.php?t=134257227)

DarknessShadow 12-07-2009 11:44 PM

MASM/Vb6 to GS2
 
I'm very experienced in both MASM and VB6, I'd like to know if there is any similarities between the MASM+VB6 and GS2,Syntax wise?
Will it be a easy transfer over,easy to learn?
Thanks! :D

WhiteDragon 12-07-2009 11:51 PM

I don't know where in the world you picked up VB6, as it's not a good language, in my opinion.

In terms of syntax, VB6 is not terribly close to the C-style GS2. However, a number of the concepts are the same.

Saying "easy" would probably be inaccurate; learning GS2 will require work, like learning anything else.

In the end though, I don't believe GS2 is hard to figure out, even without prior programming experience. So, it shouldn't be terribly hard for you.

DarknessShadow 12-08-2009 12:24 AM

Quote:

Originally Posted by WhiteDragon (Post 1543139)
I don't know where in the world you picked up VB6, as it's not a good language, in my opinion.

In terms of syntax, VB6 is not terribly close to the C-style GS2. However, a number of the concepts are the same.

Saying "easy" would probably be inaccurate; learning GS2 will require work, like learning anything else.

In the end though, I don't believe GS2 is hard to figure out, even without prior programming experience. So, it shouldn't be terribly hard for you.

VB6 is a decent language with the right resources,it all depends on what your are trying to do.
The only thing i find pathetic about vb6 is Thread support,it crashes on point if you even try to create a thread. Although i found vb6 useful for DLL hooking and more along those lines. I didn't think MASM would have anywhere near the same syntax,since well nothing really has near the same syntax as ASM.
Thanks for your info,I'm reading on the wiki right now :p

Skyld 12-08-2009 12:37 AM

Quote:

Originally Posted by DarknessShadow (Post 1543143)
VB6 is a decent language with the right resources,it all depends on what your are trying to do.

Visual Basic has a very lazy "verbose" syntax; you make very heavy use of keywords to instruct it to do something. GScript is less like that, since it borrows it's syntax from ECMAScript or even C/C++. There is more notation to learn. GScript is a lot more structured also, it takes a more object-oriented approach to programming and attempts to modularise things into weapons, classes, database NPCs, etc so that to someone new coming along, they make more sense and have relatively specific purposes.

I guess there are similarities; VB will have functions and variables just the same as GScript does, because these are quite fundamental to most scripting languages, but you will find that the accepted ways of doing things are quite different.

DarknessShadow 12-08-2009 12:40 AM

Quote:

Originally Posted by Skyld (Post 1543145)
Visual Basic has a very lazy "verbose" syntax; you make very heavy use of keywords to instruct it to do something. GScript is less like that, since it borrows it's syntax from ECMAScript or even C/C++. There is more notation to learn. GScript is a lot more structured also, it takes a more object-oriented approach to programming and attempts to modularise things into weapons, classes, database NPCs, etc so that to someone new coming along, they make more sense and have relatively specific purposes.

I guess there are similarities; VB will have functions and variables just the same as GScript does, because these are quite fundamental to most scripting languages, but you will find that the accepted ways of doing things are quite different.

I do know a little C++/PHP syntax, from the few snippets I've read it seems to make sense in my head.
Is there anywhere other than the wiki to learn? Or is that where everything goes(Apart from the forums too :P )

Samposse 12-08-2009 12:04 PM

i am learning scripting to but i only can simple stuff as
PHP Code:

//#CLIENTSIDE 

function onPlayerChats(){
return;
player.chat "im Muted and cant talk !"

... i need a good tutorial ...

and i know some basic Var stuff as

PHP Code:

funcion onCreated() {
var
.1 "Hello World";
echo var
.1


Samposse 12-08-2009 12:06 PM

and i even dont know if those "scripts" works -.-

Quote:

i am learning scripting to but i only can simple stuff as

PHP Code:
//#CLIENTSIDE

function onPlayerChats(){
return;
player.chat = "im Muted and cant talk !";

... i need a good tutorial ...

and i know some basic Var stuff as


PHP Code:
funcion onCreated() {
var.1 = "Hello World";
echo var.1;

Twinny 12-08-2009 12:10 PM

Quote:

Originally Posted by Samposse (Post 1543208)

PHP Code:

funcion onCreated() {
var
.1 "Hello World";
echo var
.1


It's a mix between languages there... this would work better

PHP Code:

function onCreated()
{
  
this.var1 "Hello World!";
  echo(
this.var1);


GS2 (the current language) requires the use of ( ) to designate a function. The reason that may work is because gs1 used the 'function var' syntax without the use of parenthesis. Also, while var.1 would technically work, it's a strange way of doing it within gscript :)

As for the other script, placing a, "return; straight after the function is caused would stop the execution right there as returns stop what the function is doing and returns a result to the original caller (in this case, 0 since no value was supplied. I am not sure what you were trying to achieve with that return


All times are GMT +2. The time now is 01:35 PM.

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