Morten Blaabjerg
Settler
While we wait for the superior flexible editing and scripting tools of Civ3 (hopefully), I thought I'd post the notes on the Civ2 events from Microprose, to the benefit of all those who'd upgraded to MGE via Cedric Greenes patch. I never actually read these instructions before, but I dug them up from Apolyton in my search for tips, and I found it interesting. Basic, but interesting, and still useful for scenario creators. So anyway, here they are.
Credits : originally posted by St.Leo in the Apolyton forum , and converted/typed into a txt-document by myself.
____________________________________________________
Civ II(c) Scenario Macro Language
Copyright(c) 1996, 1997 MicroProse Software Inc.
The "Conflicts in Civilization" and "Fantastic Worlds" disks enhance the scenario support built into the original Civ II game. In building our scenarios, there were many things that we wanted to be able to do, but that Civilization II wasn't designed for. That is why we came up with the idea of a simple macro language. Something that was easy to change, fairly simple, yet powerful enough to do what we wanted. The macro language is a little 'down and dirty', and shouldn't be really called a 'language'. You may find some inconsistences, and probably some problems, but we hope that even as primitive as it is you will find it useful. Using the macro support you can now change how the computer behaves when playing your scenario.
The basic element of the macro language is called an 'event'. An 'event' is a combination of a trigger and an action. A doorbell ringing, for example, would be a trigger, someone getting up to answer the door would be an action. To add 'event' support for a scenario, just create a text file called 'events.txt' in your scenario directory and fill it with your own events. (With Fantastic Worlds, you can also use the Events Editor on the cheat menu.)
There are several 'triggers' and 'actions' built into the macro language. Let's say, for example, that on the eighth turn you want to remind the player that they have only four more turns before the end of the scenario. In this example, the trigger is the turn number equalling sixteen, and the action is to display some text. In the macro language it would look like this:
@BEGINEVENTS
@IF
TURN
turn=16
@THEN
TEXT
You have only four more turns to meet your victory conditions!
ENDTEXT
@ENDIF
@ENDEVENTS
That's it! Now on the beginning of the sixteenth turn a popup box will be displayed with the reminder text in it.
Now lets break down that example.
@BEGINEVENTS - the events.txt file must have this label in it before any events are defined. This tells the program that we are about to define our list of events.
@IF - the beginning of our event definition. This tells the computer that we are going to define a trigger next.
TURN - the type of trigger. In this case we are saying that we want to trigger our event based on a certain turn number.
turn=16 - trigger when the game turn equals 8.
@THEN - this tells the computer that our action is coming up next.
TEXT - the type of action. We want to display some text.
You have only four more turns... - our text to display.
ENDTEXT - we have no more text to display. We need this statement so that we can have multiple lines of text and still know when the text ends.
@ENDIF - the end of our event definition. Every event ends with this.
@ENDEVENTS - the events.txt file must have this label at the end of the list of events. This tells the program that we have finished defining events.
*IMPORTANT: in this version of the macro support you must NOT use spaces before or after the '=' sign. 'turn=16' works, 'turn =16' or 'turn= 16' will not work. This will change in the future as we improve the macro interpreter.
Debugging: You can add the statement @DEBUG after the line @BEGINEVENTS if you want the event parsing debugger to be enabled. This will enable a basic debugger to be turned on, which will open a window during the loading of the 'events.txt' file and print out labels as it finds them. You should be able to figure out where the parser fails by looking at the last good information that was parsed and compare it to the 'events.txt' file. Whatever statements come immediately after the last good information is probably the cause of the failure.
Now the macro language was really created to add 'flavor' to the scenario, so lets try an example that is a little more inspiring. You will also see that while we can have only one 'trigger', we can have multiple actions!
Here is a hypothetical example for an American Revolution scenario:
If England takes New York from the Americans, then display the text 'New York captured by the Redcoats! Enraged localcitizens join the fight for liberty!'. Also create a new American militia unit and try to start it at map location 84,22. If that is not a legal choice (enemy units already there etc.) then try 84,23 then 79,31.
Here is the macro language equivalent:
@IF
CITYTAKEN
city=New York
attacker=English
defender=Americans
@THEN
TEXT
New York captured by the Redcoats! Enraged local
citizens join the fight for liberty!
ENDTEXT
CREATEUNIT
unit=American militia
owner=Americans
veteran=false
homecity=none
locations
84,22
84,23
79,31
endlocations
@ENDIF
New terms:
CITYTAKEN - trigger when a particular city is captured.
city= - is the name of the city that was captured.
attacker= - who captured the city.
defender= - who lost the city.
CREATEUNIT - an action that consists of creating a new unit.
unit= - the name of the unit to create. These names can be found in the rules.txt file in the scenario directory. Make sure you spell the unit name EXACTLY as it appears in the rules.txt file.
owner= - who 'owns' the new unit.
veteran= - whether the unit has veteran status.
homecity= - the 'home' city of the unit.
locations - this says that we have some map locations coming. You can define up to 10.
84,22 - the first map location that the computer will try to put the unit.
84,23 - the second map location....
79,31 - the last map location. If we can't put it here then the unit is not created.
endlocations - this is the marker that says we have no more locations to define.
That's all there is to it.
Here is the list of triggers and actions that are currently supported:
TRIGGER REQ'D PARAMETERS PARAMETER VALUES
------------------------------------------------------------------
UNITKILLED unit= unit name or ANYUNIT*
attacker= civilization name or ANYBODY*
defender= civilization name or ANYBODY*
NEGOTIATION talker= civilization name or ANYBODY*
talkertype= HUMAN, COMPUTER, HUMANORCOMPUTER
listener= civilization name or ANYBODY*
listenertype= HUMAN, COMPUTER, HUMANORCOMPUTER
CITYTAKEN city= name of city
attacker= civilization name or ANYBODY*
defender= civilization name or ANYBODY*
TURN turn= number or EVERY
TURNINTERVAL interval= number
RANDOMTURN denominator= number
SCENARIOLOADED none none
NOSCHISM defender= civilization name or ANYBODY*
RECEIVEDTECHNOLOGY receiver= civilization name or ANYBODY*
technology= tech index number
ACTION REQ'D PARAMETERS PARAMETER VALUES
----------------------------------------------------------------------
TEXT TEXT text follows on next line
ENDTEXT none
CREATEUNIT owner= civilization name or ANYBODY* or trigger wildcard**
unit= unit name
veteran= yes,no,false,true
homecity= name of home city, or "none"
locations n x,y coordinates on next line(s)
endlocations
CHANGEMONEY receiver= civilization name or trigger wildcard**
amount= number
MAKEAGGRESSION who= civilization name or trigger wildcard**
whom= civilization name or trigger wildcard**
JUSTONCE none none
MOVEUNIT unit= unit name
owner= civilization name or trigger wildcard**
maprect 4 x,y coordinates follow on next line
moveto 1 x,y coordinate follow on next line
numbertomove= number or ALL
PLAYWAVEFILE filename
PLAYCDTRACK number
GIVETECHNOLOGY technology= technology index number
receiver= civilization name or trigger wildcard**
DESTROYACIVILIZATION whom= civilization name or trigger wildcard**
CHANGETERRAIN terraintype= terrain index number
maprect 4 x,y coordinates follow on next line
* NOTE: ANYBODY means all civilizations meet requirements
ANYUNIT means all units meet requirements
** NOTE: In actions linked to certain triggers, you can use the trigger wildcards to represent the name of a civilization that was involved in triggering the action. They are as follows:
TRIGGERATTACKER specifies the civilization that is the aggressor in a conflict trigger
(UNITKILLED or CITYTAKEN)
TRIGGERDEFENDER specifies the civilization that is the defender in a conflict trigger
(UNITKILLED or CITYTAKEN)
TRIGGERRECEIVER specifies the civilization that has the technology named in a
RECEIVEDTECHNOLOGY trigger
Credits : originally posted by St.Leo in the Apolyton forum , and converted/typed into a txt-document by myself.
____________________________________________________
Civ II(c) Scenario Macro Language
Copyright(c) 1996, 1997 MicroProse Software Inc.
The "Conflicts in Civilization" and "Fantastic Worlds" disks enhance the scenario support built into the original Civ II game. In building our scenarios, there were many things that we wanted to be able to do, but that Civilization II wasn't designed for. That is why we came up with the idea of a simple macro language. Something that was easy to change, fairly simple, yet powerful enough to do what we wanted. The macro language is a little 'down and dirty', and shouldn't be really called a 'language'. You may find some inconsistences, and probably some problems, but we hope that even as primitive as it is you will find it useful. Using the macro support you can now change how the computer behaves when playing your scenario.
The basic element of the macro language is called an 'event'. An 'event' is a combination of a trigger and an action. A doorbell ringing, for example, would be a trigger, someone getting up to answer the door would be an action. To add 'event' support for a scenario, just create a text file called 'events.txt' in your scenario directory and fill it with your own events. (With Fantastic Worlds, you can also use the Events Editor on the cheat menu.)
There are several 'triggers' and 'actions' built into the macro language. Let's say, for example, that on the eighth turn you want to remind the player that they have only four more turns before the end of the scenario. In this example, the trigger is the turn number equalling sixteen, and the action is to display some text. In the macro language it would look like this:
@BEGINEVENTS
@IF
TURN
turn=16
@THEN
TEXT
You have only four more turns to meet your victory conditions!
ENDTEXT
@ENDIF
@ENDEVENTS
That's it! Now on the beginning of the sixteenth turn a popup box will be displayed with the reminder text in it.
Now lets break down that example.
@BEGINEVENTS - the events.txt file must have this label in it before any events are defined. This tells the program that we are about to define our list of events.
@IF - the beginning of our event definition. This tells the computer that we are going to define a trigger next.
TURN - the type of trigger. In this case we are saying that we want to trigger our event based on a certain turn number.
turn=16 - trigger when the game turn equals 8.
@THEN - this tells the computer that our action is coming up next.
TEXT - the type of action. We want to display some text.
You have only four more turns... - our text to display.
ENDTEXT - we have no more text to display. We need this statement so that we can have multiple lines of text and still know when the text ends.
@ENDIF - the end of our event definition. Every event ends with this.
@ENDEVENTS - the events.txt file must have this label at the end of the list of events. This tells the program that we have finished defining events.
*IMPORTANT: in this version of the macro support you must NOT use spaces before or after the '=' sign. 'turn=16' works, 'turn =16' or 'turn= 16' will not work. This will change in the future as we improve the macro interpreter.
Debugging: You can add the statement @DEBUG after the line @BEGINEVENTS if you want the event parsing debugger to be enabled. This will enable a basic debugger to be turned on, which will open a window during the loading of the 'events.txt' file and print out labels as it finds them. You should be able to figure out where the parser fails by looking at the last good information that was parsed and compare it to the 'events.txt' file. Whatever statements come immediately after the last good information is probably the cause of the failure.
Now the macro language was really created to add 'flavor' to the scenario, so lets try an example that is a little more inspiring. You will also see that while we can have only one 'trigger', we can have multiple actions!
Here is a hypothetical example for an American Revolution scenario:
If England takes New York from the Americans, then display the text 'New York captured by the Redcoats! Enraged localcitizens join the fight for liberty!'. Also create a new American militia unit and try to start it at map location 84,22. If that is not a legal choice (enemy units already there etc.) then try 84,23 then 79,31.
Here is the macro language equivalent:
@IF
CITYTAKEN
city=New York
attacker=English
defender=Americans
@THEN
TEXT
New York captured by the Redcoats! Enraged local
citizens join the fight for liberty!
ENDTEXT
CREATEUNIT
unit=American militia
owner=Americans
veteran=false
homecity=none
locations
84,22
84,23
79,31
endlocations
@ENDIF
New terms:
CITYTAKEN - trigger when a particular city is captured.
city= - is the name of the city that was captured.
attacker= - who captured the city.
defender= - who lost the city.
CREATEUNIT - an action that consists of creating a new unit.
unit= - the name of the unit to create. These names can be found in the rules.txt file in the scenario directory. Make sure you spell the unit name EXACTLY as it appears in the rules.txt file.
owner= - who 'owns' the new unit.
veteran= - whether the unit has veteran status.
homecity= - the 'home' city of the unit.
locations - this says that we have some map locations coming. You can define up to 10.
84,22 - the first map location that the computer will try to put the unit.
84,23 - the second map location....
79,31 - the last map location. If we can't put it here then the unit is not created.
endlocations - this is the marker that says we have no more locations to define.
That's all there is to it.
Here is the list of triggers and actions that are currently supported:
TRIGGER REQ'D PARAMETERS PARAMETER VALUES
------------------------------------------------------------------
UNITKILLED unit= unit name or ANYUNIT*
attacker= civilization name or ANYBODY*
defender= civilization name or ANYBODY*
NEGOTIATION talker= civilization name or ANYBODY*
talkertype= HUMAN, COMPUTER, HUMANORCOMPUTER
listener= civilization name or ANYBODY*
listenertype= HUMAN, COMPUTER, HUMANORCOMPUTER
CITYTAKEN city= name of city
attacker= civilization name or ANYBODY*
defender= civilization name or ANYBODY*
TURN turn= number or EVERY
TURNINTERVAL interval= number
RANDOMTURN denominator= number
SCENARIOLOADED none none
NOSCHISM defender= civilization name or ANYBODY*
RECEIVEDTECHNOLOGY receiver= civilization name or ANYBODY*
technology= tech index number
ACTION REQ'D PARAMETERS PARAMETER VALUES
----------------------------------------------------------------------
TEXT TEXT text follows on next line
ENDTEXT none
CREATEUNIT owner= civilization name or ANYBODY* or trigger wildcard**
unit= unit name
veteran= yes,no,false,true
homecity= name of home city, or "none"
locations n x,y coordinates on next line(s)
endlocations
CHANGEMONEY receiver= civilization name or trigger wildcard**
amount= number
MAKEAGGRESSION who= civilization name or trigger wildcard**
whom= civilization name or trigger wildcard**
JUSTONCE none none
MOVEUNIT unit= unit name
owner= civilization name or trigger wildcard**
maprect 4 x,y coordinates follow on next line
moveto 1 x,y coordinate follow on next line
numbertomove= number or ALL
PLAYWAVEFILE filename
PLAYCDTRACK number
GIVETECHNOLOGY technology= technology index number
receiver= civilization name or trigger wildcard**
DESTROYACIVILIZATION whom= civilization name or trigger wildcard**
CHANGETERRAIN terraintype= terrain index number
maprect 4 x,y coordinates follow on next line
* NOTE: ANYBODY means all civilizations meet requirements
ANYUNIT means all units meet requirements
** NOTE: In actions linked to certain triggers, you can use the trigger wildcards to represent the name of a civilization that was involved in triggering the action. They are as follows:
TRIGGERATTACKER specifies the civilization that is the aggressor in a conflict trigger
(UNITKILLED or CITYTAKEN)
TRIGGERDEFENDER specifies the civilization that is the defender in a conflict trigger
(UNITKILLED or CITYTAKEN)
TRIGGERRECEIVER specifies the civilization that has the technology named in a
RECEIVEDTECHNOLOGY trigger