OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: UNN on 28 Apr 2005, 07:23:51

Title: __ Reserved variables
Post by: UNN on 28 Apr 2005, 07:23:51
Hi,

I recently stumbled across this error:

(http://homepages.gotadsl.co.uk/~gssoft/Error01.jpg)

This was caused by having the ~ command with no parameters:

Code: [Select]
Unit=_This Select 0

~

Hint Format ["Time %1",Time]

On a side note this for me, dispels any of my remaining doubts that @ is any more or less efficant than ~. It suggests to me that when you use the ~ command you are really just calling something that would look like this in a regular script:

Code: [Select]
_Delay=_This Select 0

_WaitFor=Time+(_Delay)

@(Time>_WaitFor)

But I wondered if there are any other __ reserverd variables we might be able to use in OFP?

Cheers
Title: Re:__ Reserved variables
Post by: macguba on 28 Apr 2005, 10:17:12
All variables starting with two __underscores are reserved.    Though I don't know what any of them are.
Title: Re:__ Reserved variables
Post by: hermano on 30 Jun 2005, 16:20:37
It seems there are some variables (but those might belong to cpp libraries then they could not be used in scripts), but no more functions:
__cur_mp
__SERVER__
__cur_sp
__PLAN
__BRIEFING
__STATISTICS
__DEBRIEFING
__OBJECTIVES
__waituntil = _time+(%s)

__emissive
__specular
__diffuse
__ambient
(material properties of textures)

__EVAL
__EXEC

I haven't found anything exciting. You can have a look yourself, open the Flashpoint.exe with a notepad (or hexeditor) and have a look at the stringtables (close to the end of the file). Every string (~"word") that is used by the engine (and is not defined outside - and the script commands are not afaik) is listed there, but all the strings of included libraries too (math commands, error messages, directx and direct draw messages and so on...).
h
Title: Re:__ Reserved variables
Post by: UNN on 01 Jul 2005, 14:43:00
Quote
It seems there are some variables

Nice one,

Code: [Select]
__cur_mp
__SERVER__
__cur_sp

__EVAL
__EXEC

These are worth a closer look.

Cheers
Title: Re:__ Reserved variables
Post by: Wadmann on 01 Jul 2005, 23:41:42
Although I do not know how they actually operate, aren't the __cur_mp & __cur_sp the text that is displayed when you do not name a mission?

If it is any clearer this way, aren't these these default values for an exported mission name from the editor?

Wadmann
Title: Re:__ Reserved variables
Post by: hermano on 04 Jul 2005, 15:34:23
Right Wadmann,
__cur_mp & __cur_sp are used to name unnamed missions, so these won't be useful (and not usable) for scripting.

__EVAL and __EXEC are used in the config files,
for example:
Code: [Select]
class ValueAmmo : RscSliderH
      {
         idc = IDC_ARCUNIT_AMMO;
         x = 0.235;
         y = __EVAL(box_y + 0.18);
         w = 0.32;
      };
and

__EXEC(line_y = line_y + 4.4 * LINE_HEIGHT)

__SERVER__ will probably store the server address (internal, I don't think this can be used in scripts).

So nothing exciting so far, it seems there are no hidden commands.
h