"Freezing" units for a turn.
Moderators: Slitherine Core, BA Moderators
-
Navaronegun
- Captain - Heavy Cruiser

- Posts: 946
- Joined: Sun Sep 22, 2013 5:39 pm
- Location: Arizona, USA -7 GMT
"Freezing" units for a turn.
Does anyone know how to immobilize on map units for a turn? I'm simulating an offensive where one side is surprised, and only a few units can move. Its PBEM, so AI commands are of no use. It would be at the beginning of the scenario, preventing units from moving but releasing units for movement on a later turn.
Thanks,
Nav
Thanks,
Nav
I think the best way to describe our operations to date is that they have violated every recognized principle of war.
General Eisenhower, Supreme Commander Allied Expeditionary Force, on the Tunisian Campaign, 27 DEC 1942.
General Eisenhower, Supreme Commander Allied Expeditionary Force, on the Tunisian Campaign, 27 DEC 1942.
-
Amaris
- Captain - Heavy Cruiser

- Posts: 929
- Joined: Fri Jul 23, 2010 11:08 am
- Location: France
- Contact:
Re: "Freezing" units for a turn.
Well may be with a specific function called on PreBattleSetup() into the scenario .bsf file ?
But this will be set 0 to AP to ALL units of the specified side.
So I you want to have some unit active on the 1st turn, you must re-active them by a code like as:
You must specific the TILE_X and TILE_Y of each unit which is active.
But this will be set 0 to AP to ALL units of the specified side.
So I you want to have some unit active on the 1st turn, you must re-active them by a code like as:
Code: Select all
FUNCTION DISABLE_SIDE(side)
{
int max;
int count;
int unit;
//Set 0 AP TO ALL UNITS
max = GetUnitCount(side);
for (count = 0 ; count < max; count++)
{
unit = GetUnitID(side, count);
if (IsUnitValid(unit) == 1)
{
SetAttrib(unit, "AP", 0);
}
}
// Set BASE AP FOR THE SPECIFIC UNIT
unit = GetUnitOnTile(TILE_X, TILE_Y);
if (IsUnitValid(unit) == 1)
{
SetAttrib(unit, "AP", GetBaseAttrib(unit, "AP));
}
.....
}
“Take care, my friend; watch your six, and do one more roll… just for me.”
-
Navaronegun
- Captain - Heavy Cruiser

- Posts: 946
- Joined: Sun Sep 22, 2013 5:39 pm
- Location: Arizona, USA -7 GMT
Re: "Freezing" units for a turn.
Merci, Amaris.
I think the best way to describe our operations to date is that they have violated every recognized principle of war.
General Eisenhower, Supreme Commander Allied Expeditionary Force, on the Tunisian Campaign, 27 DEC 1942.
General Eisenhower, Supreme Commander Allied Expeditionary Force, on the Tunisian Campaign, 27 DEC 1942.
-
Navaronegun
- Captain - Heavy Cruiser

- Posts: 946
- Joined: Sun Sep 22, 2013 5:39 pm
- Location: Arizona, USA -7 GMT
Re: "Freezing" units for a turn.
Is "(unit)" the Number or the UNITID name from the Squads.CSV,m or is it just "(unit)"?Amaris wrote:Well may be with a specific function called on PreBattleSetup() into the scenario .bsf file ?
But this will be set 0 to AP to ALL units of the specified side.
So I you want to have some unit active on the 1st turn, you must re-active them by a code like as:
You must specific the TILE_X and TILE_Y of each unit which is active.Code: Select all
FUNCTION DISABLE_SIDE(side) { int max; int count; int unit; //Set 0 AP TO ALL UNITS max = GetUnitCount(side); for (count = 0 ; count < max; count++) { unit = GetUnitID(side, count); if (IsUnitValid(unit) == 1) { SetAttrib(unit, "AP", 0); } } // Set BASE AP FOR THE SPECIFIC UNIT unit = GetUnitOnTile(TILE_X, TILE_Y); if (IsUnitValid(unit) == 1) { SetAttrib(unit, "AP", GetBaseAttrib(unit, "AP)); } ..... }
I think the best way to describe our operations to date is that they have violated every recognized principle of war.
General Eisenhower, Supreme Commander Allied Expeditionary Force, on the Tunisian Campaign, 27 DEC 1942.
General Eisenhower, Supreme Commander Allied Expeditionary Force, on the Tunisian Campaign, 27 DEC 1942.
-
jcb989
- Colonel - Fallschirmjäger

- Posts: 1423
- Joined: Fri Nov 05, 2010 12:02 am
- Location: Bradenton, Florida
Re: "Freezing" units for a turn.
That will be tough, if anything moved. lol.Amaris wrote:You must specific the TILE_X and TILE_Y of each unit which is active.
I was thinking about this type of code for a Pearl Harbor scenario for your Pacific mod.
Instead I suppose the right thing to do is surround most of the ships with coastal water, so they can't move..
-
Navaronegun
- Captain - Heavy Cruiser

- Posts: 946
- Joined: Sun Sep 22, 2013 5:39 pm
- Location: Arizona, USA -7 GMT
Re: "Freezing" units for a turn.
That does sound tough. It'd have to be units which have zero chance of contact. Unless there is an "if" for "unit fired upon" or "has LOS of enemy unit"?jcb989 wrote:That will be tough, if anything moved. lol.Amaris wrote:You must specific the TILE_X and TILE_Y of each unit which is active.
I was thinking about this type of code for a Pearl Harbor scenario for your Pacific mod.
Instead I suppose the right thing to do is surround most of the ships with coastal water, so they can't move..
I think the best way to describe our operations to date is that they have violated every recognized principle of war.
General Eisenhower, Supreme Commander Allied Expeditionary Force, on the Tunisian Campaign, 27 DEC 1942.
General Eisenhower, Supreme Commander Allied Expeditionary Force, on the Tunisian Campaign, 27 DEC 1942.
-
Amaris
- Captain - Heavy Cruiser

- Posts: 929
- Joined: Fri Jul 23, 2010 11:08 am
- Location: France
- Contact:
Re: "Freezing" units for a turn.
Well my script is to freeze the units on the start of the battles only. 
“Take care, my friend; watch your six, and do one more roll… just for me.”
-
LandMarine47
- Major-General - Tiger I

- Posts: 2490
- Joined: Sun Oct 28, 2012 10:44 pm
- Location: Texas
Re: "Freezing" units for a turn.
Pearl Harbor? I doubt the US would win that one.... Too many bombers.... Unless we have (unrealistic) fighter escorts or AA guns nearby! Best that be a Japanese scenario
-
jcb989
- Colonel - Fallschirmjäger

- Posts: 1423
- Joined: Fri Nov 05, 2010 12:02 am
- Location: Bradenton, Florida
Re: "Freezing" units for a turn.
Well I was thinking something for single player, lol. something with a goal of how many battleships get sunk, I figured have DD protecting them in harbor.
-
LandMarine47
- Major-General - Tiger I

- Posts: 2490
- Joined: Sun Oct 28, 2012 10:44 pm
- Location: Texas
Re: "Freezing" units for a turn.
I doubt the DD would save those Battleships! But you never know what an American is capable ofjcb989 wrote:Well I was thinking something for single player, lol. something with a goal of how many battleships get sunk, I figured have DD protecting them in harbor.