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
  #41  
Old 05-16-2007, 04:22 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
Quote:
Originally Posted by PrinceOfKenshin View Post
not that simple lol you would use keydown gani scripts. Is that it?
What do you mean?
Reply With Quote
  #42  
Old 05-16-2007, 04:40 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
I think he means something along the lines of pressing a key and it playing a gani, i.e.:

PHP Code:
function onKeyPressedkeynrkeyname )
{
  if (
keyname == "s")
  {
    
setani("fireani""");
  }


E: My final suggestion, if you have a friend who's a good scripter...ask him to tutor you. It's easier to learn from someone rather than something ( I.E. the wiki ). The wiki's just there for informational purposes really, otherwises it's just..blegh.
__________________


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
  #43  
Old 05-16-2007, 04:42 AM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by killerogue View Post
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.
I was hoping you would pay more attention to the talking down to people part, or does this not seem familer?

http://forums.graalonline.com/forums...ad.php?t=67451

All im saying is, when you yourself were having trouble, you looked for help and expected it/would hide behind the whole "im new" thing. When people would flame you for how bad you were, did you not get upset? So why would you in turn do that exact same thing to a new scripter? Give them a chance to learn, its not fluid for some people, and eventually they may realise its not for them.

Encourage not Discourage
__________________
Reply With Quote
  #44  
Old 05-16-2007, 04:55 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
Quote:
Originally Posted by killerogue View Post
I think he means something along the lines of pressing a key and it playing a gani, i.e.:
I don't think that was the context of his post. I assume it had something to do with what I posted, but I have no idea.
Reply With Quote
  #45  
Old 05-16-2007, 05:37 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Andy0687 View Post
I was hoping you would pay more attention to the talking down to people part, or does this not seem familer?

http://forums.graalonline.com/forums...ad.php?t=67451

All im saying is, when you yourself were having trouble, you looked for help and expected it/would hide behind the whole "im new" thing. When people would flame you for how bad you were, did you not get upset? So why would you in turn do that exact same thing to a new scripter? Give them a chance to learn, its not fluid for some people, and eventually they may realise its not for them.

Encourage not Discourage
I've also noticed this attitude of his, I never said anything though. I kept it to myself.
Reply With Quote
  #46  
Old 05-16-2007, 05:49 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 Andy0687 View Post
Stuff
I didn't get mad or upset about that. :O Also, that would have been the first time I attempted to learn. Not the second, in which I was successful.

You'll also notice James, that I had good reasoning behind the things I said. If I have an attitude it's because of personal reasons, and that isn't anything to discuss here and you're both ( and rapidwolve ) right that I shouldn't be taking it out on people.

And, what I'm saying now is stemming from other encounters with Switch involving him acting like a brass-assed monkey.
__________________


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
  #47  
Old 05-16-2007, 06:36 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 killerogue View Post
Not the second, in which I was successful.
According to whom?
__________________
- Zidane / Zidaya
Reply With Quote
  #48  
Old 05-16-2007, 06:38 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 Deadly_Killer View Post
According to whom?
Good one!

But in terms of success, I mean being able to understand and use gscript, somewhat effectively I guess.
__________________


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
  #49  
Old 05-16-2007, 07:17 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 killerogue View Post
Good one!

But in terms of success, I mean being able to understand and use gscript, somewhat effectively I guess.
__________________
- Zidane / Zidaya
Reply With Quote
  #50  
Old 05-16-2007, 07:51 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I try to teach lots of people GS2 who choose to come to me and it usually works rather well. I PERSONNALY believe the best way to start teaching it is to explain the following:
- How a script is read (compiled together and all the functions are stored to be run when "called")
- The 2 different things you can do in a gs2 script (call functions and set variables)
- How functions work (Also: calling built-in functions [such as onCreated()] and redefining built-in functions [such as function show() {}])
- The 4 variable types: (Float, String, Object, Array)

I believe the last of those things to be the MOST important to actually grasp the concepts of gs2 coding. I am a GUI man though, so my ideas may just be biased as I use objects a lot.

If anyone wants to try to make a guide like such, feel free!
I should get around to actually making one sometime (when I'm not so swamped D: ).
__________________
Do it with a DON!
Reply With Quote
  #51  
Old 05-16-2007, 08:19 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
Thought I'd do my best to explain objects simply, and a few things of what you can do with them.

This Lesson One, focuses mainly on using text files with objects.

PHP Code:
// Lesson 1: Objects and How They Work

// Today we're going to make objects and use a few object functions!
// Objects must be created by making TStaticVars like below:

// temp.objName = new TStaticVar();

// Keep in mine, the capitalization in my var name is just a stylistic
// choice and has no effect on the outcome of the script. Tho, it's
// a good idea to make sure you've got all the capitalization correct 
// when using TStaticVars() and things like it!

// Let's Begin!

function onCreated()
{
  
temp.newObj = new TStaticVar(); // Here we create the object.
  
  // Below we will define some variables of the new object
  // It being a created object, we can create as many vars
  // as we want for the damn thing. :)
  
  
temp.newObj.personOne   "Stan";
  
temp.newObj.personTwo   "Zero";
  
temp.newObj.personThree "Twinny";
  
temp.newObj.personFour  "James";
  
  
// With the newly created variables above, there are a number 
  // of things you can do with the information stored in each variable
  // in the object.
  
  // Let's look at a few!
  
  // * - Files - * \\
  // Here we will save the vars into a text file:
  
  // temp.newObj.saveVars("textfilepath/textfilename.txt", 0);
  
  // Keep in mind saveLines is another form of saving variables
  // from objects into text files. However it saves each var line
  // for line. I'm not too big on explanations right now as I don't
  // use saveLines often.
  
  // The first param for saveVars() is pretty obvious. :p
  // The second param however, decides whether the file is overwritten,
  // or merely if the file is just added onto!
  
  
  // Having saved these informations into a text file, we can then later
  // receive this information through a command we shall learn in the next
  // lesson, dubbed: loadVars();
  
  /* Special Practice Notes:
        1. Things like saveVars(), or loadVars() are object only functions.
           Meaning they can only be attached onto the tail of an object that
           has, or in the case of loadVars sometimes, doesn't have information in it.
  */
}

// Lesson 1: Objects and How They Work, cont.

  // Now that you understand the basics of objects and how you can understand the 
  // uses and storing of informations inside of them. Let's look a bit deeper
  // our target for this lesson is loadVars.
  
  // Now, when you first create an object, it usually has nothing in it.
  // Of course that applies to IF you create the object first, but in my opinion,
  // it's always best to clearly state out the new static variable assignment.
  
  //Like before loadVars is am object only function, let's take a look at it's use.
  
  
function onStuff()
  {
    
// Again we create the object.
  
    
temp.newObj = new TStaticVar();
    
    
// Now we load the vars from a text file, consider your test text file is named
    // test.txt. And it contains the 5 names from before. We simply do this:
    
    
temp.newObj.loadVars("test.txt");
    
    
// But what if you wanted to get the information from an object through a script?
    // We certainly can't just yank it out now can we? Of course not!
    
    // There's only one sure shot thing that can get us the variables we want, 
    // and it's an object function! Aptly named, getDynamicVarNames().
    
    // Dynamic variables are variables that never stay the same and could change
    // at any time they or the person controlling them wishes for them to.
    
    // Now the way to access the dynamic variables is a bit more difficult than the talk
    // that's been going on around here. We're going to use a "for each" look,
    // to go through the dynamic var names of an object.
    
    // The for each loop allows us to apply a variable name to each piece of information
    // in an array. So let's do something like this:
    
    
for (temp.oVtemp.newObj.getDynamicVarNames()) // In case you were wondering, getDynamicVarNames returns an array allowing for a for each loop to have it's way with the text file/
    
{
      
temp.someArray.add(temp.oV);
    }
    
// We can now echo all the information from the dynamic variables in the object because
    // the for each loop going through the values, added each value to "temp.someArray" one value
    // at a time.
    
    // Now that array contains all the information from the object. A simple way to echo all this info.
    // to RC. Like so:
    
    // echo(temp.someArray);
  

__________________


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.

Last edited by killerogue; 05-16-2007 at 08:32 AM..
Reply With Quote
  #52  
Old 05-16-2007, 08:45 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
The problem with that as being a starting tutorial Stan is, You don't exactly explain what a function or object IS.
__________________
Do it with a DON!
Reply With Quote
  #53  
Old 05-16-2007, 09:19 AM
Pimmeh Pimmeh is offline
Rgesitreed Uesr
Pimmeh's Avatar
Join Date: May 2007
Location: Utrecht, the Netherlands
Posts: 1,586
Pimmeh has a spectacular aura about
Send a message via AIM to Pimmeh Send a message via MSN to Pimmeh
I think the most important thing for me, and I think others as well, is to have a list of thingies that I can pull out of my sleeve while scripting... I learned the very basics (compared to dontblock;drawoverplayer shizzle from GS1) from Chandler (cool guy btw ) but I really should find someone to learn the more complex things like setting a UI or a staffblock that you can spawn with a mouseclick if you have a certain weapon ready.
But the most important thing is how the heck I can be able to UNDERSTAND what is happening in really important scripts. This helped me a lot with GS1.
__________________
Oh, Death,
No wealth, no ruin, no silver, no gold
Nothing satisfies me but your soul
Reply With Quote
  #54  
Old 05-16-2007, 12:56 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
gscript 2 is just more confusing for nublets (hell it confuses me). experiment offline with gscript 1 to learn the basics then move on to gscript 2.

im sure im one of the few here who has this opinion though
__________________
Reply With Quote
  #55  
Old 05-16-2007, 01:56 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Rapidwolve View Post
Yeah I know, I am a regular user of your wiki. Was getting ready to contribute more functions but it was down.
It seems to be back up now!

http://skyld.vip.graal.net/
__________________
Skyld
Reply With Quote
  #56  
Old 05-16-2007, 02:14 PM
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 Skyld View Post
It seems to be back up now!

http://skyld.vip.graal.net/
Yay!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #57  
Old 05-16-2007, 02:20 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
I personally just think it depends the type of person. GS2 was a ton easier to understand for me then GS1 was.

GS2 is easier for people that are in the mindset of object oriented coding. Otherwise, it seems a ton harder then GS1.
__________________
Do it with a DON!
Reply With Quote
  #58  
Old 05-16-2007, 09:06 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Gerami View Post
gscript 2 is just more confusing for nublets (hell it confuses me). experiment offline with gscript 1 to learn the basics then move on to gscript 2.

im sure im one of the few here who has this opinion though
I also anyone who wants to learn how to GScript should start with GS1, this way they can get all the practice they want and its offline so they can't do any harm to a server. Converting from GS1 to GS2 is really easy, so once you got GS1 down you pretty much have GS2 down, atleast thats how it was for me.

Quote:
Originally Posted by Skyld View Post
It seems to be back up now!

http://skyld.vip.graal.net/
Yay
Reply With Quote
  #59  
Old 05-16-2007, 09:25 PM
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
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.
Except what's CREATED mean, then?

Quote:
Originally Posted by Rapidwolve View Post
The world would be a better place if there were more people like you.
Definitely
__________________
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
  #60  
Old 05-16-2007, 09:28 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
CREATED is when the weapon is first initialized or updated.
Reply With Quote
  #61  
Old 05-16-2007, 09:46 PM
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
Well if you're joking, then, it means when God said let there be an NPC.
If you're not, then it means exactly what Rapidwolve said. The first time the NPC is 'loaded'(first time a/the[not sure] player enters the level), and is not to be confused with onPlayerenters, which executes each time a/the player enters the level, or like mentioned, the NPC/level is updated.
Reply With Quote
  #62  
Old 05-16-2007, 09:55 PM
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
it means when God said let there be an NPC.
Thanks for being an ass ;( Like we said we have NO backround of ANYTHING 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
  #63  
Old 05-16-2007, 10:27 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Quote:
Originally Posted by Rapidwolve View Post
I also anyone who wants to learn how to GScript should start with GS1, this way they can get all the practice they want and its offline so they can't do any harm to a server. Converting from GS1 to GS2 is really easy, so once you got GS1 down you pretty much have GS2 down, atleast thats how it was for me.



Yay
GS1 is harder to learn though because the function names are horrible and it doesn't support strings decently. I still have to look up the function names every time I read a GS1 script.

GS2 is far easier to learn and it's what they'll need to know anyway. Why bother learning something that's already outdated? Not only that, all the stuff on the both the graal bible and Skyld's wiki have GS2 examples and few (if any?) GS1 examples.

Quote:
CREATED is when the weapon is first initialized or updated.
Nope. onInitialized is when the weapon/npc is first created by the NPC server. The onCreated function is called whenever the NPC is created or updated.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #64  
Old 05-16-2007, 10:31 PM
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
Thanks for being an ass ;( Like we said we have NO backround of ANYTHING x.x
Thank you for being an ass. Because the guy was just joking, then he provided you with a serious explanation.

And you begin to wonder why it is, that I dislike you.

@ Zero, well to be honest...lol..I did't give an explanation because I don't know the word for word definition of an object and I'm not too good at explaining singular things.
__________________


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
  #65  
Old 05-16-2007, 10:38 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
onCreated = when the npc is created/added, or you update the script (this behaviour has been changed from GS1, to avoid needing to reset the npc all the time)
onInitialized = called on server restart
Reply With Quote
  #66  
Old 05-17-2007, 12:32 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Stefan View Post
onCreated = when the npc is created/added, or you update the script (this behaviour has been changed from GS1, to avoid needing to reset the npc all the time)
onInitialized = called on server restart
PHP Code:
function onInitialized()
{
  
this.whoops++;
  
printf("This is the %i time NPC-Server has died",this.whoops);

Reply With Quote
  #67  
Old 05-17-2007, 01:25 AM
Sum41Freeeeek Sum41Freeeeek is offline
Future Coder
Join Date: Feb 2004
Location: New York
Posts: 376
Sum41Freeeeek is on a distinguished road
Send a message via AIM to Sum41Freeeeek
I remember the old old gscript bible. It explained everything for newbie scripters.
__________________
Frankie Cassini: ex-Era LAT
Quote:
Originally Posted by brakk View Post
omg just go to your room and draw a pony then

**** the chicken wings!
Reply With Quote
  #68  
Old 05-17-2007, 09:29 PM
PrinceOfKenshin PrinceOfKenshin is offline
That guy with a beard
PrinceOfKenshin's Avatar
Join Date: May 2004
Location: Ontario, Canada
Posts: 819
PrinceOfKenshin has a spectacular aura aboutPrinceOfKenshin has a spectacular aura about
I was reading the gscript thing skyld made (very helpful not to mention) but i dont get what you use parameters are for. Someone want to explain?
__________________


Quote:
Game Master (Server): Greetings PrinceOfKenshin, there are new posts on the forums that demand your urgent attention! God speed, the fate of the world is in your hands. If you fail, middle earth will forever be in the darkness and your children will be enslaved by McKain.
Reply With Quote
  #69  
Old 05-17-2007, 09:42 PM
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
Parameters are information based inside the current event. So if I did something like this.

PHP Code:
function onCreated()
{
  
temp.chatText "stuff";
  
this.doFunction(temp.chatText);
}

function 
doFunction()
{
  echo(
params[0]);

Take a guess what that would echo?
__________________


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
  #70  
Old 05-17-2007, 09:44 PM
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
It's really just passing information from one thing to another. Like passing a note in class. Like with a triggeraction, the destination script has no way of knowing what, say, your level is, unless you send it through the triggeraction. Say you have a gani for hammer, and you have different levels of hammers, level 1, level 2, gold hammer, and different images for each hammer. You can make ONE gani show different images for each level of the hammer, instead of a gani for each level. But, it must be told what level the hammer is, so you pass it through a parameter.
Reply With Quote
  #71  
Old 05-17-2007, 09:49 PM
PrinceOfKenshin PrinceOfKenshin is offline
That guy with a beard
PrinceOfKenshin's Avatar
Join Date: May 2004
Location: Ontario, Canada
Posts: 819
PrinceOfKenshin has a spectacular aura aboutPrinceOfKenshin has a spectacular aura about
Quote:
Originally Posted by killerogue View Post
Parameters are information based inside the current event. So if I did something like this.

PHP Code:
function onCreated()
{
  
temp.chatText "stuff";
  
this.doFunction(temp.chatText);
}

function 
doFunction()
{
  echo(
params[0]);

Take a guess what that would echo?
the temp.chatText = "stuff"; ?
__________________


Quote:
Game Master (Server): Greetings PrinceOfKenshin, there are new posts on the forums that demand your urgent attention! God speed, the fate of the world is in your hands. If you fail, middle earth will forever be in the darkness and your children will be enslaved by McKain.
Reply With Quote
  #72  
Old 05-17-2007, 09:52 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by zokemon View Post
- The 4 variable types: (Float, String, Object, Array)
GScript variables are always 'Double' though. Sorry, just had to point that out
Reply With Quote
  #73  
Old 05-17-2007, 09:56 PM
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
Well, he's passing a variable, and it's information as a parameter. That means when he goes to echo, he's echoing parameter 0(the first parameter), which is the variable temp.chatText. But, it is echoing the variables information, so it will echo just stuff.
Reply With Quote
  #74  
Old 05-17-2007, 10:33 PM
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
Q: Parameters are (?)
__________________
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
  #75  
Old 05-17-2007, 10:34 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Switch View Post
Q: Parameters are (?)
Do you even read posts before you post a post by yourself?

PS: Post #70 or #73
__________________
Reply With Quote
  #76  
Old 05-17-2007, 11:15 PM
PrinceOfKenshin PrinceOfKenshin is offline
That guy with a beard
PrinceOfKenshin's Avatar
Join Date: May 2004
Location: Ontario, Canada
Posts: 819
PrinceOfKenshin has a spectacular aura aboutPrinceOfKenshin has a spectacular aura about
Quote:
Originally Posted by DustyPorViva View Post
Well, he's passing a variable, and it's information as a parameter. That means when he goes to echo, he's echoing parameter 0(the first parameter), which is the variable temp.chatText. But, it is echoing the variables information, so it will echo just stuff.
gotcha thats what i mean = ) thanks i will post if i don't get anything else..
__________________


Quote:
Game Master (Server): Greetings PrinceOfKenshin, there are new posts on the forums that demand your urgent attention! God speed, the fate of the world is in your hands. If you fail, middle earth will forever be in the darkness and your children will be enslaved by McKain.
Reply With Quote
  #77  
Old 05-17-2007, 11:20 PM
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
the temp.chatText = "stuff"; ?
Do you even know what a string is? >_> I suggest you try that before you're trying to pass params in functions.

Quote:
Originally Posted by Switch View Post
Q: Parameters are (?)
I'm sorry, if you can't think to read for yourself then I can't help you as I just posted an explanation on the matter. And Dusty posted 2.
__________________


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
  #78  
Old 05-18-2007, 02:10 AM
PrinceOfKenshin PrinceOfKenshin is offline
That guy with a beard
PrinceOfKenshin's Avatar
Join Date: May 2004
Location: Ontario, Canada
Posts: 819
PrinceOfKenshin has a spectacular aura aboutPrinceOfKenshin has a spectacular aura about
Quote:
Originally Posted by killerogue View Post
Do you even know what a string is? >_> I suggest you try that before you're trying to pass params in functions.
yes i do x.x
__________________


Quote:
Game Master (Server): Greetings PrinceOfKenshin, there are new posts on the forums that demand your urgent attention! God speed, the fate of the world is in your hands. If you fail, middle earth will forever be in the darkness and your children will be enslaved by McKain.
Reply With Quote
  #79  
Old 05-18-2007, 02:16 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, your question wasn't very clear so I didn't understand you. Sorry if I insulted you.
__________________


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
  #80  
Old 05-18-2007, 05:27 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Crow View Post
GScript variables are always 'Double' though. Sorry, just had to point that out
In C++, yes. But if you use the wiki.graal.net at all you will notice every parameter marked with one of these 4 variable types. You don't ever see one marked with "double".
__________________
Do it with a DON!
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 01:51 PM.


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