![]() |
New Script features!
Ok, If any of you know JavaScript ud understand this..
You know how functions() are called like that. Well if you didnt already know this. fuctions can contain objects!!!! Yes its true people.. But this is disabled in Graal I was hoping stefan could ad this... ' Simple Explanation NPC Code: and then NPC Code: ============================ MoreBiggernier Explanation Ok. Well Function Arguments or Objects are like when you put an argument into a command. For example.. message text; text is the 1 argument in that commandline Now Functions are made to take in objects and spit out results... Example.. NPC Code: And the function NPC Code: So it would return in the string result and have the value = Call Cool; I hope that explains function aguments or objects ^^; Adn calling then for you information... A function waits in the wings until it is called onto the stage. You call a function simply by specifying its name followed by a parenthetical list of arguments, if any: clearPage(); cut_out_token_one(Call me Cool); Functions which return a result should be called from within an expression: total=raiseP(2,8); if (raiseP(tax,2)<100) ... |
Good idea, I have seen functions and stuff before like in javascripts and whatnot and I'm not that great of a scripter, but I was wondering why graal didn't have something like that in their functions
|
In the debugger it already says something along these lines actually... Perhaps it's worth experimenting to see if there's already something like that?
|
*Staying alive*
|
Nah, args and returns have not yet been implemented.
|
That's too bad... It could be a perfect script shortener in some cases.
|
Variables:
param1 param2 param3 return Sure, they're not perfect but what is? |
Well yes you're right, although in the case of a function which has a chance of calling itself it should actually be a couple of arrays.
|
*reads the first post*
*thinks* *looooooooooong silence* *looks puzzle* *runs away* |
Nurk! I hate recursion anyway...
|
Well it sometimes (very rarely) necesarry.
|
True, I've had to use it once myself. I didn't want to, but life's a beach.
|
just do the following....
do something along to the lines of
function ProcessParam(); if (multicasevar="value for action to be called") { Script functions here } if (multicasevar="value for different action") { Script Functions here } not sure if that is proper graal script but that would be somethign similar (don't want to open up commands.rtf and read through all the things for it. then to call the function do the following setstring multicasevar,#s(variable) ProcessParam() it is similar in effect but you just have to have the varibles preset before you call them. In VB this is called Select Case (although VB handles variables passed to functions normally) few extra lines of code but for the extra script functions you can have in a shorter space. If you wanted to you could change the Script Functions here part to call another Function (shortens script so you can have a parser function and then actually script functions that do something. Defitions of variables: multicasevar, set this to what the case is you want to call a certain function or set of script commands. variable, this is the text tat is passed to the parser the things in quotes change that to something to match a varible the multicasevar may be set to. if someone would translate this to mroe of a graal script that would be most appreciated. |
| All times are GMT +2. The time now is 09:39 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.