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

script arguments

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Wapam
Hope this hurts.




Joined: 18 Jul 2007
Posts: 42
Location: lacaster , california

PostPosted: Sat Apr 19, 2008 8:34 am    Post subject: script arguments Reply with quote

What are script argument and how do they work?
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
JSH357




Joined: 02 Feb 2003
Posts: 1705

PostPosted: Sat Apr 19, 2008 9:19 am    Post subject: Reply with quote

Arguments are values that you pass into a script so that the script will have a different result for different values.

Let's consider fade screen out(). You should know what it does by now.
The fadscreenout() function can take three arguments: a red, blue and yellow value. By using this script, you can change the color that the screen flashes on the fade.

for instance:
fadescreenout(63,63,63) will make the screen flash white.

You use the same concept when adding arguments to your own scripts.

Let's say you're making a script add that returns the sum of two numbers.

You might call it in your main script like so:
Code:
variable(x,y,z)
x:= 5
y:=10
z:=add(x,y) // z should be 15 if the script works


Now, somewhere you'll have an autonumber function like this:
Code:
script, add, num1, num2, begin // num1 and num2 are arguments
return(num1 + num2)
// "returning" a value here means passing it back to the variable z in
// the main script.
end


You can use arguments for a variety of things. They aren't used so much when coding story scenes or typical OHR scripts, but for fancier features, it will serve you well to learn more about them. Check the wiki and HamsterSpeak specification for more details.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    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