Page 1 of 1

Cohesion states ?

Posted: Tue May 05, 2020 7:32 pm
by Athos1660
Is it possible to assign cohesion states (disrupted, fragmented) to units in the Scenario Editor ?

Re: Cohesion states ?

Posted: Tue May 05, 2020 7:48 pm
by Paul59
Athos1660 wrote: Tue May 05, 2020 7:32 pm Is it possible to assign cohesion states (disrupted, fragmented) to units in the Scenario Editor ?
No, but you can write a script for it in the scenario.bsf file.

My KYNOSKEPHALAI_197BC scenario has scripts to pinpoint exactly which units I wanted to start Fragmented or Disrupted, but it is often possible to use simpler scripts that affect a whole army or certain unit types.

Re: Cohesion states ?

Posted: Tue May 05, 2020 8:10 pm
by Athos1660
Paul59 wrote: Tue May 05, 2020 7:48 pm
Athos1660 wrote: Tue May 05, 2020 7:32 pm Is it possible to assign cohesion states (disrupted, fragmented) to units in the Scenario Editor ?
No, but you can write a script for it in the scenario.bsf file.

My KYNOSKEPHALAI_197BC scenario has scripts to pinpoint exactly which units I wanted to start Fragmented or Disrupted, but it is often possible to use simpler scripts that affect a whole army or certain unit types.
Thank you very much ! I will look at your scenario and try to adapt the scripts.

"Happy those who can script as they will enter FoG2 heaven" :-)

Re: Cohesion states ?

Posted: Wed May 06, 2020 6:52 am
by rbodleyscott
Athos1660 wrote: Tue May 05, 2020 8:10 pm
Paul59 wrote: Tue May 05, 2020 7:48 pm
Athos1660 wrote: Tue May 05, 2020 7:32 pm Is it possible to assign cohesion states (disrupted, fragmented) to units in the Scenario Editor ?
No, but you can write a script for it in the scenario.bsf file.

My KYNOSKEPHALAI_197BC scenario has scripts to pinpoint exactly which units I wanted to start Fragmented or Disrupted, but it is often possible to use simpler scripts that affect a whole army or certain unit types.
Thank you very much ! I will look at your scenario and try to adapt the scripts.

"Happy those who can script as they will enter FoG2 heaven" :-)
Hmm:

Code: Select all

	id = GetUnitOnTile(29,29);
	SetAttrib(id, "MoraleState", 2);
	SetUnitStatusFlag(id);
	SetAttrib(id, "DisplayMoraleState", 2);
This code does appear to work in this scenario, but in general it really ought to be

Code: Select all

	id = GetUnitOnTile(29,29);
	SetAttrib(id, "MoraleState", 2);
	SetAttrib(id, "DisplayMoraleState", 2);
	SetUnitStatusFlag(id);
otherwise the changed morale state won't show until something causes a fresh status update.

Or, even better

Code: Select all

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

Re: Cohesion states ?

Posted: Wed May 06, 2020 7:19 am
by Athos1660
rbodleyscott wrote: Wed May 06, 2020 6:52 am
Athos1660 wrote: Tue May 05, 2020 8:10 pm
Paul59 wrote: Tue May 05, 2020 7:48 pm

No, but you can write a script for it in the scenario.bsf file.

My KYNOSKEPHALAI_197BC scenario has scripts to pinpoint exactly which units I wanted to start Fragmented or Disrupted, but it is often possible to use simpler scripts that affect a whole army or certain unit types.
Thank you very much ! I will look at your scenario and try to adapt the scripts.

"Happy those who can script as they will enter FoG2 heaven" :-)
Hmm:

Code: Select all

	id = GetUnitOnTile(29,29);
	SetAttrib(id, "MoraleState", 2);
	SetUnitStatusFlag(id);
	SetAttrib(id, "DisplayMoraleState", 2);
This code does appear to work in this scenario, but in general it really ought to be

Code: Select all

	id = GetUnitOnTile(29,29);
	SetAttrib(id, "MoraleState", 2);
	SetAttrib(id, "DisplayMoraleState", 2);
	SetUnitStatusFlag(id);
otherwise the changed morale state won't show until something causes a fresh status update.

Or, even better

Code: Select all

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


Thank you very much !
I will try it ASAP.
That will be a great addition to my testing/Scenarios !

Re: Cohesion states ?

Posted: Wed May 06, 2020 2:27 pm
by Athos1660
I successfully made my first "Scenario" with various cohesion states, thanks to your instruction, RBS's bits of script, Paul's Creation guide about the .bsf file and the Kynoskephalai scenario. That's very nice!!!! Very helpful.

Thanks to both of you :-)