Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / how to use variables? is it available in v109 update?

Author
Message
Bibo4PC
16
Years of Service
User Offline
Joined: 17th Oct 2008
Location: Middle Earth
Posted: 2nd Dec 2008 20:35
hi all
what's the basic script to define and add/subtract to a variable? i saw many scripts i got all mixed up?
also is it available in v109 update? or is it only in ply's mod?
TY
meteorite
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: The Capital Wasteland
Posted: 2nd Dec 2008 21:22 Edited at: 2nd Dec 2008 21:23
Ply's mod definatley has variables, and I know Stock FPSC does by now, but I dont know which update they are in

Which would you rather use, Ply's or Stock?


Plystire
21
Years of Service
User Offline
Joined: 18th Feb 2003
Location: Staring into the digital ether
Posted: 2nd Dec 2008 22:30 Edited at: 2nd Dec 2008 22:30
V1.09 introduced the stock variable system.


Here's how it works.

Stock FPSC Variables -
-No declaration needed
-Must specify which variable to alter before making changes or checks against that variable
-Uses Global and Local variables
-Variables are defined as numbers
-Limit of 99 Global/Local Vars (Confirmation on this?)
-Can only hold integers (Whole Numbers)
-Variables cannot be used with other commands

Ply's Mod Variables -
-Declaration required
-Do not need to use seperate actions to specify variables for checking/changing
-Only Global variables, no Local variables
-Variables can be given names
-No limit to number of variables
-Can hold float values (Decimal Numbers)
-Variables may be given as numeric parameters to any other command


How to use them.

Stock FPSC variables:

Specify which variable to be used
Quote: ":ALWAYS:globalvar=1,localvar=1"

(This is an example, you will not be specifying global and local vars at the same time, only one can be changed at a time)

Add to the variable
Quote: ":state=1:incvar=3"

Will add 3 to the specified variable

Sub from the variable
Quote: ":state=1:decvar=5"

Will subtract 5 from the specified variable



Ply's Mod variables:

Declare the variable
Quote: ":state=0:dimvar=MyVariable"

Will declare a variable named "MyVariable". You can now use this variable in any script.
(NOTE: You will only need to do this once in order to use that variable)

Add to the variable
Quote: ":state=1:addvar=MyVariable 4"

Will add 4 to the variable named "MyVariable"

Sub from the variable
Quote: ":state=2:subvar=MyVariable 22"

Will subtract 22 from the variable named "MyVariable"




There's a lot more to it, but that's what you wanted to know. The stock system is rather limiting for calculations and the variables can only be increased, decreased, set, and checked.... and that's it. Ply's Mod variables can be set, increased, decreased, multiplied, divided, modulated (sp), checked, and used as parameters for other commands. The only downside I see to the Ply's Mod system is that it doesn't have any local variables...


The one and only,


Those who live in the past, are destined to insanity. Those who live only for the future, will be slaves to their ambitions.
Those who live in the moment... only they, are truly happy.

Login to post a reply

Server time is: 2024-11-24 16:30:40
Your offset time is: 2024-11-24 16:30:40