das123 wrote: ↑Sun Jun 09, 2019 7:24 pm
I'm changing the MoraleStatus of a couple of units by setting the attribute in the CustomiseUnits() function...
Code: Select all
FUNCTION CustomiseUnits()
{
int i;
int id;
int starting_strength; // starting strength - percent of full base unit strength
// Custom MoraleStatus
id = GetUnitID(1,1);
if (id != -1)
{
SetAttrib(id, "MoraleState", 1); // Disrupted
}
id = GetUnitID(1,2);
if (id != -1)
{
SetAttrib(id, "MoraleState", 2); // Fragmented
}
...
It is working in terms of the game calculating the battle outcomes but the banners or status don't display correctly on the opening turn. Is there another function I need to run to refresh the displayed status for the first turn? After the first turn they display correctly.
I had this same problem with my Kynoskephai scenario, which you can download from the game. I solved it like this:
// Set Thracians Fragmented
id = GetUnitOnTile(31,31);
SetAttrib(id, "MoraleState", 2);
SetUnitStatusFlag(id);
SetAttrib(id, "DisplayMoraleState", 2);
So if you put a SetUnitStatusFlag and SetAttrib line for each unit it will force the game to display the correct banner.
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.
Field of Glory II Medieval Scenario Designer.
FOGII TT Mod Creator
Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.