Page 1 of 1
How to change army in Editor?
Posted: Wed Oct 22, 2014 4:33 pm
by NickDirlewanger
Now I'm trying to use Editor to make alternative campaigns to play from another side and I found one trouble - when for example I copy Italian wars campaign and start to Edit its Battle of Bicocca I realize that despite what army I chose for 0 and 1 sides (via portraits up to the unit list) they wtill have the same units as in original scenario i.e. "French/italian pikeneers" are available only for side 0 and some units like turkish Akinci (I don't need them in Bicocca but they are first in the list) only for side 1.
How could it be fixed? Maybe I change nations for both sides not correctly?
UPD: I found another bug - after copying campaign I gave it another folder name (AltItalian) and another map for campaign list (Alt Italian Wars) but in the list is is shown as Italian Wars, so I have two campaigns with same name in it.
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 4:48 pm
by rbodleyscott
If you want the Side1 unit list on side0 and vice versa, you have to create the scenario with a Sides.txt file containing
[Axis]
string IDS_SIDE1
DECOR 0
DECORSHIELDMASK 1985
UICOLOURINDEX 0
SKIRMISHFLAGS 1
[Allies]
string IDS_SIDE0
DECOR 0
DECORSHIELDMASK 65535
SKIRMISHFLAGS 0
[Test]
string IDS_SIDE2
DECOR 0
DECORSHIELDMASK 65535
SKIRMISHFLAGS 0
in the campaign folder.
This will reverse the normal unit sets in the editor.
Note that this only works when you start a brand new scenario. (Otherwise it becomes a bit more complicated as you have to edit the .BAM file directly in a text editor).
(Excuse the [Axis] and [Allies] tags for the two factions - they are about the only WW2 thing hard-coded into the engine.)
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 4:54 pm
by NickDirlewanger
So you mean it's much harder just to edit existing scenario and reverse sides?
If I don't want to change side of units already on map but want to make new "french" side to place french units and so on.
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 5:06 pm
by rbodleyscott
NickDirlewanger wrote:So you mean it's much harder just to edit existing scenario and reverse sides?
Well it isn't that hard.
Open a copy of the .BAM file in a text editor.
Replace all "_0_" with "_2_"
Replace all "_1_" with "_0_"
Replace all "_2_" with "_1_"
Swap the values in SIDEID0 and SIDEID1
And voila, the scenario sides are reversed.
But, of course, you will need to write completely new AI....
If I don't want to change side of units already on map but want to make new "french" side to place french units and so on.
French units are side0. If you want to make then Side1 in the Editor, you have to start a new scenario with Sides.txt in the campaign folder as I explained above.
It probably doesn't have to be a brand new scenario though. If you take the old scenario and delete all of the units, using the reveresed sides.txt file will allow you to add new reversed units in the editor. You can change the sideIDs in the editor.
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 5:10 pm
by NickDirlewanger
rbodleyscott wrote:NickDirlewanger wrote:So you mean it's much harder just to edit existing scenario and reverse sides?
Well it isn't that hard.
Open a copy of the .BAM file in a text editor.
Replace all "_0_" with "_2_"
Replace all "_1_" with "_0_"
Replace all "2__" with "_1_"
Swap the values in SIDEID0 and SIDEID1
And voila, the scenario sides are reversed.
But, of course, you will need to write completely new AI....
If I don't want to change side of units already on map but want to make new "french" side to place french units and so on.
French units are side0 already.
Of course, I understand about AI. Could you recommend text editor for BAM? Notepad gives some unreadable mess without any division like on columns.
And i was not able to find "2__" - did you mean "_2_"?
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 5:11 pm
by rbodleyscott
NickDirlewanger wrote:Could you recommend text editor for BAM?
I use UltraEdit.
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 5:14 pm
by NickDirlewanger
rbodleyscott wrote:NickDirlewanger wrote:Could you recommend text editor for BAM?
I use UltraEdit.
Thank you!
And "2__" you said above is "_2_"?

Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 5:15 pm
by rbodleyscott
NickDirlewanger wrote:rbodleyscott wrote:NickDirlewanger wrote:Could you recommend text editor for BAM?
I use UltraEdit.
Thank you!
And "2__" you said above is "_2_"?

Yes, sorry.
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 6:25 pm
by pipfromslitherine
Notepad++ is the tool I use. See here in the docs:
http://www.slitherinebravo.net/GameWiki ... gine#tools
Cheers
Pip
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 6:36 pm
by NickDirlewanger
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 8:03 pm
by NickDirlewanger
rbodleyscott wrote:NickDirlewanger wrote:So you mean it's much harder just to edit existing scenario and reverse sides?
Well it isn't that hard.
Open a copy of the .BAM file in a text editor.
Replace all "_0_" with "_2_"
Replace all "_1_" with "_0_"
Replace all "_2_" with "_1_"
Swap the values in SIDEID0 and SIDEID1
And voila, the scenario sides are reversed.
But, of course, you will need to write completely new AI....
If I don't want to change side of units already on map but want to make new "french" side to place french units and so on.
French units are side0. If you want to make then Side1 in the Editor, you have to start a new scenario with Sides.txt in the campaign folder as I explained above.
After I do manipulations with replacing I can't open battle (Ravenna now) in Editor - crash with:
---------------------------
ERROR
---------------------------
GetTile(unit->mTile.x,unit->mTile.y).unit == NULL && "Trying to enter an occupied tile"
.\BattleMap.cpp(3769)
---------------------------
ОК
---------------------------
I replaced everything correctly.
rbodleyscott wrote:It probably doesn't have to be a brand new scenario though. If you take the old scenario and delete all of the units, using the reveresed sides.txt file will allow you to add new reversed units in the editor. You can change the sideIDs in the editor.
Could you explain it? I need to open existing copied battle, remove all units from map, then change campaign's sides.txt to reversed one, open battle and place new units?
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 8:08 pm
by rbodleyscott
NickDirlewanger wrote:rbodleyscott wrote:NickDirlewanger wrote:So you mean it's much harder just to edit existing scenario and reverse sides?
Well it isn't that hard.
Open a copy of the .BAM file in a text editor.
Replace all "_0_" with "_2_"
Replace all "_1_" with "_0_"
Replace all "_2_" with "_1_"
Swap the values in SIDEID0 and SIDEID1
And voila, the scenario sides are reversed.
But, of course, you will need to write completely new AI....
If I don't want to change side of units already on map but want to make new "french" side to place french units and so on.
French units are side0. If you want to make then Side1 in the Editor, you have to start a new scenario with Sides.txt in the campaign folder as I explained above.
After I do manipulations with replacing I can't open battle (Ravenna now) in Editor - crash with:
---------------------------
ERROR
---------------------------
GetTile(unit->mTile.x,unit->mTile.y).unit == NULL && "Trying to enter an occupied tile"
.\BattleMap.cpp(3769)
---------------------------
ОК
---------------------------
I replaced everything correctly.
Maybe the search and replaces replaced something that shouldn't be replaced. It worked OK with Pilgram-Lomnitz. Sorry. Back to plan B then - as below.
rbodleyscott wrote:It probably doesn't have to be a brand new scenario though. If you take the old scenario and delete all of the units, using the reveresed sides.txt file will allow you to add new reversed units in the editor. You can change the sideIDs in the editor.
Could you explain it? I need to open existing copied battle, remove all units from map, then change campaign's sides.txt to reversed one, open battle and place new units?
Hopefully that should work, yes. I make no promises though, you really ought to start with an empty slate.
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 9:02 pm
by NickDirlewanger
Second variant worked. However while purchasing additional units in such scenario I have blank rectangle with no points (in editor there are points and there are non fixed units).
Re: How to change army in Editor?
Posted: Wed Oct 22, 2014 9:14 pm
by rbodleyscott
NickDirlewanger wrote:Second variant worked. However while purchasing additional units in such scenario I have blank rectangle with no points (in editor there are points and there are non fixed units).
Are there enough points to buy all of the non-fixed units? If so the rectangle will be empty.
Re: How to change army in Editor?
Posted: Thu Oct 23, 2014 4:01 am
by NickDirlewanger
rbodleyscott wrote:NickDirlewanger wrote:Second variant worked. However while purchasing additional units in such scenario I have blank rectangle with no points (in editor there are points and there are non fixed units).
Are there enough points to buy all of the non-fixed units? If so the rectangle will be empty.
Yes there are - I didn't re-added all units yet. Thank you for explanation
Now I'm starting to deal with AI - menu with teams and aggressiveness works perfect, enemies do what they are ordered by it, but could you explain how to use AI_Masterplan() I read in some other thread? Thanks in advance!
Re: How to change army in Editor?
Posted: Thu Oct 23, 2014 7:41 am
by rbodleyscott
NickDirlewanger wrote:Now I'm starting to deal with AI - menu with teams and aggressiveness works perfect, enemies do what they are ordered by it, but could you explain how to use AI_Masterplan() I read in some other thread? Thanks in advance!
AI_Masterplan() is the higher level AI used in all the Skirmishes and a few of the historical scenarios - e.g. Naseby. It will only work correctly if the original deployment is fairly straightforward, with the player forces on the left side of the map and the AI forces on the right. It won't cope with reinforcements and suchlike (these are dealt with in a different way in skirmishes than they are when you place them in the Editor).
In the main game directory you will find a file called ScenarioTemplate.bsf
You need to copy this into the same folder as your scenario's .BAM file.
(Normally \My documents\My Games\PikeandShot\Campaigns\My Campaign\Scenarios)
Then rename it the same name as your scenario - e.g. MyScenario.BSF.
Then remove the "//" from lines
36 // AI_Masterplan(15);
and
71 // AI_ReassignTeams(1);
and voila.
Note that owing to a minor bug, which will be corrected in the first patch, you also need to add
AI_ReassignTeams(0);
after line 71.
(Although you don't need to do this if you have not assigned teams to the player side units - which there is no point in doing as they will be reassigned anyway by AI_Masterplan()).
Re: How to change army in Editor?
Posted: Thu Oct 23, 2014 8:01 am
by NickDirlewanger
rbodleyscott wrote:NickDirlewanger wrote:Now I'm starting to deal with AI - menu with teams and aggressiveness works perfect, enemies do what they are ordered by it, but could you explain how to use AI_Masterplan() I read in some other thread? Thanks in advance!
AI_Masterplan() is the higher level AI used in all the Skirmishes and a few of the historical scenarios - e.g. Naseby. It will only work correctly if the original deployment is fairly straightforward, with the player forces on the left side of the map and the AI forces on the right. It won't cope with reinforcements and suchlike (these are dealt with in a different way in skirmishes than they are when you place them in the Editor).
In the main game directory you will find a file called ScenarioTemplate.bsf
You need to copy this into the same folder as your scenario's .BAM file.
(Normally \My documents\My Games\PikeandShot\Campaigns\My Campaign\Scenarios)
Then rename it the same name as your scenario - e.g. MyScenario.BSF.
Then remove the "//" from lines
36 // AI_Masterplan(15);
and
71 // AI_ReassignTeams(1);
and voila.
Note that owing to a minor bug, which will be corrected in the first patch, you also need to add
AI_ReassignTeams(0);
after line 71.
(Although you don't need to do this if you have not assigned teams to the player side units - which there is no point in doing as they will be reassigned anyway by AI_Masterplan()).
Okay, I understood. And what if I'll use Masterplan and at the same time make in Editor groups of some (not all) AI units with waypoints and aggressiveness set - they will act as they ordered while others would act as Masterplan tells them?
BTW is there some scripting manual? I was software developer few years ago and it seemed for me to look like C++ so maybe I'll be able to code something for more accurate battles

Re: How to change army in Editor?
Posted: Thu Oct 23, 2014 8:28 am
by rbodleyscott
NickDirlewanger wrote:Okay, I understood. And what if I'll use Masterplan and at the same time make in Editor groups of some (not all) AI units with waypoints and aggressiveness set - they will act as they ordered while others would act as Masterplan tells them?
No, AI_Masterplan() will completely override AI placed in the Editor. The pike and shot AI makes very little use of the AI that can be placed in the Editor - apart from assigning teams for the historical scenarios. Instead, the orders are all scripted.
However, the Editor functions are available to be used for those who do not want to get into scripting.
BTW is there some scripting manual? I was software developer few years ago and it seemed for me to look like C++ so maybe I'll be able to code something for more accurate battles

It is basically a cut-down version of C.
Unfortunately the engine has grown organically, and there is no comprehensive scripting manual as such.
The main information is here:
http://www.slitherinebravo.net/GameWiki ... tub_engine
The list of engine functions is in \My Documents\My Games\PikeandShot\Autodocs\Battlescript.TXT
There are lots of useful additional scripted scenario functions in MoreScenarioTools.BSF in PikeandShot\Data\scripts
See also additional engine functions discussed in
http://www.slitherinebravo.net/GameWiki ... _older_hot
although the Pike and Shot AI does not use that method.
Some more info here:
http://www.slitherinebravo.net/GameWiki ... ing_ui_hot
Also changes added to the engine:
https://sites.google.com/site/battleaca ... llfeatures
Re: How to change army in Editor?
Posted: Thu Oct 23, 2014 10:14 am
by NickDirlewanger
Thank you once more, Richard
I'll make new topic in Scenario Design for remaking campaigns.