The UnitDef seems to have the unit's entire stats- everything in the .fbi as a part of it, and all the values are filled in by the UnitDefHandler, which in turn utilizes the SunParser to get the necessary info (why the Sun Parser as name?) whereas the Unit.h has all the objects that make the unit function, with the respective calls to the cob handlers and such when necessary.
I am particulary confused by this bit of code:
Code: Select all
CUnit::CUnit(const float3 &pos,int team,UnitDef* unitDef)
: CSolidObject(pos),
unitDef(unitDef),
maxHealth(100),
health(100),
power(100),
experience(0),
If you're wondering why i'm asking this, its because I've spent the last few hours trying to get MoveRate(n) to function properly. I've modified Unit(.ccp/.h), UnitDefHandler(.cpp), CobFile(.h) and some others to get it working, and I'm almost done... roadblocks left are trying to figure out what that above snippet is doing, trying to figure out the current speed of the unit without getting too hacky, and something else.. can't think. I'll get some sleep and get back to you.
Sleep. Tired.