The Great Apple
Big Cheese
Anybody happen to know?
The Great Apple said:I mean when you upgrade a unit. For example; a warrior to a swordsman.
Good, I did some playing around with the code you sent me and I had to generalize it in places, merged it with some of my own code, etc.The Great Apple said:Fantastic! Thanks.
Final testing - sounds scary! How is the AI holding up?
Hmmm, does this mean that unit IDs don't stay constant on upgrades?Belizan said:This has already been answered, but I just thought I'd add in that upgrades and captures are done by the engine the same way we do them. Clone and delete. The cloning process triggers onUnitCreated.
The Great Apple said:Hmmm, does this mean that unit IDs don't stay constant on upgrades?
TheLopez said:Nope, unit IDs do not stay constant on upgrades. QUOTE]
This is really, really bad. I think this will break several of my mods.This means that my Kill List mod will not be able to keep the list of unit kills after the unit upgrades.
![]()
Is there any way around this?
Roger Bacon
Right. That went over my head a little bit. I'm not entirely sure what a mapping is, and I'm not entirely sure how you'd put a dictionary in the CyGame objectBelizan said:Sure, make a mapping, like the filesystem tracks files.
Put a dictionary in the CyGame object that tracks ID migration. Track it by hooking the unit upgrade related events. Then just do look ups when you want to walk the ID history of a unit.
Belizan said:Sure, make a mapping, like the filesystem tracks files.
Put a dictionary in the CyGame object that tracks ID migration. Track it by hooking the unit upgrade related events. Then just do look ups when you want to walk the ID history of a unit.
RogerBacon said:Could you explain that a little more please? Sure enough, my kill list mod (http://forums.civfanatics.com/showthread.php?t=160977) loses track of a unit once it upgrades. I'd like to take a crack at fixing it but I need a little more info.
Roger Bacon