There are a total of 256 event
flags that the scenario designer can toggle. They are organized
into eight groups of thirty-two flags each. Each group of 32
flags corresponds to a civilization in the game and the eighth
group is always the barbarians.
We can think of flags as little
light bulbs being turned on
and off .
Count from the Right and
Begin with Zero
When counting, we are taught
from our childhood days to begin with the number one, but computers
begin counting from the number zero. To a computer the first
item in any list is item #0. Since Flags are the domain of the
computer we must count like a computer. Therefore the 32 flags
are numbered 0, 1, 2, 3,
31 rather then 1 to 32.
Therefore, 'Setting Flag=1
to on' is setting the second flag to 'on' as the computer
understands it, not the first flag.
This is very likely to cause
many event writers untold grief because the computer will not
return an error message if we number a flag incorrectly. Rather
it will cause the intended trigger to fail without explanation
and probably cause a different trigger to happen instead.
'Reverse programmer notation'
is a term that appears in some files as well as the Official
Guide. It simply means that the first flag (flag 0) is on the
right-hand side and the last flag (flag 31) is on the left-hand
side.
When modifying or creating
text-based files in Civ2 ToT for scenario development, the use
of the semi-colon (;) in most cases (exceptions include text
boxes) tell the computer that the line from that point on for
its purposes is empty. For you and I however, it can be a valuable
place to include notes and explanations. You will notice the
use of the semi-colon in the examples set out later. This tip
will also show rows of light bulbs these are used to help
the reader visualise what is happening with flags (you shouldn't
try to put images of light bulbs into a 'text only' events file!).
The Continuous Modifier
At the beginning of each turn
the 'Civilization Events Parser' resets all the flags to the
'off' position. In order to keep our flags 'lit' beyond the end
of the turn we need to insert the 'Continuous' modifier into
our event structure when setting the flag.
This tells the 'events parser'
that that particular flag is not to be reset at the end of the
turn.
After George Washington was
killed our flags will look like this;
Americans |
|
British |
|
Since we used the 'Continuous'
modifier we can check this flag throughout the scenario. A simple
example of how we might use this flag is to display a different
text based event on whether George Washington is alive or not.
Let us say that the British capture the city of Philadelphia
and we want one of two messages to be displayed based on whether
George Washington is alive or not:
Using a Flag without the
'Continuous' modifier
Let us now look at an example
of where we do not want to use the 'Continuous' modifier when
setting a flag. Suppose we want to give the Americans a new Militia
unit at the end of each turn in which a British regular army
unit was destroyed by an attacking American unit. In order to
create only one unit per turn we need the assistance of a flag.
Since we did not use the continuous
modifier, flag 1 will be reset to off at the beginning of the
next turn.
We can extend the scope of
British units that contribute to the trigger with very little
additional effort. In addition to the destruction of British
regulars we will also include Hussein Mercenaries.
Allowing or preventing units
being created
In our final example we will
modify the event structure that creates American militia units
to only create them if George Washington is still alive.
|