Jump to content

Campaign Script File


Recommended Posts

I've been attempting to compile a small test campaign.  Just taking notes, reading forum posts and trying to understand how this works.  I keep getting the following error:

Incorrect syntax in campaign script on line 5. 

I have tried everything I can think of with line #5.  I deleted, re-typed, copied and pasted Line #5s from other campaigns.  I don't know what the problem is.  Below are the first eight lines of the campaign script txt file.  The editor is advising the problem is on line five.  I seems like the editor counts the open lines.  As a result I think the problem is with: [bLUE VICTORY TEXT] Congratulations! 

Any adult supervision would be greatly appreciated. 

/* Alarm Unit*/ 

[PLAYER FORCE] Red

[HUMAN OPPONENT ALLOWED] No

[bLUE VICTORY TEXT] Congratulations!  

[bLUE DEFEAT TEXT] You lost

[RED VICTORY TEXT] You won.

[RED DEFEAT TEXT] You lost.

 

EDIT: The forum forces you to have open lines between the above text so I can't make it display as it does in the actual txt file.  In the file there is an empty line after [HUMAN OPPONENT ALLOWED] No and then again after [bLUE DEFEAT TEXT] you lost.  

Edited by MOS:96B2P
Link to comment
Share on other sites

8 minutes ago, benpark said:

I'd try changing the "b" in "bLUE" to read "BLUE".

Everything else looks good to my admittedly weary eyes.

:o WOW.  That worked and got me down to line 12.  Three examples from the forum that I was using had the B lower case.  But I just double checked the Engine manual page 117 and there it is upper case.  "Sigh"  

Thank you Sir.  :)

Now on to line #12.................. 

Link to comment
Share on other sites

6 hours ago, MOS:96B2P said:

:o WOW.  That worked and got me down to line 12.  Three examples from the forum that I was using had the B lower case.  But I just double checked the Engine manual page 117 and there it is upper case.  "Sigh"  

Thank you Sir.  :)

Now on to line #12.................. 

A creating and testing a campaign script - joy!

My top tips, FWIW, to avoid distress once you have the inevitable spelling and path glitches ironed out in your campaign script is:

a/ with your campaign scenarios create a master compilation folder and add all your scenarios that work in the compile in there (you've most likely done that as you are now checking the campaign compile). That way you know this all works.

b/ if you change/amend a mission avoid renaming the version if you can (this does take some OCD copy and back-up skills to maintain version integrity) but renaming things to e.g. MyCampaignMission_v3 to MyCampaignMission_v4 will screw up the script and you are back to square one chasing down script errors...

c/ after fiddling with missions and tweaking them you can then go through and replace the missions in the compile one by one to overwrite them. 

Sure there are other ways of doing this but found this works for me.

Link to comment
Share on other sites

3 hours ago, George MC said:

Sure there are other ways of doing this but found this works for me.

+1.  Thank you @George MC for the guidance & advise.  I'll add some of the above, that I didn't already have, to my notes.

If anybody else has any tips please post them.  This topic is tagged with campaign, script & compile so people doing searches in the future will hopefully find this thread and learn something from it.  Doing my own searches on this topic I have read and taken notes from other posts that are over nine years old.        

Link to comment
Share on other sites

6 hours ago, George MC said:

a/ with your campaign scenarios create a master compilation folder and add all your scenarios that work in the compile in there

 

6 hours ago, George MC said:

b/ if you change/amend a mission avoid renaming the version if you can (this does take some OCD copy and back-up skills to maintain version integrity) but renaming things to e.g. MyCampaignMission_v3 to MyCampaignMission_v4 will screw up the script and you are back to square one chasing down script errors...

Agreed. I have some thoughts on this:

  1. I wrote a backup script a long time ago that I still use for scenario work - it zips up a directory and copies the .zip file to a backup directory and keeps the last 10 of such backups. No version numbering required.
  2. I still do put a version number on if I send the file to someone to test - so they know they have the latest version. But I do that to a copy of the file. So, if I was working on test.btt and I was ready to send a test to someone I would make a copy and name it testv2.btt and send them that. (someone reading this who has received test files from will will likely be confused by this - yes it is true I am not at all consistent - :-)
  3. I have no experience with campaigns but George's advice from above seems very solid. If you chose to do you backups of your work by just tweaking the version number you can continue to do that if you copy the testv4.btt file into the campaign compile directory and rename it test.btt (deleting the old one first).

 

Link to comment
Share on other sites

Practice, practice, practice. I think it's also the fact that you will do one once every blue moon for a proper release means that former experiences can be lost when you come around to it again. Start small for only three battles or so and if that works then start adding on more scenarios. There's nothing worse than having 14 scenarios all ready to go for the game to go error with scenario 1.

Try to get a hold of an existing campaign script to use as a template is also a big help.

365x8z.jpg

But it's always a good feeling when it is done. :) 

 

Link to comment
Share on other sites

Okay, I've got one very small three scenario,branching test campaign compiled.  Below are the notes I took and updated through reading the manual, trial and error and forum searches etc.  I'm sure improvements and additional information can be added.  Comments and advice are welcome.  

Directions and some examples can be found in the 4.0 Engine manual starting on page 113.

Core Unit Scenario:  Create and save a core units scenario file.  The 3-D map will not be used in the campaign.  The name of this scenario will be the title of the campaign.  The units on the map (both red & blue) will be imported into the battle scenarios.  The special campaign briefing (with strategic & operational but no tactical maps) and other information (title, description image) comes from this core unit scenario.  If you want to make an eight scenario campaign you need nine scenarios.  A core unit scenario file plus the eight battle scenario files. The victory / defeat script for the core unit scenario file is the victory/defeat script used at the end of the campaign AAR.      

Synchronization: If changes are made to the core unit after a battle scenario has been created, then synchronization between the core unit scenario and battle scenarios must be completed. Core units that were deleted from the original (previous version) battle scenario must be deleted again from the revised version.  To synchronize open up the battle scenario file and Import the core Units again. Core Units already in the scenario retain almost all of their customization, such as placement, Group assignments, Orders, etc. (Implies some customization is lost, but not sure what)

Battle Scenario: The 170x170 description image is not used by the battle scenarios. 

Import the core units.

Delete core units that are not needed for this battle scenario.

Add additional non-core units that are needed for this battle scenario.

Campaign Script File:

Create a txt campaign file.

Refer to the example in the Engine manual.

The easiest way is probably to copy a previous txt campaign file.

Go through the copied txt file changing entries to the current campaign while referring to the examples.

The file name of the txt campaign script file is also the name of the campaign.

Compile Campaign:  Put all the files (battle scenarios) for the campaign in the same folder with the txt script file.  I created the folder inside the briefing folder.  The core unit scenario can also be put in this folder but is not mandatory. 

Next do the following:

1) Open Editor.

2) Load core unit scenario

3) Click on make campaign (in the drop-down under 3-D Preview).

4) A window will open.  Click Continue.

5) A window will open for you to locate the txt campaign script file

6) Select (one click) the campaign txt file.    

7) IF no error a new file with the .CAM extension will appear in the campaign folder.   

ERRORS: Correct any errors and repeat the above steps.  The editor counts open lines when it tells you what line has an error. 

successfully compiled campaign will automatically load in the games campaign folder.  You can’t open a campaign file in the editor.  Close out of the editor and load the campaign as if you were going to play it.     

NOTE: The campaign creator (You) must keep the individual battles or lose the ability to make changes to the campaign.

Also, I think below is how the Refit, Repair, Resupply & Rest work in the campaign script.  It seems to be an all or nothing event in each of the four separate categories.  Example: depending on the percentage roll for supply either all the fire teams and vehicles will be topped off with ammo or none will be.  It is a percentage of the chance of unit wide resupply occurring instead of a percentage of the supply getting replaced .......... I think.  I'm less sure on this.  The conversation in a separate thread on the below issue went silent..... :ph34r:  :)    

% chance of Refit = Replacing all destroyed vehicles and men in the core unit?

% chance of Repair Vehicle = Repair all immobilized vehicles & bring all subsystems back to green.

% chance of Resupply = Top off every fire team & vehicle with ammo

% chance of Rest = Every troop & crewman is fully rested (vs tired, exhausted, etc.). 

Please point out any mistakes or improvements that could be made. 

 

Link to comment
Share on other sites

I'll reinforce how great Synchronization is. A built-in failsafe for when we invariably change something part-way through the process through renaming, etc.

I've thanked Charles and Steve mentally at least twice when this function saved me redoing things that would have taken potentially weeks to fix. Redos are all too common given the complexity of these things, so I greatly appreciated the foresight to fit the Editor with something that acknowledges that complexity with the ability to fix one's errors in a well considered way.

Edited by benpark
Link to comment
Share on other sites

On 2/2/2020 at 3:57 AM, MOS:96B2P said:

% chance of Refit = Replacing all destroyed vehicles and men in the core unit?

.....

Please point out any mistakes or improvements that could be made.

I think that was changed with one of the upgrades (version 3.0?) when talking about infantry teams. Let's say you set the value to 10%. Before there would be a 10% chance that all casualites in that squad would be replaced between the battles. I think it was changed to all infantry units get a 10% headcount boost (back towards by not above normal full levels). I think before it was causing some funny look probablys when the replacements show up but get concentrated only in a handful of squads leave the other teams with only two/three men understrength.

I could be mistaken though...

Link to comment
Share on other sites

  • 3 weeks later...
Quote
On 2/1/2020 at 12:57 PM, MOS:96B2P said:

Also, I think below is how the Refit, Repair, Resupply & Rest work in the campaign script.  It seems to be an all or nothing event in each of the four separate categories.  Example: depending on the percentage roll for supply either all the fire teams and vehicles will be topped off with ammo or none will be.  It is a percentage of the chance of unit wide resupply occurring instead of a percentage of the supply getting replaced .......... I think.  I'm less sure on this.  The conversation in a separate thread on the below issue went silent..... :ph34r:  :)    

% chance of Refit = Replacing all destroyed vehicles and men in the core unit?

% chance of Repair Vehicle = Repair all immobilized vehicles & bring all subsystems back to green.

% chance of Resupply = Top off every fire team & vehicle with ammo

% chance of Rest = Every troop & crewman is fully rested (vs tired, exhausted, etc.). 

Please point out any mistakes or improvements that could be made. 

 

 I have been testing campaign scripts in CMRT and these are my thoughts:

  1. None of them are all or nothing.
  2. In my opinion, the percentage chance in all categories is for each individual soldier or weapon. For example; set at 50% refit each casualty and lightly wounded man rolls for a replacement, over 50% he is replaced, under and he is not and/or a lightly wounded man stays in the game wounded. In my tests I have had HQs replaced or not, a squad with 4 casualties and two lightly wounded, getting 3 replacements including one of the lightly wounded and two of the casualties. And many other combinations. I have had squads with no replacement and others where all casualties were replaced. And being a roll for each soldier it is very rare that the number of replacements equals half the casualties and lightly wounded, as per tossing a coin, could be more or less.
  3. Resupply works the same. On a weapon basis. If the roll comes up and your man is carrying a SMG he is topped off with SMG ammo, up to the amount that an individual carries. If some of the other SMGer's  fail on their roll, they just start the next battle with what they had left. The interface shows the total SMG ammo and is why it is not as high as the original total. Sometimes they all hit the roll and the SMG ammo total goes to the max allowed carried by a squad. Same goes for the rifle carriers and LMG's, even the pistols and heavy weapons.
  4. Rest was harder to comprehend. I crawled the company around until all was fatigued, then cease fired. At 50%, when I started the next battle, squads were at different states of rest ranging from ready to exhausted. I came to the conclusion, that the state of rest of each soldier is tracked individually and the ones who made the roll and returned to rested, increased the overall squad rest in the interface. Not sure on this, just my conclusion.
  5. Vehicles. I used tanks in my tests. A little more uncertainty, but it looks like it is the same. Replacement tanks at a 50% setting, can yield replacements or not. Surviving crew are considered as well. I have seen replacement tanks manned with surviving crew even with an assistant driver missing in a T-34 76. A three man crew and the Commander is wounded. And other times the crew are removed and the replacement tanks get new crews. A cool feature I noticed was when a Platoon HQ unit was removed, a surviving tank in his platoon can move up to Platoon HQ. He keeps his lower rank, and have even seen a Private in command when the tank commander had been removed because of casualty.
  6. Repair vehicle is the same in my opinion, Damaged tanks can be fixed or not individually. This proved hard to test, but I always saw some tanks with track or radio or whatever damage not fixed.
  7. These are all great features of a campaign, and I think more thought should go into assigning the percentage numbers, especially with ammo. I do wish the refitting/replacement slot was divided for vehicles and soldiers, though.
  8. A couple of other notes, which may be just my ignorance of campaign scripts, but there may be others who don't know these. First, the example script in the manual is what I used as a template to make my scripts. It shows percentage numbers in the first battle, refitting, repair, resupply, etc. It took me multiple attempts to realize those are not needed, as the refit, and resupply, etc., from the first battle comes from those percentage numbers in the second battle. I could never correlate the results with the first battle to the percentages in the first battle until I realized that. You must have those lines in the script to avoid errors, but they do nothing as far as I can tell. I set them all to 0%.
  9. Secondly, I found out you can not use the reduced headcount feature in the core force. It just loads the entire force no matter what. I have been looking for a way to reduce a battalion in a campaign without actually playing them through a battle. Any suggestions?
Link to comment
Share on other sites

15 hours ago, Mudhugger said:

 I have been testing campaign scripts in CMRT and these are my thoughts:

  1. Secondly, I found out you can not use the reduced headcount feature in the core force. It just loads the entire force no matter what. I have been looking for a way to reduce a battalion in a campaign without actually playing them through a battle. Any suggestions?

+1.  Interesting stuff.  Thanks for sharing.  

My understanding is, Example: You have a core force made up of 1st and 2nd platoon.  You import this core force into all five scenarios of the campaign.  In the second scenario of the campaign you only want 1st platoon.  So in the scenario editor you open the second scenario and delete 2nd platoon from the core.  In the other four scenarios you could leave both platoons (entire core force).  

Link to comment
Share on other sites

7 hours ago, MOS:96B2P said:

+1.  Interesting stuff.  Thanks for sharing.  

My understanding is, Example: You have a core force made up of 1st and 2nd platoon.  You import this core force into all five scenarios of the campaign.  In the second scenario of the campaign you only want 1st platoon.  So in the scenario editor you open the second scenario and delete 2nd platoon from the core.  In the other four scenarios you could leave both platoons (entire core force).  

That's pretty much what the manual says ISTR.

Link to comment
Share on other sites

Yeah thanks. I know that procedure.

I am making a Regiment core force. I want to keep the scenarios to a battalion at a time, but would like to simulate the casualties of the other battalions on that day. And then play one of them in the following battle, and so forth across Belarus. Then I can use the Regiment's assets and even the Division's more realistically.

I think I will have to make a small battle to make casualties perhaps with German artillery to simulate the other Battalions casualties on that day. Still mulling that over.

Anyway it's all fun. The editor and the game.

 

Link to comment
Share on other sites

  • 2 months later...

So in light of all the steps and advice which Ive taken from the above mentioned as well as checking for basic errors I'm stuck,I get the error on line 24 which is this:

[BATTLE NAME] Zuphen

Ive checked the spacing and the spelling which matches the name of the file in the folder exactly (its shares a folder with all the other scenarios I'm looking to compile). It also matches with [NEXT BATTLE IF WIN] part (copied and pasted below) so pathing should work there? 

/*Battle #1*/
[BATTLE NAME] Breslau 1 
[WIN THRESHOLD] minor victory
[NEXT BATTLE IF WIN] Zuphen
[NEXT BATTLE IF LOSE]
[BLUE REFIT %] 0
[BLUE REPAIR VEHICLE %] 50
[BLUE RESUPPLY %] 100
[BLUE REST %] 100
[RED REFIT %] 0
[RED REPAIR VEHICLE %] 0
[RED RESUPPLY %] 0
[RED REST %] 0 

/*Battle #2*/
[BATTLE NAME] Zuphen

Ive not written over the file in anyway such as renaming it. Can anyone help me here? 

 

Link to comment
Share on other sites

4 hours ago, rtdood said:

/*Battle #2*/
[BATTLE NAME] Zuphen

Ive not written over the file in anyway such as renaming it. Can anyone help me here? 

I can't see anything wrong with [BATTLE NAME] Zuphen.  However, are you sure  [BATTLE NAME] Zuphen is line number 24?  I counted in my Red Thunder script and the battle name for the second battle is number 28.  

Link to comment
Share on other sites

Looking at the script you should have an option for battle lose under the first battle - either go to another mission or get booted out of the campaign. 
 

Can you share your campaign file and screenshot of the required mission file names from the compile directory please?

Link to comment
Share on other sites

12 hours ago, MOS:96B2P said:

I can't see anything wrong with [BATTLE NAME] Zuphen.  However, are you sure  [BATTLE NAME] Zuphen is line number 24?  I counted in my Red Thunder script and the battle name for the second battle is number 28.  

11 hours ago, George MC said:

Can you share your campaign file and screenshot of the required mission file names from the compile directory please?

Its definitely line 24 as Ive not only counted manually myself, but used the notepad to identify line 24. This is for Battle for Normandy - sorry I should have said. I'd imagine the scripting format isn't too different between the two although I guess there might be slight differences. 

I have attached a screenshot and also the script. 

Compile directory.jpg

Taking on the big guns.txt

Link to comment
Share on other sites

You need to have an outcome in your script if you lose Breslau. Currently nothing happens - so either you go to another mission (which if win in mission 1 is Zuphen) or if you lose then you need to name the next mission or your campaign ends. 

Edited by George MC
Link to comment
Share on other sites

On 5/10/2020 at 3:16 PM, George MC said:

You need to have an outcome in your script if you lose Breslau. Currently nothing happens - so either you go to another mission (which if win in mission 1 is Zuphen) or if you lose then you need to name the next mission or your campaign ends. 

Cheers for this, I added another mission in here as you suggested, and that worked. The only other errors I had was on a couple of lines which I was able to solve. All compiled. Now I'm half way playtesting this all the way through...and have quite a few things ill need to change before release 😁

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...