Sid Meier's Civilization V

Sid Meier's Civilization V

Unit Created Event [snippet for mod makers]
5 Comments
Machiavelli  [author] 4 Apr, 2015 @ 9:27pm 
Sadly GetGameTurnCreated() is insufficient to ensure that the event only fires once per unit. A unit that was created and embarked in the same turn (ei purchased landshnek) would generate SerialEventUnitCreated twice. The serial event also fires if a human reloads the game. Also, upgrading a unit is implemented as deleting and spawning another unit, which would have a misleading creation turn.
qqqbbb 1 Apr, 2015 @ 7:37pm 
Instead of addong promotion to every unit you can use GetGameTurnCreated().
Machiavelli  [author] 29 May, 2014 @ 7:18am 
I am the same machiavelli on CivFanatics (technically I'm "Machiavelli24" on CivFanatics). I haven't posted this code on there yet. I want to get my religion snippets on the workshop first.
lshipp 29 May, 2014 @ 6:36am 
NIce. I've subscribed to both of your these. Wondered if you had posted them to Civfanatics. I'm assuming you're the same Machiavelli as over there.
DJSHenninger 29 May, 2014 @ 2:06am 
These mods sound really awesome for people like I who absolutely know nothing about lua! Thanks :D Hope you make more of these!