Switching which side moves first

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Switching which side moves first

Post by GottaLove88s »

Is there an easy way to switch which side starts first in an MP scenario?
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Switching which side moves first

Post by pipfromslitherine »

I don't think so - the turn sequence is set up by the server.

Cheers

Pip
follow me on Twitter here
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Switching which side moves first

Post by GottaLove88s »

Sorry, I meant if I've written a scenario where the Soviets are side 0 (from the .BAM), but I'd like the Germans to go first, is there a simple line of code I can add somewhere to make this happen?

I don't want to do anything clever, like giving the two players a switchable option in game...
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Switching which side moves first

Post by pipfromslitherine »

The problem is that the turn would still go back and forth in the same order. So you could potentially skip it (not sure if SkipFirstPlayerTurn works in MP to be honest) but they would still have to get and return the turn for it to work, if that makes sense.

Cheers

Pip
follow me on Twitter here
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Switching which side moves first

Post by enric »

If I remember well, the SkipFirstPlayerTurn() only works if the scenario has a deploy phase.
Richcat
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 219
Joined: Sun Nov 07, 2010 10:09 pm

Re: Switching which side moves first

Post by Richcat »

I was looking at this the other day to save having to redo everything, and came across this in Pike and Shot. viewtopic.php?f=319&t=53432
I have tried in BA1 & 2 it but not got it to work correctly yet :wink:
The units are specified as side 0 or side 1 in the .BAM file - you can in fact change those unit's sides manually. If you use search and replace, you have to be very careful how you do it, and you cannot do "replace all" without messing something up, but by searching for "_0_" you can change the side 0 units to side 2, then search for "_1_" to convert the side 1 units to side 0, then search for "_2_" to convert the side 2 units to side 1. You also need to change the Unitcount sides. You must not use "replace all" because there will be other instances of these search strings in the .BAM file.
Cheers
Richcat
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Switching which side moves first

Post by GottaLove88s »

Ouch!

I wonder, is 'side' coded for each unit somewhere?

I don't suppose it's possible to write a one-off loop, just to go through every single unit at the start of the game, recoding each one for the opposite side...?
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Switching which side moves first

Post by pipfromslitherine »

There isn't anything stopping you from doing that I guess! Not sure what else would be incorrect at that point though. Give it a try!

Cheers

Pip
follow me on Twitter here
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Switching which side moves first

Post by GottaLove88s »

If I did that, would I also have to tell it that the 'new' side 0 is now German?
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Richcat
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 219
Joined: Sun Nov 07, 2010 10:09 pm

Re: Switching which side moves first

Post by Richcat »

The only thing I have found is that doesn't work so far is the icons above each unit, which change to allies above axis and vice versa.
Still having a try might found out how to do it.. :wink:
Cheers
Richcat
enric
Brigadier-General - 8.8 cm Pak 43/41
Brigadier-General - 8.8 cm Pak 43/41
Posts: 1855
Joined: Sun May 15, 2011 8:47 am

Re: Switching which side moves first

Post by enric »

In BA1 I made several scenarios "CHESS", that US units play as German, and German units play as USA, maybe this may help. They are in Scenarios by Enric.
Post Reply

Return to “Battle Academy 2: Modders Corner”