Conditional Activation and Altering Reinforcement Condition

Moderators: rbodleyscott, Slitherine Core, Gothic Labs

Post Reply
jomni
Sengoku Jidai
Sengoku Jidai
Posts: 1394
Joined: Thu Dec 03, 2009 1:20 am

Conditional Activation and Altering Reinforcement Condition

Post 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)?
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28294
Joined: Sun Dec 04, 2005 6:25 pm

Re: Conditional Activation and Altering Reinforcement Condit

Post 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.
Richard Bodley Scott

Image
jomni
Sengoku Jidai
Sengoku Jidai
Posts: 1394
Joined: Thu Dec 03, 2009 1:20 am

Re: Conditional Activation and Altering Reinforcement Condit

Post 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.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28294
Joined: Sun Dec 04, 2005 6:25 pm

Re: Conditional Activation and Altering Reinforcement Condit

Post 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.
Richard Bodley Scott

Image
jomni
Sengoku Jidai
Sengoku Jidai
Posts: 1394
Joined: Thu Dec 03, 2009 1:20 am

Re: Conditional Activation and Altering Reinforcement Condit

Post by jomni »

How do you actually identify units? Do they have a unique ID?
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28294
Joined: Sun Dec 04, 2005 6:25 pm

Re: Conditional Activation and Altering Reinforcement Condit

Post 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.
Richard Bodley Scott

Image
jomni
Sengoku Jidai
Sengoku Jidai
Posts: 1394
Joined: Thu Dec 03, 2009 1:20 am

Re: Conditional Activation and Altering Reinforcement Condit

Post by jomni »

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.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28294
Joined: Sun Dec 04, 2005 6:25 pm

Re: Conditional Activation and Altering Reinforcement Condit

Post 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.
Richard Bodley Scott

Image
parmenio
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 105
Joined: Sun Jan 10, 2010 5:41 pm

Re: Conditional Activation and Altering Reinforcement Condit

Post 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?
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28294
Joined: Sun Dec 04, 2005 6:25 pm

Re: Conditional Activation and Altering Reinforcement Condit

Post 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.
Richard Bodley Scott

Image
Post Reply

Return to “Scenario Design”