OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: SilentHunter on 23 Jan 2004, 20:17:17
-
Does anyone know where i can find a list of reserved variables for both scripts and dialogs,
We all aready know of...
_time
player
and some others i cant thnk of right now...
But if theres any more you know of post them here, thx
SILENTHUNTER
-
_time should not be a reserved variable because it's local. time on the other hand is. Or am I wrong ???
-
Sorry Artak.........it is a reserved variable......quote from Comref:
variable _time is reserved. It is used to keep time elapsed since script execution started.
Also variables names starting with two underscores are reserved variables and should not be used.
Planck.
-
i started a thread some time back for this very topic, havent seen it crop up for ages
but here's a reserved variable for ya
"Missionend"
-
true
false
nil
objNull
west
resistance
east
civilian
_this
this
time
_time
_x
that's all ;)
-
Uups. Didn't know the _time thing. Good stuff.
I'll tell you a weird story though. The command 'count' can be defined just like a variable. Once in a large mission with lots and lots of scripts I had accidently defined 'count' as an increasing counter, when I actually ment to use it as a local variable '_count'. All of a sudden none of the scripts using the count command didn't work anymore because count wasn't the command anymore but a counter variable. You can guess how long it took me to find out what the heck was happening :P
-
No m8 there is much much more
What i have found when scripting something and using a global variable name that i havent used before
Sometimes the Global variable doesnt do as i want it too
Nothing untoward with that you may say, just a scripting error!
when running tests and debugging, trying to see what value the script is seeing for the variable name, some weird results have occured
Changing the variable name, solves the problem
From this i can assume that OFP Hardcoding has perhaps already used the variable name i wanted to for something else and therefore i am unable to attach a value to the variable name
an example
I wanted the server to issue a Publicvariable boolean called "MissionEnd"
When the clients received PV "MIssionEnd" they were supposed to shut down scripts and run an end of game script
However they could not, and no matter what i tried to do, the PV was never seen by the clients
I changed the PV to "Missionstop"
and hey presto it all worked fine
Therefore the only assumption that can be gained from this experience is
There are certain variable names that will not work in normal missionmaker scripting, the only reason for this is that somewhere in OFP hardcoding, they are already being used for something else
Maybe "MissionEnd" takes the OFP engine into the final table score page or back to Mission selection, who knows, but it must be used for somethng
-
When you place a unit in the editor and give it a name, that name is reserved. For example, you can't spawn another unit with a script that has the same name.
Units spawned by a script or trigger or whatever won't reserve their name, only placed units.
-
true
false
nil
objNull
west
resistance
east
civilian
_this
this
time
_time
_x
Well, then you could add a few like:
crew
gunner
commander
driver
side
enemy
friendly
fuel
ammo
flag
group
leader
move
name
player
position
units
damage
distance
call
fire
land
...
Though those are more of commands/functions than variables, but anyhoo...
-
This is going off at a tangent
The reserved variables I think we are talking about here, is the ones that arent publicly known, not what is listed in the comref
-
This is going off at a tangent
Sry... :beat: