Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 05-16-2007, 02:07 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by killerogue View Post
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
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #17  
Old 05-16-2007, 02:07 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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.
Reply With Quote
  #18  
Old 05-16-2007, 02:08 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Switch View Post
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? -_-
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #19  
Old 05-16-2007, 02:10 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
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.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #20  
Old 05-16-2007, 02:12 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by PrinceOfKenshin View Post
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.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #21  
Old 05-16-2007, 02:17 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by killerogue View Post
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
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #22  
Old 05-16-2007, 02:19 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
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.
Reply With Quote
  #23  
Old 05-16-2007, 02:24 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by Switch View Post
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.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #24  
Old 05-16-2007, 02:43 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by DustyPorViva View Post
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
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #25  
Old 05-16-2007, 02:56 AM
pooper200000 pooper200000 is offline
The Blackswan
Join Date: May 2006
Location: Asylum
Posts: 5,060
pooper200000 will become famous soon enough
Send a message via AIM to pooper200000
Quote:
Originally Posted by Skyld View Post
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 View Post
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 View Post
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.
__________________
Always Watching!
Reply With Quote
  #26  
Old 05-16-2007, 02:56 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by Switch View Post
Except I can't even remember those 'cause I don't get all of it
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.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #27  
Old 05-16-2007, 02:57 AM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by pooper200000 View Post
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.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #28  
Old 05-16-2007, 02:58 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by killerogue View Post
I guarantee you noone here knows everything about Gscript2.


Stefan does!






Reply With Quote
  #29  
Old 05-16-2007, 03:00 AM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
Quote:
Originally Posted by Gambet View Post
Stefan does!
Debatable
__________________
- Zidane / Zidaya
Reply With Quote
  #30  
Old 05-16-2007, 03:00 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
I see him post 'I think' sometimes when answering scripting questions :P
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:24 AM.


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