|
Post by LouisXIV on Aug 24, 2011 13:22:13 GMT 1
I'm working on a chapter; the U.S. counterattacking toward Bastogne.
In the first map, I put all the U.S. units on. Included were 6 out of 12 tanks as core units up front, 3 core unit tank destroyers off to the side, and 3 M-7s at the rear. What do I find when I run the map? Some of the TDs and M-7s are up front. The game engine places the core units indiscriminately.
However, that is just a symptom of the problem. In the next map, I have the units all come on in three groups. Each group contains 4 tanks, a TD and an M-7 (as well as infantry and transport.) Two of the tanks and the TD and M-7 are core units.
The first time the group arrives, it contains 6 tanks including 4 tank core units. I think, "That's cool. We're saving the TDs and M-7s until last. I like that idea." I figured this was happening because in the chapter script core unit section, I'd listed the 6 tanks first, then the TDs, etc.
Second group, 4 core unit tanks. Third group, the same thing. So I end up with 18 tanks, no TDs and no artillery.
Does anyone know a way around this?
Edit: I tried changing the order of the units in the chapter script, so that there were 2 tanks, a TD and an M-7, two tanks, a TD ... etc. This did not make a bit of difference. I still ended up with 12 tank core units, no artillery or AT.
I guess I'll have to have them come on like a parking lot.
|
|
|
Post by Major Pain on Aug 24, 2011 15:43:31 GMT 1
You need to place the core units first... before any other player units.
The issue is how you place the units in the specific order.
They must be placed in the same order on every mission in the chapter. This is important when perfroming the LandReinforcments function or switching the unit to a Core Unit while in the map editor.
As each unit is placed on the map, it is given an id number which defines its location, the type units, if core is true and player #. It also stores the script id number even if it is -1. You can see them if the map is converted to xml.
If a unit is placed then deleted, and you place it again, the id number is at the end of the id list, and does not replace the one deleted. The previous id number is changed to null value. This becomes an issue when you change a map many times by removing items then placing new items. So in effect, the core lineup changes since the previous id is void of data. You would have to remove the cores and re-install in the proper order.
Also, keep in mind how you define the 'AddNewSlot' in the chapter script. Unfortunately... it is an exact science.
|
|
|
Post by LouisXIV on Aug 25, 2011 0:03:12 GMT 1
So the fact that I've assigned only four core units in the original map means they get assigned the first four core unit types, and that's it. Repeat performance.
The fact that I changed the first four core unit designations in the chapter script to tank, tank, TD and SPG, didn't make any difference.
I wonder what would have happened if I had the units in the first map coming on as reinforcement groups as well, with only 4 core units designated in the script.
I had room enough in the second map to have the vehicles come on as a partial convoy, and all of them are placed right at the beginning. Thus this is just a discussion for future usage.
|
|
|
Post by Major Pain on Aug 25, 2011 9:32:47 GMT 1
Just keep in mind how you assign them in the script... then if you give the player the option to change the units by Upgrades in the Chapter script. The player selection can be changed without actually changing it on the map. The players selection carries through from map to map on each Core ID.
If you look at original BK Chapters, you might notice the Stuart or Sherman in the map editor, but when you run the game, it has changed to whatever has been overwritten by the player or chapter lua. Any model (unit) can be used as placeholder... the actual unit depends on the player and script.
Part of the problem you will encounter is if you change Core ID#1 from a Sherman M4A1 to a M10 TD, the ID will still use the M4A1 when you play the map.
To get around this, you need to post the original Cores and any new assignments. You can give the ones you don't want to show up a Script number that can never Land. They show up in the mapeditor, but not the map when run, since the function number is never called or condition is not met. You do have to assign the script number and provide a bogus function or it will fail. You just make the If -> Then condition statement unobtainable.
Another aspect of this the Player can only change the units if you give him Base Upgrade over the units. There is not a replace option that I know of that works in lua.
I spent many hours trying to figure this out in the Patton Campaign. When I went through the base upgrades, I would go heavy with the 155mm guns and a couple of 90mm AA in the last positions. Because the missions might reinforce a certain way... I never knew where these guns would show up... It was frustrating when I knew I needed three 155's and had only one with two 90mm. After breaking down the IDs, I could set what I wanted when and where. After losing the 155s to a tank rush or incoming artillery, you learn to shoot and move... The 90mm are much better for tank attack than AA guns. Go figure...
|
|