Page 1 of 1

Making an army's team all disrupted at the start of a battle . . .

Posted: Thu Jul 21, 2022 1:45 pm
by stockwellpete
Sorry, I would have sent this by e-mail but it is chewing up the format. I have 5 units in the left flank of the Lancastrian army at Hedgeley Moor, who I want to start as "disrupted" because their morale was very poor. Looking at an old example from an ancient Greek battle that I had for some reason, I think I have to put this (below) in the BSF file. The only thing that I know is definitely wrong are the 2's at the end of the line in Morale State and UpdateDisplayMoraleState. What is the number for "disrupted"? Is it 1? So should I change those 10x2's and replace them all with 1's? Thanks.


FUNCTION CustomiseUnits()
{
int i;
int id;
int starting_strength; // starting strength - percent of full base unit strength

int morale;

// Set Lancastrian bill/longbowmen Disrupted
id = GetUnitOnTile(27,35);
SetAttrib(id, "MoraleState", 2);
UpdateDisplayMoraleState(id, 2);

id = GetUnitOnTile(24,35);
SetAttrib(id, "MoraleState", 2);
UpdateDisplayMoraleState(id, 2);


// Set Lancastrian billmen Disrupted
id = GetUnitOnTile(26,35);
SetAttrib(id, "MoraleState", 2);
UpdateDisplayMoraleState(id, 2);

// Set Lancastrian men-at-arms Disrupted
id = GetUnitOnTile(25,35);
SetAttrib(id, "MoraleState", 2);
UpdateDisplayMoraleState(id, 2);

// Set Lancastrian levies Disrupted
id = GetUnitOnTile(23,35);
SetAttrib(id, "MoraleState", 2);
UpdateDisplayMoraleState(id, 2);

// Reskin armies to randomly use available variant textures. If both sides have the same unit type, the two sides will use different variant textures for that unit if more than 1 texture exists.
// Comment out the two lines below if you don't want variant textures to be automatically applied.
// If you want to reverse which side gets which set of variant textures, change the second parameter to 1. This is useful to make the same army use the same texture set in reversed scenarios.
ReSkinArmy(0, 0);
ReSkinArmy(1, 0);

Re: Making an army's team all disrupted at the start of a battle . . .

Posted: Thu Jul 21, 2022 3:20 pm
by stockwellpete
Pressed ahead and the BSF file worked Ok. Then I changed the 2's to 1's and that worked OK to make units "disrupted". Now I realise I can adjust any unit's starting state by using variations of that basic set-up. All good. :D

Re: Making an army's team all disrupted at the start of a battle . . .

Posted: Fri Jul 22, 2022 5:35 am
by rbodleyscott
Glad you sorted it.

Yes, 0 = steady, 1 = disrupted, 2 = fragmented, 3 = routed, 5 = destroyed/dispersed.