|
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
Moonbuggie Graphics Designer
Joined: 18 Apr 2003 Posts: 53 Location: CT
|
Posted: Mon Apr 21, 2003 1:06 am Post subject: Arguments |
|
|
You know, out of my 3 years of plotscripting, I still don't know what arguments are and how to use them. Someone tried to explain it to me awhile back, but I still didn't understand. Because of that, I've never used an argument in my scripts and I've got along fine. What are the benefits of using arguments, and when are they most often used? Like I understand where they go (define script (#,name,arguments)), but I dont understand when and why they're used. Ya I know its sad, but as the old saying goes, "the only stupid question is the question not asked." |
|
Back to top |
|
|
Moonbuggie Graphics Designer
Joined: 18 Apr 2003 Posts: 53 Location: CT
|
Posted: Mon Apr 21, 2003 1:11 am Post subject: |
|
|
EDIT: Jame's explanation of arguments is gibberish to me...or at least the me back when I was a year younger... |
|
Back to top |
|
|
Blazes Battles Inc. I'm a chimp, not a
Joined: 25 Jan 2003 Posts: 505
|
Posted: Mon Apr 21, 2003 1:30 am Post subject: |
|
|
I've seen them used for two things. The normal one is making it so you don't have to copy scripts to make different npcs do the same thing. If the script has an argument called "thenpc", and you have different npcs run that script, and have their script arguments set to that, and finally have all the commands in the script refer to "thenpc" instead of a number, they will all do the same thing, but only the one you talked to. Just like in the tutorial. The other use is making your own plotscripting 'commands,' which are really just entire scripts that simplify many different commands into one command to make things easier. Cube's plotscripting Utility and Longetech's plotscripting Package are good examples of the second use. If you open either file up you should be able to understand how the scripts are used as commands. _________________ Preserve OHR history! Do it for the children! |
|
Back to top |
|
|
Moonbuggie Graphics Designer
Joined: 18 Apr 2003 Posts: 53 Location: CT
|
Posted: Mon Apr 21, 2003 1:36 am Post subject: |
|
|
Hmm...interesting. I always used definescript (autonumber, name, none) to make my own commands, er..."commands"...as far as the first one though, I suppose it could save space when writing a script.
By the way Cube, the scripts on your site are pretty helpful. Sorta like what Moogle used to do. That is, before I was informed he's in South America. |
|
Back to top |
|
|
Blazes Battles Inc. I'm a chimp, not a
Joined: 25 Jan 2003 Posts: 505
|
Posted: Mon Apr 21, 2003 4:43 am Post subject: |
|
|
The autonumber thing for commands works only if it is supposed to do the same thing everytime. For a flexible one, with arguments (ex. command (#,#,#)) you need to use arguments when you are making the script. _________________ Preserve OHR history! Do it for the children! |
|
Back to top |
|
|
Moonbuggie Graphics Designer
Joined: 18 Apr 2003 Posts: 53 Location: CT
|
Posted: Mon Apr 21, 2003 5:21 am Post subject: |
|
|
ooooh now i get it...you're the first one who could just say it simply like that so i could finally understand. Hmm now that i think about it that is usefull.. |
|
Back to top |
|
|
Aethereal SHUT UP. Elite Designer
Joined: 04 Jan 2003 Posts: 928 Location: Gone! I pop in on occasion though.
|
Posted: Mon Apr 21, 2003 5:33 am Post subject: |
|
|
I'll help out by posting an example script which is very easy to understand.
Quote: |
define script (autonumber, doherochange, 3, 0, 0, me)
script, doherochange, picture, palette, who, begin
set hero picture (find hero (hero:who), picture, outside battle)
set hero palette (find hero (hero:who), palette, outside battle)
end
|
Now I can call the script doherochange() like a plotscripting command. If I put the following in a script:
doherochange(5, 12, James)
It would change hero James to picture 5 and palette 12.
So arguments are like variables that are changed by the way the script is used, and not by the set variable() command. They can also be applied to NPCs directly in CUSTOM. Also, some special scripts automatically pass arguments to the script. Finally, you can use arguments in calling a script, and then return the value with the return() command. That way you can make your own commands to actually find things and return a value (much like the plotscripting command herox() returns the hero's X position). However, that's getting into more complicated stuff. _________________
|
|
Back to top |
|
|
Mike Caron Technomancer
Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Tue Jul 29, 2003 9:05 pm Post subject: |
|
|
Arguments are real easy:
Command(Argument1, Argument2, Argumentn)
Arguments are just extra info you pass on to the command to help it do something. I.e: You can't show a text box without first telling it which one to show.
Similarly, if you write a script (command, whatever), you can let it take arguments. I.e:
Code: |
define script (autonumber, NPC Dance,1,0)
|
This means that the NPC Dance script takes 1 argument, that defaults to 0. You can use these arguments in the script:
Code: |
script, NPC Dance,NPC,begin
wait(5)
set npc direction(NPC,west)
wait(5)
set npc direction(NPC,north)
wait(5)
set npc direction(NPC,east)
wait(5)
set npc direction(NPC,south)
end
|
_________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
Back to top |
|
|
Cube Dimensional Traveller
Joined: 02 Feb 2003 Posts: 294
|
Posted: Tue Jul 29, 2003 10:06 pm Post subject: |
|
|
You explaination was good, however, this topic is extremely old. The post before your post was on April 21st. You have to keep an eye out on those dates. It's very likely that the person who asked this question now understands arguements, given that this all took place months ago.
Just be more careful, mmm? |
|
Back to top |
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|