Page 1 of 1

Access Unit Attributes

Posted: Mon Jul 20, 2015 6:34 pm
by Marching Thru Georgia
In the AI code, is there a way to access a unit's attributes, such as experience, closed order proficiency, etc.?

Re: Access Unit Attributes

Posted: Mon Jul 20, 2015 7:49 pm
by mitra76
No you cannot access them directly, you can access to the values generated by them in unitattributes.csv

Re: Access Unit Attributes

Posted: Mon Jul 20, 2015 8:33 pm
by Marching Thru Georgia
What function accesses column B of unitattributes for the different attributes?

Re: Access Unit Attributes

Posted: Mon Jul 20, 2015 8:59 pm
by mitra76
you access using int GetMod ( int type ) with the enum EGame which represents the column from D and successives, the column B is not accessible. The function returns the cumulate value of the column

Re: Access Unit Attributes

Posted: Mon Jul 20, 2015 9:07 pm
by Marching Thru Georgia
That's not very useful. I request a function be created that can access a unit's attributes directly. I want to be able to allow or prohibit units of certain skill levels from doing things such as changing from column to line while under fire.

Re: Access Unit Attributes

Posted: Mon Jul 20, 2015 9:35 pm
by mitra76
I'll ask to Norb if it is possible