Events Thread

yoshi

Emperor
Joined
Oct 2, 2002
Messages
1,179
Thread is for information and ideas concerning events (Civ2 macro 'language'). Includes relevant links and DLs.

Although this thread is intended for people who already know how to use the macro, this forum is becoming more deserted every year so any newbies feel free to post ANY questions concerning the events.

I am also using this thread to post any new ideas that I can come up with. (Note that some of them are not fully tested, as I just post a lot of the stuff as I think of it--but I will be testing and updating where apropriate at some point in the future.)

If you would like a more detailed explanation about each sample than the one provided, please post your question (don't PM me unless you fell it's necessary because this thread is meant for all to benefit).

Note: In your post, be sure to indicate the version of Civ2 that you are using: Multiplayer Gold Edition (MGE) or Test of Time (ToT).

If you don't have the latest patch, get it here.

For those of you who don't have MGE or ToT, please convert your Classic version to MGE here. (The game is the same as Classic but with a few very minor differences--and it's needed to play most of the scenarios that are available on-line.)


Here are some helpful Event-related links:

The Cradle of Civilization: An Introduction to Flags
(Note: This site is dedicated primarily to Civ2:Test of Time.)

Scenario League Design Tips: Fantastic Worlds Events Quirks
(Contains some helpful information concerning embedded events.)

Scenario League Design Tips: Fun with Barbarians
(Events-related stuff is at the bottom of the article.)

Delevent for MacIntosh
(Also applies to PC users.)

Apolyton/Scenario League (Forum): Help with Scenario
(Addresses some problems that may arise when using events.)

Scenario League Design Tips: An Introduction to Flags
(This may be the same file used by CofC...)

Multiple events files by Allard Höfelt (Scenario League)
(Note that there's more to using multiple events than just space-efficiency.)

CivSwap by Jorrit "Mercator" Vermeiren
(Haven't tried it yet, but should be helpful to those using multiple files.)


Info concerning Events is scarce so anything new would be much appreciated.


I've attached the Macro.txt files for Fantastic Worlds (implies MGE) and Test of Time (they can be found in the game's main directory--the one the exec is inl; e.g. C:\MPS\Civ2.) They contain each of the trigger, action, modifer and flag parameters with their applicable parameter values (i.e. lists each type of trigger, action, modifier and flag that can be used in either MGE or ToT).
 

Attachments

You should edit the post and add a text to what the different links lead to. Apart from that, great job and great idea!
 
>Pouf!< Editing complete.



Note: I wouldn't mind talking about the stuff mentioned in the various articles, so post any questions or comments after you have read them.

Also, remember to post any helpful links that I haven't --as I said, information on Civ2's Macro language is rather scarce so any new stuff would be much appreciated.

And again, post any questions about how to use the Events.txt file, tips on how to use events a scenario...anything. (To those who are already familiar with the macro: feel free to point out anything I may have left out in my reponses to questions.)


I would personally like to see some new event ideas so I'll start the thread with an idea that has probably been thought of but I have yet to see it used in a scenario (and even if it has, comment on it anyway):

ToT includes a DELAY modifier that allows an action x number of turns after the event has been triggered. MGE lacks this modifier. So, I figured why not use a combination of CREATEUNIT and UNITKILLED to reproduce the delay effect? I did this as follows:

1. Placed a few land tiles adjacent to one another in a line in a remote part of the map's Ocean. Thus having a strip of land 5 squares in length.

2. Created 2 types of land unit: Unit A (ADM/Flag: 2/1/1/Dest.); Unit B (1/1/0) --of two different civs (let's say Neutral and Barbarian).

3. Placed 'Unit B' (which is immobile) at one end of the strip --he just sits there.

4. Trigger added to Events.txt: CITYTAKEN ('yoshi's House').

5. 3 actions added to trigger in Events.txt: a) TEXT: "yoshi's House captured by...(who cares). yoshi's civ has 4 turns to re-capture the city or be destroyed!!!" b) CREATEUNIT: 'Unit A' appears at other end of strip; c) MOVEUNIT: area of effect directly around 'Unit A', set to 'Unit B's' coordinates.

6. Trigger added to 2nd event in Events'txt: UNITKILLED ('Unit B').

7. 3 actions added to 2nd event: a) DESTROYACIVILIZATION (yoshi's civ); b) TEXT: "yoshi has failed to retake yoshi's house thus yoshi's civ has been wiped from the face of the earth...making some at CFC very happy!"; c) CREATEUNIT (another 'Unit B' to replace the one that has just been destroyed at the same coordinates).

8. Trigger added to 3rd event: CITYTAKEN ('yoshi's House' retaken by yoshi's civ).

9. 2 Actions added to 3rd event: a) CHANGETERRAIN (all squares of strip of land except 'Unit B's' square) --'Unit A' is destroyed; b) TEXT: "yoshi's civ has retaken the 'yoshi's House' and evaded certain doom!"


Notes:
- The CHANGETERRAIN action would actually have to be repeated 3 times in order to cover the squares between 'Unit A's' starting location and 'Unit B's' location.

- 'Unit A' is given the 'Destroyed after attacking flag' so that it will not keep destroying the next 'Unit B' to appear.

Summary: When 'yoshi's House' is taken, a Barbarian 'Unit A' is created on the strip of a land and is set to move towards the Neutral 'Unit B's' location. If yoshi's civ doesn't retake 'yoshi's house' in 4 turns, then 'Unit A' will destroy 'Unit B' and it goodby to yoshi's civ.

Example:

@IF
CITYTAKEN
city=yoshi's House
attacker=who cares
defender=yoshi's civ
@THEN
TEXT
"yoshi's House captured by...(who cares). yoshi's civ has 4 turns to re-capture the city or be destroyed!!!"
ENDTEXT
@THEN
CREATEUNIT
unit=Unit A
veteran=yes
homecity=NONE
locations
xx,xx
endlocations
@ENDIF

@IF
UNITKILLED
unit=Unit B
attacker=Barbarians
defender=Neutrals
@THEN
TEXT
"yoshi has failed to retake yoshi's house thus yoshi's civ has been wiped from the face of the earth...making some at CFC very happy!" :D
ENDTEXT
@THEN
DESTROYACIVILIZATION
civilization=yoshi's civ
@ENDIF

@IF
...
Anyway you get the idea.
(Pardon me if the parameters are wrong..didn't bother to check.)
 
I've got to stop writing these long posts...they scare people away. (You don't HAVE to read that post.)

Civ2's marco is the hardest thing to work with for most scenario designers. Someone must have something to talk about concerning events! (Then again, since Conquests came out it's become increasingly rare for anyone to post in this forum...which is unfortunate.)
 
Actually.. I think that's quite useful. But you can't use it if you have scenario where everything in map is visible...right?
 
I didn't quite get that last post.

If you meant that events don't activate when you reveal the map using the in-game Cheat menu, then my answer is that revealing the map has absolutely no effect on events (or anything else).

Now that you mention it, there is one advanctage to revealing the map using the Cheat menu (note: I'm referring to 'Reveal Player Map' option --shortcut: "Y" key-- and not the Reveal Map option in Scenario Options in the Cheat Menu): you will not only see everything on the map (no fog of war --Civ2 doesn't technically have this as there is no 'shading effect' on tiles that you can't see) but you will actually see the orders in the inforemation window (under the mini-map) and you will see an order code on the enemy units' shield. For instance, if an 'A' is displayed in the unit's shield, the has been given orders to attack something. You should note that when you give a unit the 'Go To...' order and the coordinates are an enemy unit, the 'Attack' code is implied.

Where events are concerned:

The event action implied here is obviously MOVEUNIT.

You will notice that if you set an area of the map (in action's 'maprect' parameter) to move units to x location (while the map is revealed), the code in the affected unit's shield is a '7.' This code indicates that the unit has been given orders via event --as opposed to via AI.

Notes on MOVEUNIT:
- Only works with AI civs (human-controlled units will be unaffected).
- Bug#1: will only activate units if you set the 'unit' parameter to 'AnyUnit' (will not work if you specify a unit).
-Bug#2: will only activate units that have just been created via events that have yet to recieve any orders --even if the unit display box indiactes that the unit has 'No Orders' (in fact, the unit may have to have been created in the same event as the MOVEUNIT action, I'm not 100% sure).
Note: although you may not consider this to be a bug it is because macro.txt indicates that you should be able to activate all units within the maprect as long as they are not Fortified or already been given orders.
 
Umm...what I ment was that if you have the whole map visible then aren't you able to see the extra lands that "shouldn't" be there?? Aren't they in a way spoiling the gaming experience?
 
Oh. Sorry. I think you may have the wrong thread my friend. This thread is for event-related posts only (yours concernes something else).

...but since you're the first to actually post a question, thanks anyway! ;)


And as for the rest of you...POST SOMETHING ALREADY! (Just keep it on the topic of Events.)
 
Well.. it did (in a way) have something to do with that event.. I just like to get stuck in details...
 
-Bug#2: will only activate units that have just been created via events that have yet to recieve any orders --even if the unit display box indiactes that the unit has 'No Orders' (in fact, the unit may have to have been created in the same event as the MOVEUNIT action, I'm not 100% sure).

No one noticed that this is incorrect? I did some more playtesting and found that a MOVEUNIT event will activate units other than those created via events.

The Macro.txt file is partially right in that units without orders (that are within the area of the maprect) will be affected. It's just that as far as I can tell, the only time AI units are without orders is a) when in a city (AI unit orders get cleared whenever the unit is in a city for some reason, even when the unit is only passing through in order to get to some other coordinates; fortified units are also affected, contrary to what it says in Macro.txt), b) an enemy unit comes within visual range and clears the unit's orders (just like human-controlled units do). Aside from these two, I can't thinkof any other circumstances where the Ai units would be without orders.

I'm still not sure about the 'No Orders' code because I've seen AI units with this status not be affected by MOVEUNIT events (when not in a city).

NOTE: I'm thinking of perhaps putting together an 'updated' Macro.txt (named: 'NewMacro.txt') for both MGE and ToT that will include notes on each action, trigger, modifier, and its parameters (also some info on flags). But I'm not going to unless I can confirm that all my info is correct, so if you see anything odd (aside from perhaps my frequently akward use of the English language) please inform me of it. Thanks.
 
Originally posted by Cleveland
Umm...what I ment was that if you have the whole map visible then aren't you able to see the extra lands that "shouldn't" be there?? Aren't they in a way spoiling the gaming experience?

Hmmm... Maybe you should quote the example to make Yoshi see what you're referring to. ;)

Actually its quite funny to follow this thread, always funny when people keeps misunderstanding each other :D
 
Actually its quite funny to follow this thread, always funny when people keeps misunderstanding each other
It's the only thing were good at.
 
Where is this mysterious macros.txt file located?
I'd like to take a look at it because if all of what you say is in this file, i'd like to look at it because it has more sufficiant (I appologize if I didn't spell that right.) than the info I got from my book. I have TOT. Was it still installed? I also was hoping somone would post more(someone else has) info on flags at my flags thread. I will look at some of the flag web-sites that you posted. and look for that file in "MyComputer".
 
The file named, 'Macro.txt' is located in the main ToT directory. This file only describes each of the available event scripts, nothing more --it is practically useless where flags are concerned. Yes, check out the last link in the first post of tis thread, it should help. I just skimmed through it but I'm pretty sure it clarifies the issue of flags.

ToT contains more triggers, actions and modifieres than MGE. The flags are completely new.

Some of the ToT additions are quite useful and it's really too bad they aren't in MGE (e.g. the 'Count=' parameter added to the CREATEUNIT action is great because t saves you having to write a seperate event for each unit --creating 8 of the same unit can be done by simply writing 'Count=8' rather than writing the event 8 times over which takes up events memory unecessarily; the irony is that ToT has more events capacity than any of the other versions and can well afford the additional events).

Katlover97, I visited you thread and posted there. Good to see more threads on Events --although posts in this forum seem to be scarcer these days. (Perhaps that will change when people get bored of C3C.)
 
Some info on flags for ToT at Katlover97's thread here.

(I posted a way of using flags to simulate resource loss/gain through the capture of key cities.)
 
STRATEGIC BOMBING?


To cause damage to enemy's infrastructure:

@IF
UNITKILLED
unit=Factory
attacker=Anybody
defender=TRIGGERDEFENDER
@THEN
CHANGEMONEY
reciever=TRIGGERDEFENDER
amount=-100
@ENDIF

If you bomb the enemy's Factory units often enough, you will bankrupt him and possibly cause improvements to be sold off.

For ToT you can add this feature - Rebuilding Factories in 12 turns:

@IF
UnitKilled
unit=Factory
attacker=Anybody
defender=TRIGGERDEFENDER
@THEN
CHANGEMONEY
reciever=TRIGGERDEFENDER
amount=-100
@THEN
Delay
delay=12
CreateUnit
owner=TRIGGERDEFENDER
unit=Factory
Count=1
veteran=Yes
homecity=None
locations
x1,y1,z1
endlocations
@ENDIF

Both are good for adding an extra challenge for players of protecting vital infrastructure.
 
Additionally, if you want to ensure that the AI comes back and bombs you agan:

@IF
UnitKilled
unit=Factory
attacker=Allies
defender=Axis
@THEN
Delay
delay=12
CreateUnit
owner=Allies
unit=Bomber
Count=2
veteran=Yes
homecity=None
locations
x1,y1,z1 [somewhere adjacent to the Factory unit]
x1,y1,z1
x1,y1,z1
endlocations
@ENDIF

Clearly this example would only work if you had only one Factory unit for each civ. Also, the TRIGGERDEFENDER feature does not apply here --unless you just have one Factory on the whole map of course. The best thing to do is to have Bombers appear at all Factory locations but with different delay times so that they don't all appear in the same turn --otherwise it would be a little much for most players. ;)


If you could custom name each individual unit within a unit type, like 'Factory23' or something --like you can in Civ3-- then you could assign a Bomber to each individual factory. Unfortunately that is not the case you if you wanted to do something like that you would have to have a sepereate unit type named Factory1,2,3, etc.

If that's what you want then you would do as follows:

@IF
UnitKilled
unit=Factory1
attacker=Allies
defender=Axis
@THEN
Delay
delay=12
CreateUnit
owner=Allies
unit=Bomber
Count=2
veteran=Yes
homecity=None
locations
x1,y1,z1
x1,y1,z1
x1,y1,z1
endlocations
@ENDIF

@IF
UnitKilled
unit=Factory2
attacker=Allies
defender=Axis
@THEN
Delay
delay=12
CreateUnit
owner=Allies
unit=Bomber
Count=2
veteran=Yes
homecity=None
locations
x1,y1,z1 [locations next to Factory2]
x1,y1,z1
x1,y1,z1
endlocations
@ENDIF


Note that ypou could do something like 'Industrial Sector A,' 'Industrial Sector B,' 'Industrial Sector C' placed at various locations and do the same for each civ because remember that if the owner is different it's like having a seperate unit.
You could take advantage of the specific unit trigger by using ChangeTerrain to lower shield output of tiles around certain cities near each Industrial Sector.

Example:

@IF
UnitKilled
unit=Industrial Sector A
attacker=Allies
defender=Axis
Text
^Allies destroy key Axis industrial facilities!
It will take the Axis months to rebuild these facilities.
Endtext
@THEN
ChangeTerrain
terraintype=2 [none-productive terrain]
maprect
x1,y1,x2,y2,x3,y3,x4,y4
@THEN
Delay
delay=12
Text
^Axis engineers rebuild industrial facilities.
Production is increased.
Endtext
@THEN
CreateUnit
owner=Axis
unit=Industrial Sector A
Count=2
veteran=Yes
homecity=None
locations
x1,y1,z1 [same location as before]
endlocations
ChangeTerrain
terraintype=1 [productive terrain]
maprect
x1,y1,x2,y2,x3,y3,x4,y4
@ENDIF

Note: Be sure to set the 'Factory' units to veteran status so that if they aren't destroyed in combat, you won't get the "For valor in combat..." message.

This is just one example of using immobile units in conjunction with Civ2's macro. Makes for a more interesting and challeging game so I urge you to consider incorperating this kind of event into your scenarios if you haven't already.
 
Using the Macro to Simulate Blockades:


Let's say you want to simulate the British blockade of French-controlled ports during Napoleon's reign.

Create immobile (movement=0) 'Naval Blockade' unit.

The create that unit via events in a city's Ocean square (only Ocean square(s) ajacent to the city --may require more than one unit), then remove it using CHANGETERRAIN (this action eliminates everything on a tile except for some tile improvements).

Example:

@IF
TURN
turn=24
@THEN
Text
^The British set up a blockade to prevent French ships from operating in the Channel!
Endtext
@THEN
CreateUnit
owner=British
unit=Naval Blockade
veteran=Yes
homecity=None
locations
x1,y1,z1
endlocations
@ENDIF

@IF
TURN
turn=36
@THEN
Text
^The British blockade comes to an end...
Endtext
@THEN
ChangeTerrain
terraintype=11 (I think 'Ocean' is eleven...ahem... :D )
maprect
x1,y1,x1,y1,x1,y1,x1,y1 [coordinates of Naval Blockade unit]
@ENDIF

If using Civ2:ToT you can limit the whole thing to a single event:

@IF
TURN
turn=24
@THEN
Text
^The British set up a blockade to prevent French ships from operating in the Channel!
Endtext
@THEN
CreateUnit
owner=British
unit=Naval Blockade
veteran=Yes
homecity=None
locations
x1,y1,z1
endlocations
@THEN
Delay
delay=12
Text
^The British blockade comes to an end...
Endtext
@THEN
ChangeTerrain
terraintype=11 (I think 'Ocean' is eleven...ahem... :D )
maprect
x1,y1,x1,y1,x1,y1,x1,y1 [coordinates of Naval Blockade unit]
@ENDIF

(If you use the Delay modifier, you can repeat the same action in a single event --although Delay can only be used once in a single event.)


IMPORTANT NOTE:

I forgot to mention this earlier but if you want to use the ChangeTerrain action to change just 1 square then you just set the coordinates under maprect to all be the same (i.e. repeat the same coordinates 4 times). You can see what I mean in the examples above.

Another interesting application of this is to design an immobile unit, name it 'Impassable,' make the owner a Neutral civ that is allied with all other civs and can't negotiate (use NEGOTIATION event for this), then place the unit across areas of the map where you don't want certain players going. If you want to allow players into those areas later in the game, just use ChangeTerrain to remove Impassable units at certain points in the line (e.g. simulating the starting of a campaign into another region of the map at a certain date).

Using ToT you can do this using terrain with the Impassable flag set. The only downside is that air units ignore Impassbale terrain by default.

Also note that niether of the above can prevent units with the paratrooper ability to paradrop into the other region.

If you're up to it, you could have Carthage 'Blockade' units appear across the western Mediterranean during the Punic Wars. You would have to be willing to use up quite a bit of events memory to write out all those CreateUnit events though!
 
Back
Top Bottom