Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Basic NO PREVIOUS KNOWLEDGE TUTORIALS (https://forums.graalonline.com/forums/showthread.php?t=73995)

pooper200000 05-15-2007 10:45 PM

Basic NO PREVIOUS KNOWLEDGE TUTORIALS
 
Are there any basic tutorials for learning GS2? When I say basic I mean have absolutely NO previous knowledge of GS2 at all. I have found no tutorials on the wiki/this forum/ sklyds(Well his site doesn't work) that explain the basics. Does anyone know any tutorial that may help with the very very basics?

Switch 05-15-2007 10:46 PM

Yeah Supernanny and I were talking on Zone about this and we seriously need to know THE VERY BASICS of GS2. That's how much we know: NADA TING!

cbk1994 05-15-2007 11:39 PM

The basics of GS2 can be learned on either of the wikis! They require no previous knowledge! If you know GS1, that will help. If you don't, maybe you want to learn the basics in GS1, then come back to the tutorial. I strongly suggest you take a class on Java or C++, it will clear this up for you a lot!

Skyld 05-15-2007 11:45 PM

Unfortunately the VIP hosting is down at the moment, and so is my GScript Wiki. I'll see if I can get it fixed.

Rapidwolve 05-15-2007 11:51 PM

Quote:

Originally Posted by Skyld (Post 1308189)
Unfortunately the VIP hosting is down at the moment, and so is my GScript Wiki. I'll see if I can get it fixed.

Yeah I know, I am a regular user of your wiki. Was getting ready to contribute more functions but it was down. :(

Switch 05-16-2007 12:15 AM

No, I mean, C++ Takes a LONG time, so I hear. We mean ABSOLUTELY NO SCRIPTING KNOWLEGE!

Skyld 05-16-2007 12:17 AM

Quote:

Originally Posted by Rapidwolve (Post 1308192)
Yeah I know, I am a regular user of your wiki. Was getting ready to contribute more functions but it was down. :(

I've let Stefan know about it being down, he'll see if unixmad can look at it tomorrow.

pooper200000 05-16-2007 01:22 AM

Quote:

Originally Posted by cbkbud (Post 1308182)
The basics of GS2 can be learned on either of the wikis! They require no previous knowledge! If you know GS1, that will help. If you don't, maybe you want to learn the basics in GS1, then come back to the tutorial. I strongly suggest you take a class on Java or C++, it will clear this up for you a lot!

I've asked you which ones you thought were good because Ive tryed 3 and none of them have helped me I still don't understand it a bit. Could someone post some of the most basic Explanatory ones because I am having a great deal of difficulty finding them if they are there. O and on the classes note what type of classes?

Switch 05-16-2007 01:26 AM

Quote:

Originally Posted by pooper200000 (Post 1308217)
I've asked you which ones you thought were good because Ive tryed 3 and none of them have helped me I still don't understand it a bit. Could someone post some of the most basic Explanatory ones because I am having a great deal of difficulty finding them if they are there. O and on the classes note what type of classes?

Basically he means:
Don't expect us to know ANYTHING! Instead, expect us to know NOTHING. No commands, nada, zip.

Switch 05-16-2007 01:46 AM

I found one that -SORTA- works... just gets you a bit started...
http://wiki.graal.net/index.php/Crea...e#Introduction

killerogue 05-16-2007 01:47 AM

PHP Code:

function onCreated()
{
  
player.chat "Stuff.";


If you can't even figure that out, you haven't even attempted to learn anything on your own.

http://wiki.graal.net

pooper200000 05-16-2007 01:52 AM

Quote:

Originally Posted by Switch (Post 1308225)
I found one that -SORTA- works... just gets you a bit started...
http://wiki.graal.net/index.php/Crea...e#Introduction

thats the one!
Quote:

Originally Posted by killerogue (Post 1308226)
PHP Code:

function onCreated()
{
  
player.chat "Stuff.";


If you can't even figure that out, you haven't even attempted to learn anything on your own.

http://wiki.graal.net

I guess Im stupid. I spent 3 hours trying to figure it out and am still lost...

Skyld 05-16-2007 01:55 AM

I started writing http://wiki.graal.net/index.php/Crea...pt_for_Dummies ages ago, however I did not ever finish it.

DustyPorViva 05-16-2007 02:00 AM

Just because people don't grasp it as easy as others doesn't mean they haven't tried. Some people can't learn by dissecting a script and understanding it like others. Sometimes they have to be explained things on a simple level. Sometimes they have no knowledge of how scripting/coding works. How are they supposed to know to make sure to enclose each function/if in parenthesis unless they've been taught that. How about knowing to enclose strings in quotes, or even what a string is. Or that each command has to be ended with a semi-colon?
These things just aren't 'grasped' by seeing things for everyone, sometimes they have to be explained, and to be honest, the wiki seems a little bit hard to browse, especially if you don't know what you're really looking for.

PrinceOfKenshin 05-16-2007 02:04 AM

I guess the problem is...as it the same with me that we don't need the basic info on it but just how to apply certain things.

Forexample:
NPC Code:
abs(float)
arctan(float) - arcus tangens
char(ascii) - gets the character for an ascii code (char(65) returns 'A')
cos(angle) - cosinus of a radiant angle
exp(float)
float(string) - for explicitely converting a string
to number (normally done automatically though
when accessing a string with numeric operators)
format(format,parameters,...) - formats a "%s %d" string,
inserts the parameters, and returns a string
getangle(delta x,delta y)
getdir(delta x,delta y) - returns 0 for up, 1 for left,
2 for down, 3 for right
int(a) - gets the integer part of a floating point number
log(base,a)
max(a,b)
min(a,b)
printf(format,parameters,...) - same as
echo(format(format,parameters,...))
random(rangestart,rangeend)
sin(angle) - sinus of a radiant angle
sleep(time) - suspends the current script for some time
vecx(direction 0..3)
vecy(direction 0..3)
waitfor(objectname,event[,timeout]) - suspends the current script




all that yea sure it tells me what it is but how do i apply that to make it work in a script. Some things in there i understand like the obvious ones. The only other language i know is Visual Basics so im not use to programming an object oriented langauge.

Like what am i going to use arctan(float) for? stuff like that is confussing to people.

Switch 05-16-2007 02:07 AM

Quote:

Originally Posted by killerogue (Post 1308226)
PHP Code:

function onCreated()
{
  
player.chat "Stuff.";


If you can't even figure that out, you haven't even attempted to learn anything on your own.

http://wiki.graal.net

I'm just gonna guess here:
The player chats "Stuff"? And I'm guessing that you have to touch some invisible NPC in a level OR it has to be fired as a weapon..? :P

Yea I still don't get much of the http://wiki.graal.net, just most of it from the top to 3/4 down xD

DustyPorViva 05-16-2007 02:07 AM

Sadly I find the wiki lacking one thing(I've yet to see skyld's though), and that is actually what goes in commands. All it tells you is if it's a floating, integer, or string. That doesn't really help much...

Anyways, for Switch:
PHP Code:

function onCreated() 
{
  
player.chat "Stuff.";


function onCreated() // This is a function. Before GS2, things like this were called in events. Basically, if it happened, execute any code in the parenthesis. In GS1, it would be if (created) {}, but all that changed in GS2. Events were translated into their own functions. So basically this means, when the NPC is created, execute everything in the parenthesis.

{...} // As explained above, parenthesis are closed around any amount of commands executed when an event is called. All commands must be executed with an event/function and closed inside parenthesis.

player.chat = "Stuff."; // player.* is associated with anything for the player. This can be player.hearts, for their hearts, player.ap, for their ap, player.x, for their x coordinate, and so on. So, taking that, and taking the knowledge that = is assign, means that you are assigning something to the player's chat, which means you'll force them to say something. "Stuff." is a string. A string is alphanumerical. That means anything not a variable, floating value, integer, has to be enclosed in quotes, or else it won't be assigned. If you want to get basic, text has to be in quotes. And lastly, the semi-colon has to be after every command. Anytime you do 'something' end it with a semi-colon before you move onto the next thing.

xXziroXx 05-16-2007 02:08 AM

Quote:

Originally Posted by Switch (Post 1308239)
I'm just gonna guess here:
The player chats "Stuff"? And I'm guessing that you have to touch some invisible NPC in a level OR it has to be fired as a weapon..? :P

Yea I still don't get much of the http://wiki.graal.net, just most of it from the top to 3/4 down xD

What part of onCREATED is so hard to understand? -_-

killerogue 05-16-2007 02:10 AM

Well, in all honesty. I completely agree with you. And I do because a while back, I had to take a test in a program right before the school year started to determine what is the easiest way for me to learn.

I am a dependent learner, in which I mean that it's hard for me to learn something unless someone explains it or I have been taught it by someone else.

Now, unless I'm not mistaken...Isn't Switch an honors student, or so he's bragged before?

And in his signature did it not say, "Became an ok scripter blah blah"?

I'm almost sure he isn't mentally deficient, or lacking mentally in any areas. So I don't think it would be that hard for him to read that section of the wiki and understand events. I did...and I average below a 3.0 for the time being.

Pooper, I will retract my comment about him/her because I know nothing about him/her.

killerogue 05-16-2007 02:12 AM

Quote:

Originally Posted by PrinceOfKenshin (Post 1308237)
I guess the problem is...as it the same with me that we don't need the basic info on it but just how to apply certain things.

Forexample:
NPC Code:
abs(float)
arctan(float) - arcus tangens
char(ascii) - gets the character for an ascii code (char(65) returns 'A')
cos(angle) - cosinus of a radiant angle
exp(float)
float(string) - for explicitely converting a string
to number (normally done automatically though
when accessing a string with numeric operators)
format(format,parameters,...) - formats a "%s %d" string,
inserts the parameters, and returns a string
getangle(delta x,delta y)
getdir(delta x,delta y) - returns 0 for up, 1 for left,
2 for down, 3 for right
int(a) - gets the integer part of a floating point number
log(base,a)
max(a,b)
min(a,b)
printf(format,parameters,...) - same as
echo(format(format,parameters,...))
random(rangestart,rangeend)
sin(angle) - sinus of a radiant angle
sleep(time) - suspends the current script for some time
vecx(direction 0..3)
vecy(direction 0..3)
waitfor(objectname,event[,timeout]) - suspends the current script




all that yea sure it tells me what it is but how do i apply that to make it work in a script. Some things in there i understand like the obvious ones. The only other language i know is Visual Basics so im not use to programming an object oriented langauge.

Like what am i going to use arctan(float) for? stuff like that is confussing to people.

You shouldn't really be focusing on trying to memorize or even understand all the functions of GS2.

It's not all about memorizing everything.

Switch 05-16-2007 02:17 AM

Quote:

Originally Posted by killerogue (Post 1308244)
Well, in all honesty. I completely agree with you. And I do because a while back, I had to take a test in a program right before the school year started to determine what is the easiest way for me to learn.

I am a dependent learner, in which I mean that it's hard for me to learn something unless someone explains it or I have been taught it by someone else.

Now, unless I'm not mistaken...Isn't Switch an honors student, or so he's bragged before?

And in his signature did it not say, "Became an ok scripter blah blah"?

I'm almost sure he isn't mentally deficient, or lacking mentally in any areas. So I don't think it would be that hard for him to read that section of the wiki and understand events..

I AM an honors student, but just like you, I'm a dependent learner. I NEVER learn ANYTHING from reading if I don't discuss with anyone.

The signature I took out. Plus, it was only that I could fix some small things x.x

In the wiki, it doesn't explain everything or answer my questions, which is basically the main reason I have troubles with tutorials x.x

DustyPorViva 05-16-2007 02:19 AM

Ya, I find myself looking up commands and stuff a lot when I script :(
You should just focus on remembering the clockworks of scripting, as then you'll turn a 1000 piece puzzle into those puzzles for toddlers that the pieces fit into predefined shapes for the kid, and all you have to do is fill in the blanks, even if you have to look for what to fill them in with first.

killerogue 05-16-2007 02:24 AM

Quote:

Originally Posted by Switch (Post 1308247)
Crap

The main issue I had with that was...you claimed to be a scripter. But if you can't actually script anything, you ARE NOT a scripter.

Other stuff...

Oh? Post your questions here and I'll answer them best I can. :)

Switch 05-16-2007 02:43 AM

Quote:

Originally Posted by DustyPorViva (Post 1308248)
Ya, I find myself looking up commands and stuff a lot when I script :(
You should just focus on remembering the clockworks of scripting, as then you'll turn a 1000 piece puzzle into those puzzles for toddlers that the pieces fit into predefined shapes for the kid, and all you have to do is fill in the blanks, even if you have to look for what to fill them in with first.

Except I can't even remember those 'cause I don't get all of it :asleep:

pooper200000 05-16-2007 02:56 AM

Quote:

Originally Posted by Skyld (Post 1308233)
I started writing http://wiki.graal.net/index.php/Crea...pt_for_Dummies ages ago, however I did not ever finish it.

thanks! I get that somewhat well actually.
Quote:

Originally Posted by killerogue (Post 1308244)
Well, in all honesty. I completely agree with you. And I do because a while back, I had to take a test in a program right before the school year started to determine what is the easiest way for me to learn.I am a dependent learner, in which I mean that it's hard for me to learn something unless someone explains it or I have been taught it by someone else.
Pooper, I will retract my comment about him because I know nothing about him.

Lol. I average a 4.25 at gpa. Im an honors student. I just don't understand this. I guess I am "Mentally deficient". Honors is what it is cracked up to be. I am extremely challenged in math though. I may be in honors but I have a tutor in that. So I guess I am slow life. I would still like to try to understand it. Who was it that guessed I was in 8th grade. They are right. Im in algebra 2 though.... not trying to act superior because im not I don't get this.
Quote:

Originally Posted by killerogue (Post 1308256)
Other stuff...

Oh? Post your questions here and I'll answer them best I can. :)

Thanks! I will. I just am challenged youll probaly start laughing so hard you might need to be knocked out youll laugh so hard at how stupid I sound. I know Im not a scripter but Ill work at it.

killerogue 05-16-2007 02:56 AM

Quote:

Originally Posted by Switch (Post 1308261)
Except I can't even remember those 'cause I don't get all of it :asleep:

YOU DON'T NEED TO GET ALL OF SCRIPTING. I guarantee you noone here knows everything about Gscript2. It isn't about how much you can memorize and use straight from memory without doing research. It's about how you do research, what you find, and how you use what you find.

killerogue 05-16-2007 02:57 AM

Quote:

Originally Posted by pooper200000 (Post 1308266)
thanks! I get that somewhat well actually.

Lol. I average a 4.25 at gpa. Im an honors student. I just don't understand this. I guess I am "Mentally deficient". Honors is what it is cracked up to be. I am extremely challenged in math though. I may be in honors but I have a tutor in that. So I guess I am slow life. I would still like to try to understand it. Who was it that guessed I was in 8th grade. They are right. Im in algebra 2 though.... not trying to act superior because im not I don't get this.

Thanks! I will. I just am challenged youll probaly start laughing so hard you might need to be knocked out youll laugh so hard at how stupid I sound. I know Im not a scripter but Ill work at it.

Just AIM me.

Gambet 05-16-2007 02:58 AM

Quote:

Originally Posted by killerogue (Post 1308267)
I guarantee you noone here knows everything about Gscript2.



Stefan does!






:)

Deadly_Killer 05-16-2007 03:00 AM

Quote:

Originally Posted by Gambet (Post 1308269)
Stefan does!

Debatable ;)

DustyPorViva 05-16-2007 03:00 AM

I see him post 'I think' sometimes when answering scripting questions :P

Gambet 05-16-2007 03:02 AM

Quote:

Originally Posted by DustyPorViva (Post 1308272)
I see him post 'I think' sometimes when answering scripting questions :P



But he's always right. :frown:

killerogue 05-16-2007 03:04 AM

Quote:

Originally Posted by Deadly_Killer (Post 1308271)
Debatable ;)

I was going to say something along these lines! But thought better against it! :)

DustyPorViva 05-16-2007 03:05 AM

Maybe, but he's not always sure if he is. :)

Rapidwolve 05-16-2007 03:11 AM

Quote:

Originally Posted by DustyPorViva (Post 1308240)
Sadly I find the wiki lacking one thing(I've yet to see skyld's though), and that is actually what goes in commands. All it tells you is if it's a floating, integer, or string. That doesn't really help much...

Anyways, for Switch:
PHP Code:

function onCreated() 
{
  
player.chat "Stuff.";


function onCreated() // This is a function. Before GS2, things like this were called in events. Basically, if it happened, execute any code in the parenthesis. In GS1, it would be if (created) {}, but all that changed in GS2. Events were translated into their own functions. So basically this means, when the NPC is created, execute everything in the parenthesis.

{...} // As explained above, parenthesis are closed around any amount of commands executed when an event is called. All commands must be executed with an event/function and closed inside parenthesis.

player.chat = "Stuff."; // player.* is associated with anything for the player. This can be player.hearts, for their hearts, player.ap, for their ap, player.x, for their x coordinate, and so on. So, taking that, and taking the knowledge that = is assign, means that you are assigning something to the player's chat, which means you'll force them to say something. "Stuff." is a string. A string is alphanumerical. That means anything not a variable, floating value, integer, has to be enclosed in quotes, or else it won't be assigned. If you want to get basic, text has to be in quotes. And lastly, the semi-colon has to be after every command. Anytime you do 'something' end it with a semi-colon before you move onto the next thing.

The world would be a better place if there were more people like you.

Andy0687 05-16-2007 03:25 AM

Quote:

Originally Posted by killerogue (Post 1308256)
The main issue I had with that was...you claimed to be a scripter. But if you can't actually script anything, you ARE NOT a scripter.

Kind of like you when you started, eh?

Maybe you shouldnt be so quick to talk down to people when you "came up" the same way they are trying.

Quote:

Originally Posted by gambetsposts
.

you ever get tired of doing that?

Rapidwolve 05-16-2007 03:33 AM

Quote:

Originally Posted by Andy0687 (Post 1308285)
Kind of like you when you started, eh?

Maybe you shouldnt be so quick to talk down to people when you "came up" the same way they are trying.


Well put

PrinceOfKenshin 05-16-2007 03:51 AM

ok well lets say im going to script simple gun what would i use?

DustyPorViva 05-16-2007 03:54 AM

shoot(), would be the simplest of ways, and can be done with one command and a couple of ganis. Sorry I can't provide the details, I don't remember. I'll look it up after House is done. :)

EDIT:

PHP Code:

//#CLIENTSIDE
function onWeaponfired() {
  
shoot(x,y,z,angle,zangle,power,"gani",param1,param2,...[these params are sent to the GANInot passed in the shoot command]);


//#CLIENTSIDE // Everything following this is dealt on the clientside of things. shoot() is clientside.
function onWeaponfired() {..} // Everything inside this function is called when the weapon is fired.
shoot(stuff)... // Shoots a projectile that is visible as whatever gani is defined. As for the specs, straight from newfeatures, as no need to repeat them in different words:
x,y and z - specify the starting position
angle - shoot angle (when looking from the top): east is 0, north 3.14/2, west is 3.14, south 3.14*3/2)
zangle - the angle in vertical direction, 0 means the projectile is shoot horizontal, 3.14/2 means straight to the sun
power - the shoot power which is used to shoot the projectile; if it's 0 then the projectile is shoot like an old arrow (doesn't fall down, moves 20 tiles each second)
gani - the animation that is used for the projectile; the animation can be multidirectional, the engine automatically selects the best direction for the flying direction; the animation can have 1 step (not animated) or 7 steps, then the engine is automatically choosing the good animation step for the projectile flying angle - when its raising then step 1 is taken, when flying horizontal it is step 4, when it is short before the impact then the engine displays step 7

If anything confuses you, I'll try to answer. There's a lot more to it than this, but I figured you should start off with just getting a bullet going.

PrinceOfKenshin 05-16-2007 04:00 AM

not that simple lol you would use keydown gani scripts. Is that it?

killerogue 05-16-2007 04:16 AM

Quote:

Originally Posted by Andy0687 (Post 1308285)
Kind of like you when you started, eh?

Maybe you shouldnt be so quick to talk down to people when you "came up" the same way they are trying.



you ever get tired of doing that?

I never claimed I was good scripter. >_> Nor a scripter when I couldn't script anything. IF anything I was eager to learn, lazy to do anything.


All times are GMT +2. The time now is 02:14 AM.

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