Need help with Events for you scen? Post your predicament here and stop moping! ;)

yoshi

Emperor
Joined
Oct 2, 2002
Messages
1,179
I've opened this thread because my 'Events Thread' thread was a dud but I see that people sometimes need help with the macro. I don't understand why some people are so tight-lipped about their scens but if you have some question or need some idea for an event in your scen, post it here and I or someone else will give you an answer. (I'll try to remember to bump it up now and then. ;) )

IT DOESN'T MATTER HOW STUPID THE QUESTION, AS LONG AS IT IS ABOUT EVENTS, POST IT! (If you're too embarassed to post it, you can always PM me the problem. :rolleyes: )


Note: I posted a whole bunch of Events ideas in the other thread that can be found here. (If you have any questions about anything there post them.)
 
I don't think he was being sarcastic...perhaps he was being rhetorical.

In case he wasn't: In short, to make Civ2 better. Click on the link for more.



HELP WITH SCENARIOS:

For those of you who aren't familiar with events: if you're not using the macro it's likely your scenario will be better with some events so just post what you want done in your scenario and I, or anyone else can post some ideas (or even the script itself if you're stupped) for you to use.
 
Ok, I have question.

I wanted to put in some events that would activate when a wonder has been completed by a particular civ, like

@WONDERBUILT
WONDER = Pyramids
CIV = Egyptians
@THEN
CREATEUNIT....

or something similar.

But there is no wonderbuilt trigger, so have you any ideas how I might achieve a similar result?
 
It won't be exact, but the closest thing that comes to mind is to create a unit when the technology is researched. With the JUSTONCE text, it will only create the unit once, the turn after the tech is researched. If you want multiple units, I think the trigger minus JUSTONCE will create a unit each turn after the the tech is reasearched. Set the unit to be created in the capital, and you'll be set. As I said, not perfect, but close.
 
There is actually a 'Production' trigger that can do exactly that. Problem is, it's only available in ToT.

I'll assume you have MGE.

clockboy's solution sounds reasonable.

The tech trigger will probably play a role either way. I'll think it over and get back to you.
 
Thanks, the research trigger sounds acceptable, though production could also work if I use ToT. I don't have MGE, but I do have FW & ToT.

I was planning to use FW, because I was not sure about the animation of units in ToT, but I may use ToT if it provides the better options. After all, it does have multimaps, that could prove very useful.

Another question.
What about extreme defence units, eg set the defence to 99, What happens when the unit is fortified or becomes veteran, does this mess up the figures or does it work OK?

Cheers
 
ToT doesn't have to be animated--I have yet to find a ToT scen with animated units. Just turn off the animations (static and unit sprites) and edit Units file as you would with FW. The only difference is that the ToT Units file is in bitmap (.BMP) format as opposed to graphics interchange format (.GIF) and the squares are bigger.

Use ToT with Production trigger then.
 
In continuation...

ToT offers a lot in the way of additions to the macro (e.g. flags, new triggers, etc.). It also includes more tech and unit slots with new abilities. So, if you have the choice, the only thing that should stop you from making the scen using ToT is that a) fewer people will be able to play the scen because they don't have ToT (although they can upgrade MGE to ToT using Cedric's 'patch') and b) that ToT doesn't use the combat explosion images found in Icons.bmp--so non-animated combat is a little lame.

(Note that you can also upgrade your FW to MGE using Cedric Green's 'patch.')

If you want to have the units just face in the direction they're moving in, you can just allow static animations and edit Static.spr using Mercator's CivSprite utility. A lot less work than editing the animation files (also using CivSprite).

Extreme defence figures:

Not sure. Does it have to be 99? Note that this will not protect against nuclear attacks (unit with attack factor of 99).


About your event:

You could use the Production trigger to allow the building of a unit once built by giving the unit's prerequisite using the GiveTechnology action. Similar to the MGE solution. Or you could use flags to recreate a unit-producing wonder effect.

Example (note that I don't have the macro in front of me so the parameters may be wrong):

@IF
PRODUCTION
improvement=36 [wonder]
who=Romans
city=Rome
@THEN
Flag
flag=0
state=on
@ENDIF

@IF
Checkflag
Continuous
flag=0
@THEN
TURNINTERVAL
interval=6
@THEN
Text
^Legion created in Rome.
EndText
CreateUnit
unit=Legion
owner=Romans
veteran=no
homecity=none
locations
xx,xx
endlocations
@ENDIF

If Rome is captured, you don't have to set flag=0 to state=off because the unit can't spawn in a non-Roman city.


The MGE equivilant would be to prevent Legions from appearing (near) Rome by placing a foreign unit there or, since it's a land unit, you could just change the tile to water using a CT event instead. To remove the foreign unit, delete it also using the CT action.


Why don't you give me a few examples of what you want to do in the scen?
 
yoshi said:
(note that I don't have the macro in front of me so the parameters may be wrong)
You're right. ;)

You can't specify the city in which production will take place, only the civ - and you'll definitely require the "continuous" modifier to keep that flag switched on for longer than 1 turn. So you should have something like this for your first event:

@IF
CityProduction
builder=Romans
improvement=36
@THEN
Flag
continuous
who=Romans
state=on
flag=0
@ENDIF

The "who=" part isn't required, but it's better to keep things in check.

Use of the "continuous" modifier with CheckFlag (as you've done) is invalid – even if possible, its application would be redundant, as flags are automatically checked each turn.

yoshi said:
If Rome is captured, you don't have to set flag=0 to state=off because the unit can't spawn in a non-Roman city.
Yes, but your "Legion created in Rome" message will appear every time the event action is called, so you would either need to remove the message or use a second flag to indicate the city's ownership. With other corrections included, the former would give you something like this:

@IF
CheckFlag
who=Romans
flag=0
state=on
@AND
TurnInterval
interval=6
@THEN
CreateUnit
owner=Romans
unit=Legion
veteran=no
homecity=none
locations
xx, xx
endlocations
@ENDIF
 
It seems from this and other reading that ToT is definately the way to go, the cityproduction is just what I'm after.

When the specific wonder is completed, the event should create,

1 high defence, zero movement non unit, at a location within the city radius of the capital of the completing civ. Then at given turn intervals create additional non units at the same location.

The high defence unit does not have to be 99, but it should not be possible to defeat it, other than by destroying the civ that it relates to; though capturing the capital should alter the allegiance. This would probably need to be done by destroying all units at the location and then recreating new ones.

In addition the high defence unit should be bribable, but only at prohibative cost.

Many thanks to Yoshi and wobbegong for your assistance.

In case you are wondering about the Scenario, It is to be based upon the Raymond E Feist - Empire Series, with human operted Civ as the Acoma. Probable end point, destroy Minwanabi.

The Wonder would be "Negotiate Cho-ja Hive", creating the high defence unit, "Cho-ja Hive", and additional Cho-ja warriors, and silk caravan units at intervals.

It is still very early stages of the idea, though I am happy to keep fanatics posted as to progress.
 
Thanks for the corrections W (I would've done the corrections but my system is down--I'm writing this from a different computer).


@ferenginar:

The changing of allegiance event would only delete (CT) the Cho-ja Hive unit(s) in the capital city's radius and place (CU) only 1, or a specific number of Cho-ja Hive units in the same place under the attacker's flag. Since the defender's Cho-ja Hive units have been spawning at intervals all this time, there is no way of getting the same number to be created.

Using MGE, the bribability of the Cho-ja Hive unit would be dependant on the cost, distance from capital and treasury of the civ doing the bribing. In ToT you can set the exact number, regardless of the above factors if you want (see advanced unit abilties section in Rules.txt).

Silk caravans: Unfortunately, you can't set the Caravan commodity when using a CT event--it just defaults to the first commodity in the list (Hides). ToT doesn't change this AFAIK. The most you can do is to set the commodities for already-existing trade units.

Cho-ja Hive invincibility: by making it an immobile air unit will prevent any ground units (that don;t have the 'attack air' flag checked) from attacking it. Can't remember now if air units put out ZOC but either way it will still block that square.
Of course, if there is only one location for it, you could always make the Cho-ja Hive unit respawn each time it is destroyed thus creatin gthe illusion of invincibility.
(I once used something similar in the Rome scenario that shipped with the original Civ2. If the Romans destroyed 1 Barbarian Warrior (i.e. Goths), 2 Barbarian Warriors would appear somewhere in the Germania, thus the more you killed the worse it got; made the Germans near impossible to destroy--except by taking certain cities which would create blocking units on the the Barbarian-spawing squares. Made the power-hungry sucker playing the Romans sweat by the time the game got to half-time! In your case though, the point would be only to replace the Cho-ja Hive unit, not multiply it.)

Now that you mention negotiation, a neat event would be to use the Negotiation trigger when the Acoma try to talk to some other civ (listener). The action would set flag=0 to On which would allow more Cho-ja Hive units to be spawned using TurnInterval. Any good?
 
The immobile air unit sounds like the right way to go, there should not be any real air units, and if I don't check attack air, then it effectively becomes invincible.

The caravan issue can easily be circumvented, I can just rename the commodities so that silk is first on the list, I realise that this will reduce the bonus, but these are going to be free caravans, and I can just spawn more to balance the difference in bonus, additionally there should be a greater demand.

I'm not sure about negotiations in this scenario, I may well be restricting the opportunites to talk so that I can force intertribe relationships and keep civs as allies or enemies accordingly. I need yo think this aspect through a lot more first.

I have nearly completed the Map0 Kelewan in CivII editor, with Map1 Midkemia yet to be started, I thought I might get away with having to produce the Midkemian map when I found the Scenario in bestofnet about KESH, but it turned out to be completely different.

I am undecided at the moment whether to allow the change of allegience, but could settle for units at location if that is the only possibility. I am happy to set a high bribe in rules.txt, though bribing should be unlikely, as a human player of Acoma should keep a Cho-ja Warrior in the Hive, AI use of its own Hives may be a different matter.

I like the respawning idea and may include this as another aspect of the game, but as I said it's early days.

thanks for the support.
 
Negotiations: usng the Negotiation trigger has two functions: first to prevent a civ talking to the listener and second to act as a trigger for some action each time someone tries to contact the listener.

In this case, your civs won't talk, but if you try to talk, it will trigger an action if you want.


Example:


@IF
Negotiation
talker=Acoma
listener=?
talkertype=HumanorComputer
listenertype=HumanorComputer
@THEN
JustOnce
Text
^Negotiations for Cho-ja Hive take place. Cho-ja Hive unit arrives to defend Acoman capital.
EndText
CreatUnit
unit=Cho-ja Hive
owner=Acoma
veteran=no
homecity=none
Count=1
locations
xx,xx,y
endlocations
@ENDIF


I've used this as a way of giving the human player the ability to get military aid from allies.

Example:


@IF
Negotiation
talker=North Vietnamese
listener=Soviets
talkertype=HumanorComputer
listenertype=HumanorComputer
@THEN
JustOnce
Text
^We have requested aid from the Soviets. They have sent weapons to fight
the capitalist pigs! ;) ...At a modest price.
EndText
CreatUnit
unit=Viet Cong
owner=North Vietnamese
veteran=no
homecity=none
Count=50
locations
xx,xx,y
endlocations
@THEN
CHANGEMONEY
receiver=North Vietnamese
amount=-1000
@ENDIF


So in this example, you contact the Soviets civ when you need reinforcements quickly. You would wait until you really need them though since you can only do it once (use JustOnce otherwise the human will just keep contacting the Soviets in the same turn until he reaches the limit as his treasury can go no lower than 0).

It's also an interesting way of giving the AI some randomness. Use Negotiation to create a unit whenever the AI talks (usually happens whenever their units come into contact). It could result in hundreds of units being created or just a few, depending on how the game playes out.


Bribing: In ToT, you can also make individual unit-types unbribable instead of having to use Democracy as is the case in MGE.
I'm not sure but I think ToT also supports a unit bribe trigger (check the macro).

Note that there's also a lot to be done with techs and flags so be sure to exploit that.
(One thing I like to do to keep all the civs at generally the same level is to give all civs a tech the moment it is discovered.
 
That JustOnce shouldn't just be there to prevent cheating, is it? Quoting the macro.txt:

This is triggered when one civilization tries to initiate talks with another. When using this trigger, keep in mind that many things cause negotiations in the game, especially between computer--controlled players. Although it might be tempting to add some flavor to the game with a text pop--up whenever two civilizations try to meet ("Lincoln and Davis meet face to face, but Davis is adamant," for example), this can happen so often as to make the scenario unplayable.

Oh, and Ferenginar. I have Kelewan and Triagia civ2 maps somewhere, if you're interested. I made them on request a long time ago. I've never actually read any of the books though.
 
M: I've played with the Negotiation trigger (using MGE) and the AI civs don't necessarily contact each other that often. It usually depends on proximity. If they're allies you can simulate reinforcements or something: whenever their troops come into contact it triggers the appearance of more of their units. I should experiment more to be sure. Makes for interestig applications.
 
I just made a scenario and I can't get the event files to work. How do I get an event text to open up in the beginning screen before you even begin to play? And why is it when I have a text event for turn 2 or 4 it don't seem to want to work? I have text events for turns 1-6 and they aren't poping up.
 
I'm new to scenario building so don't take this as gospel but..

If you want the text to come up when the scenario opens then you need to have a text file with the scenario name eg myscen.txt

As for your turn events, are you sure that your scenario is starting at the correct turn, in the process of creating the scenario you may have advanced to turn 7 or more, you will need to reset this under scenario parameters.
 
Back
Top Bottom