Commanding a single unit

Moderators: rbodleyscott, Slitherine Core, Gothic Labs

Post Reply
edward77
Sergeant - Panzer IIC
Sergeant - Panzer IIC
Posts: 188
Joined: Wed Nov 10, 2010 9:11 pm

Commanding a single unit

Post by edward77 » Wed Jul 26, 2017 7:29 pm

Is it possible to give a single unit (not team) a command in the Script BSF file?
eg using SetCannotControl(id, value). The id values run from 0 upto 64(max) but how do they relate to the IDs in the squad file?

pipfromslitherine
Site Admin
Site Admin
Posts: 8889
Joined: Wed Mar 23, 2005 10:35 pm

Re: Commanding a single unit

Post by pipfromslitherine » Wed Jul 26, 2017 7:59 pm

Anywhere you see a unit id required they are the id of a specific unit. This is not related to the squads file but to the specific unit on the map. You generally get a unit id using GetUnitID as they are not just [0,63] because they vary by side.

Cheers

Pip
follow me on Twitter here

edward77
Sergeant - Panzer IIC
Sergeant - Panzer IIC
Posts: 188
Joined: Wed Nov 10, 2010 9:11 pm

Re: Commanding a single unit

Post by edward77 » Wed Jul 26, 2017 9:04 pm

Thanks Pip for the quick reply. Yes its 0 to 63 max. But how do I know the id of a particular unit? I know the unit name, what side and what team each unit is in but how can I identify which one is 10 or which one is 17?

rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 21949
Joined: Sun Dec 04, 2005 6:25 pm

Re: Commanding a single unit

Post by rbodleyscott » Thu Jul 27, 2017 12:34 pm

edward77 wrote:Thanks Pip for the quick reply. Yes its 0 to 63 max. But how do I know the id of a particular unit? I know the unit name, what side and what team each unit is in but how can I identify which one is 10 or which one is 17?
There isn't an easy way of doing this. If you are trying to the stop the player from controlling it in the initial turns of the scenario, the easiest way to do it would be

id = GetUnitOnTile(x, y);

if you know the values for x and y that represent its starting location.
Richard Bodley Scott

Image

Post Reply

Return to “Scenario Design”