Altering the Squad File

Moderators: rbodleyscott, Slitherine Core, Gothic Labs

Post Reply
macdonncadh
Corporal - Strongpoint
Corporal - Strongpoint
Posts: 60
Joined: Fri Apr 24, 2015 1:30 am

Altering the Squad File

Post by macdonncadh »

I have successfully added two units to a back up (!) of the Squad file for a campaign I am working on involving the various Highland clans. I added several more units to the file and went to open the editor and I managed to crash everything - boom! right to the ground. I wanted to get a screen shot of the squad file but could not. Running an eye over the additions I could not immediately see the problem. Here are the symptoms I saw that might help. First, when the game crashed I got an error message that said:

Duplicate name in Master Squads file: CLAN (0).

Then there was a complete fail followed by the following Dear John lines...

Unhandled Exception ExpCode OX80000003
ExpFlags:0 ExpAddress: 0x0048FFDD
Please Report.

Okey Dokey...I have now reported it.

I did triple check to see that I hadn't done something like give them all the same ID number, or something of that nature.
Any thoughts?
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28007
Joined: Sun Dec 04, 2005 6:25 pm

Re: Altering the Squad File

Post by rbodleyscott »

You have probably given two units the same name in the Name column, (Column A). (Or given a unit the same name as one of the existing units).

All the names in that column have to be unique.
I have successfully added two units to a back up (!) of the Squad file for a campaign I am working on
You may have already done it as I suggest below, but I will mention it just in case:

You should not edit even a backup of the Squads file in the main installation, because there will be issues if we change the Squads file in a future update.

What you are really supposed to do is put a clone of the Squads file in your campaign and make the changes there. The program will automatically use the local squads file instead of the core Squads file, provided that you have #REPLACE in cell A1.

This will have the advantage that your scenario will continue to work correctly even if we make changes to the core Squads file in future updates.
Richard Bodley Scott

Image
edward77
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Wed Nov 10, 2010 9:11 pm

Re: Altering the Squad File

Post by edward77 »

Only two blue allies dragoons in the squads file. I cloned them, placed them at bottom of file and then edited them to nos 2 and 3, and ids to 126 and 127. Editor crashes "duplicate Blue Bayonet RG" ??? . Worse still, removed clones resaved to original version. Editor still crashes with same message?? Replaced squad file with copy of original. Now OK. But if I try cloning again get same crash. Help!
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28007
Joined: Sun Dec 04, 2005 6:25 pm

Re: Altering the Squad File

Post by rbodleyscott »

edward77 wrote:Only two blue allies dragoons in the squads file. I cloned them, placed them at bottom of file and then edited them to nos 2 and 3, and ids to 126 and 127. Editor crashes "duplicate Blue Bayonet RG" ??? . Worse still, removed clones resaved to original version. Editor still crashes with same message?? Replaced squad file with copy of original. Now OK. But if I try cloning again get same crash. Help!
Every unit has to have a unique name in the squads file. So when you clone units you need to give the clones new names in the Name column, as well as unique IDs.

I am not sure what you mean by "edited them to nos 2 and 3"
Richard Bodley Scott

Image
edward77
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Wed Nov 10, 2010 9:11 pm

Re: Altering the Squad File

Post by edward77 »

Well, there are originally only two Blue dragoons in the squads file, BlueDragoon and BlueDragoon1. I cloned them to BlueDragoon2 and BlueDragoon3 with id nos 126 and 127 at the bottom of the list.
Further question:- Do all Blue units have to be Allies and Red units have to be Axis?
Paul59
General - King Tiger
General - King Tiger
Posts: 3800
Joined: Tue Jul 21, 2015 11:26 pm

Re: Altering the Squad File

Post by Paul59 »

edward77 wrote:Only two blue allies dragoons in the squads file. I cloned them, placed them at bottom of file and then edited them to nos 2 and 3, and ids to 126 and 127. Editor crashes "duplicate Blue Bayonet RG" ??? . Worse still, removed clones resaved to original version. Editor still crashes with same message?? Replaced squad file with copy of original. Now OK. But if I try cloning again get same crash. Help!
Surely this means that you have two units named Blue_Bayonet_RG in the Squads.csv file. It should have nothing to do with the Dragoons.
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28007
Joined: Sun Dec 04, 2005 6:25 pm

Re: Altering the Squad File

Post by rbodleyscott »

edward77 wrote:Well, there are originally only two Blue dragoons in the squads file, BlueDragoon and BlueDragoon1. I cloned them to BlueDragoon2 and BlueDragoon3 with id nos 126 and 127 at the bottom of the list.
Further question:- Do all Blue units have to be Allies and Red units have to be Axis?
No, it is just a naming convention to keep things logical.
Richard Bodley Scott

Image
edward77
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Wed Nov 10, 2010 9:11 pm

Re: Altering the Squad File

Post by edward77 »

The mystery thickens! I went back to the original file which we know works, edited both elan and experience of one existing medium artillery from 100 to 200 then saved it. Tried editor -- crash same message. The scenario works fine with the original file is so don`t spend much of your valuable time on this.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28007
Joined: Sun Dec 04, 2005 6:25 pm

Re: Altering the Squad File

Post by rbodleyscott »

edward77 wrote:The mystery thickens! I went back to the original file which we know works, edited both elan and experience of one existing medium artillery from 100 to 200 then saved it. Tried editor -- crash same message. The scenario works fine with the original file is so don`t spend much of your valuable time on this.
if you did not put #REPLACE in the A1 cell of your custom version of the squads file, the engine would try to concatenate all the units from both the local and core squads files. It would therefore find duplicate units.
Richard Bodley Scott

Image
edward77
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Wed Nov 10, 2010 9:11 pm

Re: Altering the Squad File

Post by edward77 »

No that`s not it. #REPLACE is there
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28007
Joined: Sun Dec 04, 2005 6:25 pm

Re: Altering the Squad File

Post by rbodleyscott »

edward77 wrote:No that`s not it. #REPLACE is there
Best if you put the whole custom campaign on DropBox for me so I can take a look and see if I can see what it wrong.
Richard Bodley Scott

Image
edward77
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Wed Nov 10, 2010 9:11 pm

Re: Altering the Squad File

Post by edward77 »

Richard, Here is another example using a very simple, small squad file from Alma. Here nearly all units are blue and there is very little variety so it`s easier to check. There are 90 rows in total of which there are 75 Blue_Rifle_Veteran units. I took the first 7, copied them to rows 91-97 and changed Blue to Red . So we now have seven Red_Rifle_Veteran, id nos 90-96. I saved this then back to editor...... Crash! " Duplicate unit name in custom campaign squads file. RED_VET_DETERMINED_HORSE (0)"
There are only two of these is on rows 24-25 correctly numbered so how can there be a duplicate? Could P&S have corrupted?
Paul59
General - King Tiger
General - King Tiger
Posts: 3800
Joined: Tue Jul 21, 2015 11:26 pm

Re: Altering the Squad File

Post by Paul59 »

edward77 wrote:Richard, Here is another example using a very simple, small squad file from Alma. Here nearly all units are blue and there is very little variety so it`s easier to check. There are 90 rows in total of which there are 75 Blue_Rifle_Veteran units. I took the first 7, copied them to rows 91-97 and changed Blue to Red . So we now have seven Red_Rifle_Veteran, id nos 90-96. I saved this then back to editor...... Crash! " Duplicate unit name in custom campaign squads file. RED_VET_DETERMINED_HORSE (0)"
There are only two of these is on rows 24-25 correctly numbered so how can there be a duplicate? Could P&S have corrupted?
I have just done exactly what you have described to the Alma Squads.csv file, and I had no problem when opening the Editor. Best if you send your amended Squads file to Richard and he can try to find out what is going wrong.
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
edward77
Sergeant - 7.5 cm FK 16 nA
Sergeant - 7.5 cm FK 16 nA
Posts: 231
Joined: Wed Nov 10, 2010 9:11 pm

Re: Altering the Squad File

Post by edward77 »

Ok, thanks Paul. That`s very helpful and hopefully it at least eliminates some possible simple mistake on my part. I have already sent it to Richard. I think it is something to do with my saving procedure because if you remove the changes and restore the file back to the initial state and then save it, the editor subsequently still rejects it. So the saved version must be different in some way from the original version which we know works.
I directly edited the .csv file. Is it a lot easier to do the changes with the proper spreadsheet (.xls) ? But then how do you go about doing that and then get back to the .csv file
Paul59
General - King Tiger
General - King Tiger
Posts: 3800
Joined: Tue Jul 21, 2015 11:26 pm

Re: Altering the Squad File

Post by Paul59 »

edward77 wrote:Ok, thanks Paul. That`s very helpful and hopefully it at least eliminates some possible simple mistake on my part. I have already sent it to Richard. I think it is something to do with my saving procedure because if you remove the changes and restore the file back to the initial state and then save it, the editor subsequently still rejects it. So the saved version must be different in some way from the original version which we know works.
I directly edited the .csv file. Is it a lot easier to do the changes with the proper spreadsheet (.xls) ? But then how do you go about doing that and then get back to the .csv file
Yes, it seems likely that your problems are due to the way that the .csv file is being saved. Either you are doing something wrong, or the program that you are using to edit it is producing a file that is incompatible with the game.

Personally I edit the Squads.csv file directly with Microsoft Excel. You might be able to edit the Squads.xls spread sheet instead, and then convert it to a .csv by just rewriting the file extension, but I am not sure about that as I have never tried it.
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
Odenathus
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 287
Joined: Sat Jun 27, 2009 10:02 pm

Re: Altering the Squad File

Post by Odenathus »

I should warn you that using my scenarios as a basis may not always be prudent as it took me ages to figure out the unit names, their relation in the Squads and Text files, and how to treat duplicate units. I'm getting better but, in the past, I'd go with whatever the engine would let me get away with. So, while Red_Veteran_Rifle2 might be obvious enough for a second unit of similar musketeers, it might equally say Blue_Light_Guns99 if that worked in the finished scenario. Just a thought.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28007
Joined: Sun Dec 04, 2005 6:25 pm

Re: Altering the Squad File

Post by rbodleyscott »

You can edit the .xlsx and then also save the file as a .csv from Excel - that is what I do. Be careful to use the vanilla .csv format, there are several other .csv formats that may not work.
Richard Bodley Scott

Image
Post Reply

Return to “Scenario Design”