megabearsfan
Prince
Mirror on 2K Forums: http://forums.2kgames.com/showthread.php?216681-Unit-Promotion()-LUA-code-example.
Hi, I am trying to add a new promotion to the game and need to add functionality that is not supported. I was hoping to be able to do this by hooking into the Unit
romote(PromotionType, LeaderUnitId) LUA function.
Basically, I want to move the "Insta-Heal" promotion to require Military Science as a prerequisite, and replace that promotion with a similar, but weaker promotion (between 10-25 HP). Currently, the InstaHeal field of the UnitPromotions table is a simple bool (all-or-nothing), so I was hoping to hook into an event that is triggered when a unit takes a promotion (which I assume is Unit
romote()). I could then check whether the PromotionType is the regular insta-heal or the minor-heal and then grant the necessary amount of HP.
Does anyone know of an example of the Unit
romotion() function in any of the LUA code? I've been looking for it, but I haven't found it. I want to make sure that I don't overwrite any necessary behavior of that function, and would like the regular function's definition as reference.
I found the wiki page: http://modiki.civfanatics.com/index.php/Unit.Promote_(Civ5_API). But it's not terribly helpful :/
Thanks in advance!
Hi, I am trying to add a new promotion to the game and need to add functionality that is not supported. I was hoping to be able to do this by hooking into the Unit

Basically, I want to move the "Insta-Heal" promotion to require Military Science as a prerequisite, and replace that promotion with a similar, but weaker promotion (between 10-25 HP). Currently, the InstaHeal field of the UnitPromotions table is a simple bool (all-or-nothing), so I was hoping to hook into an event that is triggered when a unit takes a promotion (which I assume is Unit

Does anyone know of an example of the Unit

I found the wiki page: http://modiki.civfanatics.com/index.php/Unit.Promote_(Civ5_API). But it's not terribly helpful :/
Thanks in advance!