Page 1 of 1
Conditional Activation and Altering Reinforcement Condition
Posted: Mon Nov 10, 2014 5:57 am
by jomni
1) How can I make units frozen at the start and only activate when enemy units are 4 squares away?
2) How can I make reinforcements to arrive as disrupted (not fresh)?
Re: Conditional Activation and Altering Reinforcement Condit
Posted: Mon Nov 10, 2014 8:31 am
by rbodleyscott
jomni wrote:1) How can I make units frozen at the start and only activate when enemy units are 4 squares away?
This will require scripting. Do you mean friendly or AI units?
2) How can I make reinforcements to arrive as disrupted (not fresh)?
Once again, this will require scripting. You will have to use SetAttrib(id, "MoraleState", 1) for each unit as soon as it arrives.
Re: Conditional Activation and Altering Reinforcement Condit
Posted: Mon Nov 10, 2014 9:59 am
by jomni
Yes. I am prepared to do scripting.
For #1, it applies to a defending side (human or AI) where the units are frozen, until opponent units are near.
Re: Conditional Activation and Altering Reinforcement Condit
Posted: Mon Nov 10, 2014 10:07 am
by rbodleyscott
jomni wrote:Yes. I am prepared to do scripting.
For #1, it applies to a defending side (human or AI) where the units are frozen, until opponent units are near.
There isn't really any easy way of explaining this. There are probably several ways of doing what you want. You are going to need to look at the existing scenario scripts for examples.
For the AI you need to look at some of the historical scenario scripts where AI troops wait until the enemy get close before acting. (Maybe the Wittstock AI cavalry wings?)
For the player side you would need to set the units to Cannot control until the enemy gets close. See the Bicocca scenario script for examples of troops set as Cannot control. MoreScenarioTools.BSF contains various functions that allow you to determine enemy proximity.
Re: Conditional Activation and Altering Reinforcement Condit
Posted: Thu Nov 13, 2014 3:38 am
by jomni
How do you actually identify units? Do they have a unique ID?
Re: Conditional Activation and Altering Reinforcement Condit
Posted: Thu Nov 13, 2014 8:57 am
by rbodleyscott
jomni wrote:How do you actually identify units? Do they have a unique ID?
They do, but it is not fixed until the game actually starts. So it may change if you change any of the units in the scenario.
It is better to assign units to teams in the editor. Then to issue AI orders the those teams.
If you need to assign teams to the player side units (so your scripts can tell the AI teams to react to them or head towards them etc.) you can do so in the editor by holding down the CTRL key when clicking on the unit with the AI Team dialogue open.
Re: Conditional Activation and Altering Reinforcement Condit
Posted: Thu Nov 13, 2014 10:18 am
by jomni
I havent played with the editor that much but if it has a UI to assign teams then that would be great.
Re: Conditional Activation and Altering Reinforcement Condit
Posted: Thu Nov 13, 2014 10:30 am
by rbodleyscott
jomni wrote:I havent played with the editor that muchange but if it has a UI to assign teams then that would be great.
It does. It is the button with cogs on it.
Re: Conditional Activation and Altering Reinforcement Condit
Posted: Wed Jan 28, 2015 7:26 am
by parmenio
rbodleyscott wrote:For the player side you would need to set the units to Cannot control until the enemy gets close. See the Bicocca scenario script for examples of troops set as Cannot control.
I'm planning to make use of the SetCannotControl() function but have a query.
Does that still allow a unit to fire if it has a target within range?
Re: Conditional Activation and Altering Reinforcement Condit
Posted: Wed Jan 28, 2015 8:21 am
by rbodleyscott
parmenio wrote:rbodleyscott wrote:For the player side you would need to set the units to Cannot control until the enemy gets close. See the Bicocca scenario script for examples of troops set as Cannot control.
I'm planning to make use of the SetCannotControl() function but have a query.
Does that still allow a unit to fire if it has a target within range?
It should prevent a shooting order from being issued (along with all other player issued orders). However it should not prevent the unit from shooting automatically as reaction fire or residual shooting. You may need to try it to check.