ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Maps/Section: VariableNames

From ModEnc
Revision as of 15:52, 5 May 2006 by DCoder (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Tiberian Dawn The Covert Operations Red Alert Counterstrike Aftermath Tiberian Sun Firestorm HyperPatch Red Alert 2 Yuri's Revenge Ares Generals Zero Hour Tiberium Wars Kane's Wrath
Flag: Maps/Section: VariableNames
File(s): rules(md).ini
Values: ERROR – No value types set! Please edit this page and fix the Flag template!

This entry was copied from DeeZire's Red Alert 2 and Yuris Revenge INI Editing Guide for the sake of completeness. As it is not our intention to rip off DeeZire's work, this article is subject to a re-write and update with the latest community knowledge.

For further information, please read Inclusion of The Guide.




This section defines all of the local variables - variables which are used to test for specific conditions only on this map. This is opposed to global variables which are defined in the RULES file and which can 'hold' their value and thus be used throughout many maps (for example in a campaign). TIP: bear this in mind with global variables - they will carry their last values from any previous maps which used them into the current map and could cause chaos if you do not remember this.

Whether global (throughout the campaign) or local (specific to this map only), such variables use the games boolean logic and thus can only exist on one of two states at any time - SET (1) or CLEAR (0).

All global and local variables are clear (have a value of '0') until set. They may be set (set to '1') or cleared (set to '0') by an Action or a ScriptType command (see the AI.INI Guide) however they can only be tested (i.e. have their current value queried) by an Event=.

You should use this section to define all local variables which you wish to use on your map. This allows you, through the relevant Event, to test that conditions are being met thus make things happen through an Action when those conditions are met (or not as the case may be). Each local should be listed here, numbered in sequence starting at '0'. A typical entry looks like this;-

10=Bridge_Fixed,1

All this means is that we are telling the game that local variable number 10 is going to be used to indicate whether or not a bridge has been repaired. You can use any alphanumeric string description to describe the local - purely so it makes sense to you, as the game does not parse it (it simply allows for a text description in a similar way to the Name= tag). In the example above, we are setting this local to SET (i.e. giving it a value of '1') to indicate that the bridge starts in a repaired state.