Conditional Activation and Altering Reinforcement Condition
Moderators: rbodleyscott, Slitherine Core, Gothic Labs
Conditional Activation and Altering Reinforcement Condition
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)?
2) How can I make reinforcements to arrive as disrupted (not fresh)?
-
- Field of Glory 2
- Posts: 28294
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Conditional Activation and Altering Reinforcement Condit
This will require scripting. Do you mean friendly or AI units?jomni wrote:1) How can I make units frozen at the start and only activate when enemy units are 4 squares away?
Once again, this will require scripting. You will have to use SetAttrib(id, "MoraleState", 1) for each unit as soon as it arrives.2) How can I make reinforcements to arrive as disrupted (not fresh)?
Richard Bodley Scott


Re: Conditional Activation and Altering Reinforcement Condit
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.
For #1, it applies to a defending side (human or AI) where the units are frozen, until opponent units are near.
-
- Field of Glory 2
- Posts: 28294
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Conditional Activation and Altering Reinforcement Condit
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.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.
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.
Richard Bodley Scott


Re: Conditional Activation and Altering Reinforcement Condit
How do you actually identify units? Do they have a unique ID?
-
- Field of Glory 2
- Posts: 28294
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Conditional Activation and Altering Reinforcement Condit
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.jomni wrote:How do you actually identify units? Do they have a unique ID?
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.
Richard Bodley Scott


Re: Conditional Activation and Altering Reinforcement Condit
I havent played with the editor that much but if it has a UI to assign teams then that would be great.
Last edited by jomni on Thu Nov 13, 2014 10:35 am, edited 1 time in total.
-
- Field of Glory 2
- Posts: 28294
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Conditional Activation and Altering Reinforcement Condit
It does. It is the button with cogs on it.jomni wrote:I havent played with the editor that muchange but if it has a UI to assign teams then that would be great.
Richard Bodley Scott


Re: Conditional Activation and Altering Reinforcement Condit
I'm planning to make use of the SetCannotControl() function but have a query.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.
Does that still allow a unit to fire if it has a target within range?
-
- Field of Glory 2
- Posts: 28294
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Conditional Activation and Altering Reinforcement Condit
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.parmenio wrote:I'm planning to make use of the SetCannotControl() function but have a query.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.
Does that still allow a unit to fire if it has a target within range?
Richard Bodley Scott

