brotherkrieg:
The process is rather lengthy because there are several tings going on.
I'll try to cover how this works in as few words as possible. If anyone spots something i left out, feel free to chime in.
Note: All references for this tutorial are based on the Rolling Thunder Patton Campaign, marokko Chapter and Casablanca Map.
Step 1: Open the Map in the mapeditor.
Step 2: Click on the tab: Objects, Fences, Bridges
Step 3: Double Click (LMB) on any one of the Core Units. They are shown in Blue. (LMB = Left Mouse Button)
A box or new window will open which tells you a couple of things.
Look at the Script ID. Most of the time, Core Units will have a number other than 0 or -1 entered. This is the Script Unit Identifier that is used to controls triggers or Functions that affect units with this Script ID within the Lua Script. The Lua Script is an entire other subject so I will not try to cover it here.
Now look at the ScenarioUnit. For a unit to be a Core Unit, this value must be True. Click on the True, and a Dialog Box opens with two choices... True and False. Select False then close the window on the X in the upper right corner. Did the unit change to the normal skin color? Double Click on the unit once more and change the value to True.... it changes back to Blue when you close the window.
So now we know the Script ID for the Core Units, if they are using one.
I have not personally seen any Core Unit that was not assigned a Script ID, but some people suggest it is not necessary. I have not tested this line of thought. Since the Core Units are key to the Campaign or Chapters success, and the fact that they carry over experience from map to map, not using a Script ID seems illogical to me.
Knowing the Script ID is only part of the dynamics at work. We now must explore a bit further to find out what kind of units the Core Units are supposed to be. What you see in the map, is only a anchor or placeholder for what is supposed to be there. Many Map/Chapter Artist place a common unit on the map, but might change this in another file, rather than making a change on the map.
So next we need to find the files that are related to this map.
Step 4: Open Windows Explorer. This is not Internet Explorer. If you read my How To, then this has been discussed. Windows Explorer is more useful than My Computer for use in BK.
Step 5: Locate your BK (Version) Folder for the Map you have open in the mapeditor.
Note: If you have not yet extracted all of your .pak files, you will not have what you will need, so you must back up and do this first.
We now have to locate the associated Chapter Folder that will contain the script.lua file for this map.
Open the BK folder, and follow this path: Run / Data / Scenarios / Chapters
The next folder to open will usually be the name of the Chapter, Allies or perhaps German. So you must know what you are looking for.
You can see in my illustration, mine is located under Allies. Yours might be different. But you must know the Chapter name and then locate that Chapter Folder. Mine is morokko.
Step 6: Once you locate the Chapter, then Open the Script.lua file in Wordpad or Notepad. You can also use a program named Blitzkrieg SciTE Editor or simply named SciTE. I prefer Wordpad.
In this file, you will find where the Core Units have been identified with the number of core units, many times for both Armor and Artillery Units.
The required Statement is:
AddNewSlot ("M4A1_General_Sherman_USA");
In my Mission map, I made couple of changes so your will not look exactly the same. I actually added both Allied and French Units and a couple more Objectives. So do not assume yours will be the same.
Each occurrence of 'AddNewSlot' reserves a Core Unit. Depending on the design of a Campaign or Chapter, you usually start out with only a few Core Units, and at the conclusion of a map, new cores are added in the script.lua.
In my case, we find the M4A1_General_Sherman_USA which matches the units in the map. We also know from this script that 5 armor (tanks and 3 Artillery Guns have been dedicated.
DISCLAIMER: Always back up your original files before you modify it (including the map file - name of map.bzm). If you read my tutorial, I state this over and over until you are likely sick of hearing it. But if you make a major mistake in the file, the game will crash... Rather than sitting there without an original to go back to, you are stuck trying to figure out... "what the hell did I do?" So do not be that guy!!!So here is where the rubber meets the road.
If you wish to add more core units or change what they are... this is where you start. If you add more core units, you cannot exceed the number here on your map. If you forget to place them all on the map, no problem.... but they will never appear.
If you wish to change the model used for the Core Unit... again, this is where you do that. The Core Units must be listed in the exact order you place them on the map, or the units will appear in the incorrect coordinates. So if you make a change, be careful and remove the original core units from the map, then modify your script.lua, and replace the new core units.
Once you have made the changes... Save, close and test.
If it does not run... or crashes... go back and start over. Failing is part of learning... and most of us here are some of the biggest failures on the planet. Although, most of those are now the smartest guys in the BK world. You simply cannot have one without the other. So expect to get your butt kicked every so often. Because I m always trying to push the envelop of this game, I have many more tests that fail than succeed.
And... always, always always... back up the original files before you change anything. I maintain my originals in a Duplicate BK Folder named BK Orig. Every single file is maintained there in its original released form. Not everyone will do this and far be it from me to say they should....
Well damn it... if you have large enough Drive or a backup drive....
everyone should if they change anything. Once we have the basic fundamentals down, sometimes we get sloppy and forget to do the backup copies... I cannot stress this enough.
One more thing I will mention about the script.lua.
There is another reference in the file in regard to BaseUpgrades. This is where you can add units that you can select as newer model tanks or larger guns will be available. If you have played the Scenarios, you have done this. This part of the Script lets you do some things to change the gameplay. Example: I really wish I had a Tiger right now... to use against those T34(85)s. Here is your chance to make it happen.
Anyone wish to add or make comment, please do...
But that is about it.
MP