Is it possible in ToT's Events.txt ...

MikeLynch

Just a Baker Street Muse
Joined
Oct 5, 2003
Messages
540
Location
The Bering Isthmus
I can't seem to find my ToT manual at the moment, and doing a full-scale search will take more time than I am able to devote for the next few days :cry: ... so I thought I'd ask here.

I'm wondering if it's possible to make an event that allows every city (human or AI) to receive a CreatedUnit or a set amount of gold at an interval (say 20-30 turns) but *only while* that city has a particular improvement in it.
 
I think you'd need macro.txt for that rather than your manual. :p

There's the CityProduction trigger which can trigger an event when a city builds a city improvement. I'm not sure if it is triggered for every turn after that too, but you can use flags for that if necessary and create units based on that... You can also @AND the TurnInterval trigger with the existence of that flag...

[Edit: In fact, I very much doubt the CityProduction event triggers every turn after it's been built since it is linked to a civilization rather than a specific city.]

I don't think it's possible to test for the removal of a city improvement, though. So perhaps the best you could do is, instead of having it last forever, have it only last a set number of turns...

The biggest problem, though, is that you can't link the location and home city of created units to the city that triggered the CityProduction. The best you can do is create a list of coordinates for important cities and randomly create your units in one of those spots.

Also, since you'd be relying on the flag(s), it won't actually matter how many cities have that city improvement, because every city creating that improvement would trigger the same event and set the same flag.

The best you can do there is use up the max of 32 flags for 32 different cities...

Code:
@IF
CityProduction
builder=someciv
improvement=whatever
@AND
CheckFlag
who=someciv
state=on
flag=0
@THEN
Flag
Continuous
who=someciv
flag=1
state=on
@ENDIF

And that repeated for all the next flags too. And then for each of these flags you have a separate event creating the units. That way you get a maximum of 32 units per turn (assuming at least 32 cities have the city improvement and only one unit is created per city).

That's all going to take up a lot of events space, though.
 
I think you'd need macro.txt for that rather than your manual.
:hammer2:

The biggest problem, though, is that you can't link the location and home city of created units to the city that triggered the CityProduction. The best you can do is create a list of coordinates for important cities and randomly create your units in one of those spots.
Ahhh... Yes. Okay, thanks then. I hope my aborted idea spawns new ideas for any onlooking scenario-builders, then... :mischief:
 
It's a bit whacky, but you could have a city with a transporter on another map containing the created units. Those units could move to any city on the primary map that contains a transporter. There're a number of ways to tweak this, but the basic idea is to use another map to store reinforcements rather than use CreateUnit events to make them.
 
Hmm, that's a rather interesting solution. Only cities with a transporter would be able to receive the units, only as long as that city has the transporter, and they can only receive one per turn (right?)... You'd be able to transport units between cities on the primary map too, though, wouldn't you?
 
Top Bottom