What about Lua Functions?

Voyhkah

Undead
Joined
Apr 25, 2009
Messages
1,444
Location
Earth
Most Traits in Civ IV were made in Python's CvEventManager.py file. There seems to be no similar file, so where are the fuctions that you can attack stuff to like inb CvEventManager? And how do you mod with them?
 
You use something along the lines of:
Events.EndCombatSim.Add( MyOnCombatEnd );

Whenever a Combat ends, a function you've previously defined as follows:
MyOnCombatEnd( m_AttackerPlayer, m_AttackerUnitID, m_AttackerUnitDamage, m_AttackerFinalUnitDamage, m_AttackerMaxHitPoints, m_DefenderPlayer, m_DefenderUnitID, m_DefenderUnitDamage, m_DefenderFinalUnitDamage, m_DefenderMaxHitPoints )
gets called.

However, as far as I can see, until we actually get a decent Lua API reference, it's a real pain in the neck to do much work in Lua for now, since you've no idea what methods/functions there are usable for different objects beyond the ones you can find in the current code.
 
There's a lot we can't do yet. Those function calls from LUA do things we can't see, in code we can't access.
 
Back
Top Bottom