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
  #1  
Old 05-16-2007, 03:05 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
Maybe, but he's not always sure if he is.
Reply With Quote
  #2  
Old 05-16-2007, 03:51 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
ok well lets say im going to script simple gun what would i use?
__________________


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
  #3  
Old 05-16-2007, 03:54 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
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.

Last edited by DustyPorViva; 05-16-2007 at 04:05 AM..
Reply With Quote
  #4  
Old 05-16-2007, 04:00 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
not that simple lol you would use keydown gani scripts. Is that it?
__________________


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
  #5  
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
  #6  
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
  #7  
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
  #8  
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
  #9  
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
  #10  
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
  #11  
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
  #12  
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
  #13  
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
  #14  
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
  #15  
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
  #16  
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
  #17  
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
  #18  
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
  #19  
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
  #20  
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
  #21  
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
  #22  
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
  #23  
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
  #24  
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
  #25  
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
  #26  
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
  #27  
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
  #28  
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
  #29  
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
  #30  
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
  #31  
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
  #32  
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
  #33  
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
  #34  
Old 05-18-2007, 01:36 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 am still debating if i should master Gs1, because crono posted somewhere, i think on this thread. That learning Gs1 makes it easier to learn Gs2
__________________


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
  #35  
Old 05-18-2007, 02:12 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 PrinceOfKenshin View Post
I am still debating if i should master Gs1, because crono posted somewhere, i think on this thread. That learning Gs1 makes it easier to learn Gs2
Depends, but learning C++ or something object-based will make it easier for you learning gs2, since gs2 is object-based
__________________
Reply With Quote
  #36  
Old 05-18-2007, 02:17 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
I am still debating if i should master Gs1, because crono posted somewhere, i think on this thread. That learning Gs1 makes it easier to learn Gs2
No, please don't. I don't see how that would benefit you at all...really. Gs1 and GS2 are two, nearly, completely different coding languages.
__________________


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
  #37  
Old 05-18-2007, 02:14 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
I think, to be honest, GS1 may be 'simpler' to understand in concept, but in the end, you'll only be hurting yourself. One way or another, you're going to be learning the basics of scripting and format, so you should just start with GS2. For simple scripting, it's not all that different from GS1, so I wouldn't see the big advantage of starting over GS2.
GS1:
PHP Code:
if (playerenters) {
  
playerx=32;
  
playery=32;

GS2:
PHP Code:
function onPlayerenters() {
  
player.x=32;
  
player.y=32;

Reply With Quote
  #38  
Old 05-18-2007, 09:06 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
Gotcha..I'm just starting a new big project and i realized how much scripting i am gonna have to do (meaning more than normal)

On that note i was wondering if i can make music only play so that not everyone in that level hears it
__________________


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
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 07:54 PM.


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