Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Arguments

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Moonbuggie
Graphics Designer




Joined: 18 Apr 2003
Posts: 53
Location: CT

PostPosted: Mon Apr 21, 2003 1:06 am    Post subject: Arguments Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Moonbuggie
Graphics Designer




Joined: 18 Apr 2003
Posts: 53
Location: CT

PostPosted: Mon Apr 21, 2003 1:11 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Blazes Battles Inc.
I'm a chimp, not a




Joined: 25 Jan 2003
Posts: 505

PostPosted: Mon Apr 21, 2003 1:30 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Moonbuggie
Graphics Designer




Joined: 18 Apr 2003
Posts: 53
Location: CT

PostPosted: Mon Apr 21, 2003 1:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Blazes Battles Inc.
I'm a chimp, not a




Joined: 25 Jan 2003
Posts: 505

PostPosted: Mon Apr 21, 2003 4:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Moonbuggie
Graphics Designer




Joined: 18 Apr 2003
Posts: 53
Location: CT

PostPosted: Mon Apr 21, 2003 5:21 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Aethereal
SHUT UP.
Elite Designer
Elite Designer



Joined: 04 Jan 2003
Posts: 928
Location: Gone! I pop in on occasion though.

PostPosted: Mon Apr 21, 2003 5:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Mike Caron
Technomancer




Joined: 26 Jul 2003
Posts: 889
Location: Why do you keep asking?

PostPosted: Tue Jul 29, 2003 9:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Cube
Dimensional Traveller




Joined: 02 Feb 2003
Posts: 294

PostPosted: Tue Jul 29, 2003 10:06 pm    Post subject: Reply with quote

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? Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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