http://forums.revora...86
Getting rid of RACEcustomstats.ai and its relations, and getting a proper custom stats file, and related functions, to get the data in an updated version of unitstats.ai would be great.
Basically, things like troop cost, unit max's and bases, immunity to morale damage, and other things excedrin added to his sample code would be great.
A few more to allow better commander attachment and unit stat pairing off, also allows the race code to be continually moved to the stats files.
Basically, there are several reason for attempting this:
- Allows one place for unit stats to be created and tweaked by the user to affect how the AI uses that unit
- Removes the requirements of hardcoding things into the AI files, ie: anything which is "squad_" in strings anywhere in the /core AI folder!
- This allows custom races to be added and perform at full functions straight away, with just a few variables.
- Allows better use of commanders, among other things, since they'd be able to automatically ignore some units to attach to (eg: getting a space marine squad with lots of plasma isn't a good idea for a melee bodyguard), as well as knowing if a unit has a comparable HTH attack - since for example, chaos space marines and cultists both perform well enough in melee for melee commanders to use them to attack with.
- Could mean a much easier and quicker way to sort out some things the AI has trouble with, in relation to units.
- Return any one of the AI stats, and enemy units should be passable too. Perhaps a function for each one.
[list] - EG: self.custom:GetCanCapture() - gets and returns, if there, able_to_capture (boolean)
- someone.custom:GetTrooperCost() - gets and returns, if there, troopercost (integer)
- ally_unit.custom:GetMoraleImmune() - gets and returns, if there, moraleimmune (boolean)
- ...and so on
Would need some way to make sure this works with all enemy and allied units...
...so since I'm still not 100% sure on the workings of functions (ie: started a few days ago on it!) and the strange table-based storage of functions and how they work when not referencing self, especially with custom functions. Still might be able to get somewhere though