Ack! ToT Events problem

MikeLynch

Just a Baker Street Muse
Joined
Oct 5, 2003
Messages
540
Location
The Bering Isthmus
Background: in my mod, when a nation builds the Great Library, a unique unit (Alexander the Great) spawns in that nation's capital.

So I'm playing my modded Test of Time, King level, and as is customary at that level, there's a race to complete certain Wonders. I commence the Great Library after noticing that one or two other nations have started it. On the next turn, the French *change projects* from something to Great Library, and immediately after I get that message, I get my custom event message saying "The construction of the Great Library gives its owner the unique Alexander the Great unit."

My immediate reaction is Ack!, No!, and How?, but then I got to thinking. I remembered seeing an erroneous Alex message before, in bizarre circumstances I can't recall, but it hadn't happened for a while. So I bought the Great Library during that turn -- and got it the next turn, complete with the message "The French have abandoned their great project: the Great Library."

The horrific part? I did not get Alexander. It is as if by merely beginning the GLib, the French got him. And I'm not sure if they did, b/c I foolishly did not bother to cheat at the time and see where he was; I just checked and he's not apparently there, but he could have been lost at sea or killed (there's supposed to be a UnitKilled message for Alex too, but I'm not sure of anything anymore).

Here's my events.txt code -- am I doing something wrong?
Code:
@IF
CITYPRODUCTION
builder=Anybody
improvement=44
@THEN
JUSTONCE
CreateUnit
owner=TriggerReceiver
unit=Alexander the Great
veteran=No
homecity=none
count=1
InCapital
locations
endlocations
TEXT
The construction of the Great Library gives 
its owner the unique Alexander the Great unit.
endtext
@ENDIF
 
Perhaps try putting the 'InCapital' line after the 'locations' line.

Also try putting the text after the JUSTONECE line.

Aside from that it should work; I've never used the TriggerReceiver wildcard that way before so I can't confirm.

A few questions:

Have you used Delevent?

Is the improvement index number correct (i.e. is 44 the Great Library slot?

Has the event ever worked in the past?

Have you tried the same event without the wildcard (i.e. have a seperate CityProduction event for each civ; civ name as owner and builder values)?

Have you tried the event using a different improvement as the trigger (also doing the same test with another improvement)?

Have you tried without the CreateUnit action (i.e. text action only)?

Have you tried the event using map coordinates instead?

Could be a bug; some part of the macro code conflicts with that improvement since the GL already includes a hard-coded event (i.e. free tech owned by 2 civs).

Is the Alexander unit type in the Musketeer or Knight slot?

Is unit ownership flagged for all civs (i.e. advanced rules)?
 
Perhaps try putting the 'InCapital' line after the 'locations' line.
IIRC the book says not to do this. But it's worth a try.

Also try putting the text after the JUSTONECE line.
That just might be it. Definitely worth a try.

Have you used Delevent?
No, what's that?

Is the improvement index number correct (i.e. is 44 the Great Library slot?
Has the event ever worked in the past?
Yes and yes.

Have you tried the same event without the wildcard (i.e. have a seperate CityProduction event for each civ; civ name as owner and builder values)?
I haven't, but as that approach is work-intensive I'm saving it for my last-ditch effort. :)

Have you tried the event using a different improvement as the trigger (also doing the same test with another improvement)?
I have three other wonders that do the same thing. Even in the game in which this error most recently popped up, it worked fine for King Richard's Crusade (which spawns a special unit in the capital, exactly the same as GLib).

Have you tried without the CreateUnit action (i.e. text action only)?
You mean breaking it up into two actions? Also worth a try, but no, I have not tried it.

Have you tried the event using map coordinates instead?
A nearly identical event, yes -- Darwin's Voyage spawns the HMS Beagle somewhere out in the open sea (I tried to make it spawn near the Int'l Date Line, so that it wouldn't get stuck in an inland sea, though that has happened in the past, necessitating wars and such to get it out :) )

Could be a bug; some part of the macro code conflicts with that improvement since the GL already includes a hard-coded event (i.e. free tech owned by 2 civs).
Hey, you're right. There may be a connection. But the weird thing is that this specific event, the GL-Alexander thing, had worked before. This IS the first time I've tested it at King level, though...

Is the Alexander unit type in the Musketeer or Knight slot?
Nope, it's in one of the EXTRAs.

Is unit ownership flagged for all civs (i.e. advanced rules)?
You mean "tribe may build"? It's set so no tribe can build it; it just gets spawned. Same as the other "wonder units."
 
JUSTONCE line: technically that shouldn't be a problem since all it's meant to do is prevent the event from being triggered more than once.

Delevent: This may be the cause (especially if the event has worked in the past). It's a tiny program that clears the events header (i.e. 'embedded' events; program reads events from previous save rather than new Events.txt). Just drag the .SAV file over to Delevent.exe icon and you will get a prompt telling you that events header cleared (or something like that). If there are no embedded events, the prompt will read, 'No events header found.' You can find this program in your Civ2 main directory I think (if not, you can get it from a scen or someone can UL it for you).

Try the same event without the wildcard with one civ (just copy the event and replace the 'owner' and 'builder' parameter values to your civ's name--if it triggers with one civ than it should trigger with all civs).

You can break it into two actions but I meant just delete the CreateUnit part but keep the text (so you know the event has triggered when you get the text pop-up).

Use Delevent before anything else.
 
Yoshi's just about covered everything, so I'll just nitpick. ;):D

yoshi said:
Perhaps try putting the 'InCapital' line after the 'locations' line.
I'm pretty confident that'll send poor old Alexander to coordinates (0,0). The game will get null values when it tries to read the first location.

yoshi said:
Also try putting the text after the JUSTONECE line.
I can't see how this will make a difference. Within a single event, the Text action is executed after CreateUnit, regardless of your order.

yoshi said:
It's a tiny program that clears the events header...
Actually, it'll look for the events header in the file and wipe everything from this point onwards.
 
Actually, it'll look for the events header in the file and wipe everything from this point onwards.
That's what I meant...must have been a typo...(cough). ;)
 
Back
Top Bottom