Home   Help Search Login Register  

Author Topic: Reserved variables  (Read 2105 times)

0 Members and 1 Guest are viewing this topic.

Offline SilentHunter

  • Members
  • *
  • frozen leg'o'lamb (every gamers most loved weapon)
Reserved variables
« 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
[size=4.5]NERDS HAVE FEELINGS TOO! [/size] [size=2.5]*adjusts glasses*[/size]

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Reserved variables
« Reply #1 on: 23 Jan 2004, 21:31:54 »
_time should not be a reserved variable because it's local. time on the other hand is. Or am I wrong  ???
Not all is lost.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Reserved variables
« Reply #2 on: 23 Jan 2004, 21:37:58 »
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 know a little about a lot, and a lot about a little.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Reserved variables
« Reply #3 on: 23 Jan 2004, 21:50:50 »
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"

Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline MachoMan

  • Honoured
  • Former Staff
  • ****
  • KISS, Keep it Simple Stupid
Re:Reserved variables
« Reply #4 on: 24 Jan 2004, 00:19:40 »
true
false
nil
objNull
west
resistance
east
civilian
_this
 this
time
 _time
 _x

that's all ;)
Get those missions out there you morons!

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Reserved variables
« Reply #5 on: 24 Jan 2004, 09:36:56 »
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
Not all is lost.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Reserved variables
« Reply #6 on: 25 Jan 2004, 12:20:37 »
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
« Last Edit: 25 Jan 2004, 12:23:08 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:Reserved variables
« Reply #7 on: 25 Jan 2004, 12:52:40 »
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.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Reserved variables
« Reply #8 on: 25 Jan 2004, 23:16:44 »
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...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Reserved variables
« Reply #9 on: 26 Jan 2004, 01:38:17 »
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
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Reserved variables
« Reply #10 on: 26 Jan 2004, 01:54:18 »
Quote
This is going off at a tangent
Sry...  :beat:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.