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 03-09-2007, 01:59 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
Question

What's a param(eter)? I keep seeing these in scripts and such but I have no idea what exactly it is...
__________________
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
  #2  
Old 03-09-2007, 02:20 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
It's just a value or an object that you use when you want to transfer information across a system/system(s). They are passed through a function.


On Graal, params are read as an array of values, of which the first value in the sent function would be params[0], the second params[1], etc...
Reply With Quote
  #3  
Old 03-09-2007, 04:30 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
In all languages, when you call a funciton or procedure, you give them arguments
EG

this = that(var1,var2);

var1 and var2 are arguments

in a declaration, they are called paramaters

function that(passed1,passed2) {
whatever;
}

passed1 and passed2 are parameters.


When using triggeraction in gs2, you trigger something on the serverside, then the serverside function has

function onActionServerside(passed1,passed2) {
whatever;
}

however, in the case of a triggered function ONLY, you do not have to define the parameters, so if you did

function onActionServerside() {

and triggered it with parameters, since they were never given name, they will be referred to as param[0], param[1], etc
__________________
Reply With Quote
  #4  
Old 03-09-2007, 05:01 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Kristi View Post
When using triggeraction in gs2, you trigger something on the serverside, then the serverside function has

function onActionServerside(passed1,passed2) {
whatever;
}

however, in the case of a triggered function ONLY, you do not have to define the parameters, so if you did

function onActionServerside() {

and triggered it with parameters, since they were never given name, they will be referred to as param[0], param[1], etc

You don't need to define any parameters when calling the serverside action (in the actual function, I mean, not the trigger), which is what it is -- an action. When you trigger, you trigger to action functions that in turn read any information you sent over as parameters.

Last edited by Gambet; 03-09-2007 at 06:23 AM.. Reason: Clarity
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 10:04 PM.


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