How to change army in Editor?
Moderators: rbodleyscott, Slitherine Core, Gothic Labs
-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
How to change army in Editor?
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.
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.
-
rbodleyscott
- Field of Glory 2

- Posts: 28409
- Joined: Sun Dec 04, 2005 6:25 pm
Re: How to change army in Editor?
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.)
[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.)
Richard Bodley Scott


-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
Re: How to change army in Editor?
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.
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.
-
rbodleyscott
- Field of Glory 2

- Posts: 28409
- Joined: Sun Dec 04, 2005 6:25 pm
Re: How to change army in Editor?
Well it isn't that hard.NickDirlewanger wrote:So you mean it's much harder just to edit existing scenario and reverse sides?
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....
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.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.
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.
Richard Bodley Scott


-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
Re: How to change army in Editor?
Of course, I understand about AI. Could you recommend text editor for BAM? Notepad gives some unreadable mess without any division like on columns.rbodleyscott wrote:Well it isn't that hard.NickDirlewanger wrote:So you mean it's much harder just to edit existing scenario and reverse sides?
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....
French units are side0 already.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.
And i was not able to find "2__" - did you mean "_2_"?
Last edited by NickDirlewanger on Wed Oct 22, 2014 5:13 pm, edited 1 time in total.
-
rbodleyscott
- Field of Glory 2

- Posts: 28409
- Joined: Sun Dec 04, 2005 6:25 pm
Re: How to change army in Editor?
I use UltraEdit.NickDirlewanger wrote:Could you recommend text editor for BAM?
Richard Bodley Scott


-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
Re: How to change army in Editor?
Thank you!rbodleyscott wrote:I use UltraEdit.NickDirlewanger wrote:Could you recommend text editor for BAM?
And "2__" you said above is "_2_"?
-
rbodleyscott
- Field of Glory 2

- Posts: 28409
- Joined: Sun Dec 04, 2005 6:25 pm
Re: How to change army in Editor?
Yes, sorry.NickDirlewanger wrote:Thank you!rbodleyscott wrote:I use UltraEdit.NickDirlewanger wrote:Could you recommend text editor for BAM?
And "2__" you said above is "_2_"?
Richard Bodley Scott


-
pipfromslitherine
- Site Admin

- Posts: 9932
- Joined: Wed Mar 23, 2005 10:35 pm
Re: How to change army in Editor?
Notepad++ is the tool I use. See here in the docs:
http://www.slitherinebravo.net/GameWiki ... gine#tools
Cheers
Pip
http://www.slitherinebravo.net/GameWiki ... gine#tools
Cheers
Pip
follow me on Twitter here
-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
Re: How to change army in Editor?
Thanks!pipfromslitherine wrote:Notepad++ is the tool I use. See here in the docs:
http://www.slitherinebravo.net/GameWiki ... gine#tools
Cheers
Pip
-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
Re: How to change army in Editor?
After I do manipulations with replacing I can't open battle (Ravenna now) in Editor - crash with:rbodleyscott wrote:Well it isn't that hard.NickDirlewanger wrote:So you mean it's much harder just to edit existing scenario and reverse sides?
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....
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.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.
---------------------------
ERROR
---------------------------
GetTile(unit->mTile.x,unit->mTile.y).unit == NULL && "Trying to enter an occupied tile"
.\BattleMap.cpp(3769)
---------------------------
ОК
---------------------------
I replaced everything correctly.
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?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.
-
rbodleyscott
- Field of Glory 2

- Posts: 28409
- Joined: Sun Dec 04, 2005 6:25 pm
Re: How to change army in Editor?
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.NickDirlewanger wrote:After I do manipulations with replacing I can't open battle (Ravenna now) in Editor - crash with:rbodleyscott wrote:Well it isn't that hard.NickDirlewanger wrote:So you mean it's much harder just to edit existing scenario and reverse sides?
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....
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.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.
---------------------------
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.
Hopefully that should work, yes. I make no promises though, you really ought to start with an empty slate.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?
Richard Bodley Scott


-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
Re: How to change army in Editor?
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).
-
rbodleyscott
- Field of Glory 2

- Posts: 28409
- Joined: Sun Dec 04, 2005 6:25 pm
Re: How to change army in Editor?
Are there enough points to buy all of the non-fixed units? If so the rectangle will be empty.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).
Richard Bodley Scott


-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
Re: How to change army in Editor?
Yes there are - I didn't re-added all units yet. Thank you for explanationrbodleyscott wrote:Are there enough points to buy all of the non-fixed units? If so the rectangle will be empty.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).
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!
-
rbodleyscott
- Field of Glory 2

- Posts: 28409
- Joined: Sun Dec 04, 2005 6:25 pm
Re: How to change army in Editor?
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).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!
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()).
Richard Bodley Scott


-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
Re: How to change army in Editor?
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?rbodleyscott wrote: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).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!
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()).
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
-
rbodleyscott
- Field of Glory 2

- Posts: 28409
- Joined: Sun Dec 04, 2005 6:25 pm
Re: How to change army in Editor?
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.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?
However, the Editor functions are available to be used for those who do not want to get into scripting.
It is basically a cut-down version of C.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
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
Richard Bodley Scott


-
NickDirlewanger
- Corporal - 5 cm Pak 38

- Posts: 31
- Joined: Tue Aug 19, 2014 12:54 pm
Re: How to change army in Editor?
Thank you once more, Richard 
I'll make new topic in Scenario Design for remaking campaigns.
I'll make new topic in Scenario Design for remaking campaigns.