Disclaimer: Just a heads-up, before you read anything - this tutorial is not for beginners. I am going to clearly write out anything you need to do this and you should be able to walk this through with only a brain and fingers to your name, but there is a good chance that you will get confused if you do not have a good foundational grasp of setting up SWBF2 .lua files.
First know how to add additional modes manually (editing addme.lua, mission.req, adding mission-specific .req files). If you don't know this, you should learn now.
This tutorial will focus on adding the "conquest" gamemode to your map. Hero support is much simpler, as it doesn't use any of the random/AI features this does, and wave is a custom mode made for each map.
Addme.lua editing
Right after the function AddNewGameModes is defined, add the line:
[code]function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
for flag, value in pairs(newFlags) do
mission[flag] = value
end
end
end
end
Make sure the rest of your addme.lua is set up correctly.
Setting up the additional .lua files:
In addition to setting up your ABC1_con.req file (mission-specific .req) and adding ABC1_xxx to your mission.req, you will also need to call for additional scripts in your mission .req to fully use "The Dark Times" sides.
Take the two .lua files (remember, the AIHeroSupport script was made by archer01, and if you use it you need to credit him too) and move them into your "data_ABC\Common\scripts" folder. Open up your mission.req and add "AIHeroSupport" and "TFURandom" to the list of scripts called at the beginning:
This reads the localizations from "The Dark Times."
Proceed down towards the end of the ScriptPostLoad section (before "end"). This is essentially just how you set up hero support (and as such is covered in more detail in archer's tutorial), but note that you will need to add the hero support like this:
Hidden/Spoiler:
[code]if not ScriptCB_InMultiplayer() then
herosupport = AIHeroSupport:New{AIATTHeroHealth = 4000, AIDEFHeroHealth = 4000, gameMode = "NonConquest",}
herosupport:SetHeroClass(ALL, herostrAll)
herosupport:SetHeroClass(IMP, herostrEmp)
herosupport:AddSpawnCP("CP1","CP1SpawnPath")
herosupport:AddSpawnCP("CP2","CP2SpawnPath")
herosupport:AddSpawnCP("CP3","CP3SpawnPath")
herosupport:AddSpawnCP("CP4","CP4SpawnPath")
herosupport:AddSpawnCP("CP5","CP5SpawnPath")
herosupport:AddSpawnCP("CP6","CP6SpawnPath")
herosupport:Start()
else
end [/code]
This is part of what makes sure AI heroes don't show up (and mess up) multiplayer. Note also that you're redefining your CPs here as well as their spawnpaths.
Move down to just inside ScriptInit. You will first need to add this section:
(This can be just about the first thing in ScriptInit)
This has several new features for Dark Times II: Rising Son. The first variable is "gcwera," which is used to give the probability of the time period being either before ANH or after ANH.
DecideUnits is a function that sets the probability of certain units showing up in the pre-ANH time period. The order of the numbers as they relate to each unit is as follows:
You can use this to tweak each map so that if - for example - you don't want Yoda showing up very often on a certain planet, you can set everyone else to a higher value (higher the number the more likely they show). The two versions of Starkiller (light and dark) are not set to show up on the same planet. Neither will Shaak Ti and Maris Brood. If one of these pairings does occur, one of the heroes will be changed to someone else.
DecideUnitsANH is another function similar to DecideUnits, except it is used to set the probability of the certain units showing up in the post-ANH time period. The order of the numbers as they relate to each unit is as follows:
Like in the function DecideUnits, the two versions of Starkiller will not show up at the same time.
Below those, you will see several lines that set basic infantry units for the specific time periods. These should be left alone. Likewise, there is a special line that sets the Bothan Spy to an online or offline version, this should be likewise left alone.
Lower in that same part, where you see "herostrAll..." etc. set is where you will define the heroes and hero support for multiplayer games (where they cannot be random). Each hero has a specific partner that you should (although do not have to) assign to them:
(Light side) Marek and Kota have the elite, Bail has the guard, Old Ben has the clone, Shaak Ti and Maris Brood have the Felucian, Yoda has the Wookiee, (Dark side) Marek and Vader have the commander, the shadow guard has the shadow trooper, and Palpatine has the royal guard.
The heroes for the post-ANH time period have similar requirements. Luke Skywalker should have the Rogue repulsor trooper, Han Solo and Col Serra should have the Renegade Squadron trooper, Galen Marek should have the elite, Vace Thermill the spec ops trooper, Leia the medic, Chewbacca the Rebel tech, Sith Stalker and Darth Vader (post-ANH) should have the ANH stormtrooper commander, Fett the incinerator trooper, Mara Jade and Dengar the storm commando, Bossk the radtrooper, and IG-88 the Imperial tech.
The next thing you should add should be the combo memorypools - this is imperative as there will always be at least two melee unit types (heroes or infantry) on the field at all times:
Hidden/Spoiler:
[code] SetMemoryPoolSize ("ClothData",20)
SetMemoryPoolSize ("Combo",30) -- should be ~ 2x number of jedi classes
SetMemoryPoolSize ("Combo::State",500) -- should be ~12x #Combo
SetMemoryPoolSize ("Combo::Transition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Condition",500) -- should be a bit bigger than #Combo::State
SetMemoryPoolSize ("Combo::Attack",400) -- should be ~8-12x #Combo
SetMemoryPoolSize ("Combo::DamageSample",4000) -- should be ~8-12x #Combo::Attack
SetMemoryPoolSize ("Combo::Deflect",88) -- should be ~1x #combo
[/code]
Right after that, you'll see where your .lua loads the stock ingame.lvl. Before that line, add in the following:
This will make sure that the custom effects that go along with "The Dark Times" are loaded into your mod/map (if you are using these sides, you should be loading these).
Before you go on to adding units, look at where sound is added. You will want to add in these lines:
This will make sure that the CW-related sounds and some new sounds necessary for this mod are loaded in correctly. I spent a lot of time making sure that correct sounds showed up everywhere, so if you're wondering how to get a certain sound setup or if you have sounds not working quite right for something related to this, feel free to ask (there were some "addon" sound .lvls I had to make to make certain maps work correctly with certain vehicles, as well as making sure saber sounds appear for all the GCW sound .lvls).
Next you will want to load your units. The ReadDataFile section in ScriptInit should have this:
if ScriptCB_InMultiplayer() then
SetHeroClass(ALL, herostrAll)
SetHeroClass(IMP, herostrEmp)
else
end[/code]
Note that in "The Dark Times," the Navy Commando (imp_inf_commando) and the Imperial Gunner (imp_inf_gunner) used the same slot; some maps had the commando and some had the gunner but they were never on the same map.
It is also always wise to set your SoldierAnimation memory pool up high at this time.
--------
That's all you need! It's more complicated than adding regular conquest, to be sure, but I'm sure you'll agree that it's probably worth it. If you have any questions, I'm happy to answer, but please, if you're not sure what you're doing it might be best if you save yourself (and myself!) the time and get some confidence putting together map .luas and/or adding new modes manually first.
You can also add extra scripting in your addme.lua that checks to see whether "The Dark Times" exists on the user's computer (preventing this era from showing up as an option to someone who doesn't have the mod installed), but that is covered in other topics. You would do well to look that up and learn, though.
Here is a full list from the "dark.lvl" (infantry) side's .req file:
Here is a full list of the vehicles side (tfuvehicles.lvl), although one should keep in mind that stock vehicles may have special requirements to load in (see some below posts), and all vehicles will need the appropriate sounds:
There are several space vehicles appended with the _ai suffix; you can ignore these as those vehicles are designed to be used only as AI-autopiloted vehicles. There is a TIE Advanced vehicle loaded in there as well that is never used in the mod itself (only the AI autopiloted version was used in Space Anoat), but it should work fine.
RC-1207 wrote:I don't care if you stated this ain't for new people, just tell me how to read an lvl file.
Uhhh really? The fact that you flat out said "I don't care" makes me want to slap you with a warning right now. That attitude will get you shown the door real quick. Shape up.
Skyhammer_216 wrote:Hey Mav could you post a list of the tfuvehicle names???
Oh and a question:
Shouldn't this:
if ScriptCB_InMultiplayer() then
SetHeroClass(ALL, herostrAll)
SetHeroClass(IMP, herostrEmp)
else
end
be this?
if not ScriptCB_InMultiplayer() then
SetHeroClass(ALL, herostrAll)
SetHeroClass(IMP, herostrEmp)
else
end
It's just I did it the first way and the heroes didn't load......
No, it should not. Heroes are only loaded that way if it's an MP game; otherwise they are loaded with the herosupport section in the ScriptPostLoad. Make sure everything's there, that you have the right .luas in the right place, that they are loaded... etc. Just doublecheck every step.
Vehicle names are the same as stock vehicles (since I wanted to, for the most part, load them with stock vehicle spawns). They load from "tfuvehicles.lvl" and "tfuspace.lvl." Let me know if you're trying to load a specific (environment) AT-ST and it's not working, or if you want to load an IFT-X (by default that is replaced with a jungle AT-ST in tfuvehicles.lvl).
Skyhammer_216 wrote:Hey Mav could you post a list of the tfuvehicle names???
Oh and a question:
Shouldn't this:
if ScriptCB_InMultiplayer() then
SetHeroClass(ALL, herostrAll)
SetHeroClass(IMP, herostrEmp)
else
end
be this?
if not ScriptCB_InMultiplayer() then
SetHeroClass(ALL, herostrAll)
SetHeroClass(IMP, herostrEmp)
else
end
It's just I did it the first way and the heroes didn't load......
No, it should not. Heroes are only loaded that way if it's an MP game; otherwise they are loaded with the herosupport section in the ScriptPostLoad. Make sure everything's there, that you have the right .luas in the right place, that they are loaded... etc. Just doublecheck every step.
Vehicle names are the same as stock vehicles (since I wanted to, for the most part, load them with stock vehicle spawns). They load from "tfuvehicles.lvl" and "tfuspace.lvl." Let me know if you're trying to load a specific (environment) AT-ST and it's not working, or if you want to load an IFT-X (by default that is replaced with a jungle AT-ST in tfuvehicles.lvl).
Well since I didn't initially use the hero support bit that makes sense. Thanks.
Oh and I'm assuming atsts have the normal environment variations ie plain, jungle, snow?
Skyhammer_216 wrote:Oh and I'm assuming atsts have the normal environment variations ie plain, jungle, snow?
Yes. The only things that will be different from normal are listed below.
From tfuvehicles.lvl:
imp_hover_combatspeeder = AT-ST (forest/jungle)
imp_walk_atst = AT-ST (forest/jungle)
From ift.lvl:
imp_walk_atst = normal AT-ST (I don't think this texture is ever used in stock SWBF2)
imp_hover_combatspeeder = IFT-X
RC-1207 wrote:I don't care if you stated this ain't for new people, just tell me how to read an lvl file.
Uhhh really? The fact that you flat out said "I don't care" makes me want to slap you with a warning right now. That attitude will get you shown the door real quick. Shape up.
Sorry, I had a bad day. Forgive me and it won't happen again. Thank for the warning at least.
really sorry for the bump, but I just had a quick question on this. The lvl files in the download, those should just go in their appropriate folders in the Addon/***/data folder correct?
No, I do not know why I even included those in the download. If you just follow the instructions above, all localizations (etc.) will be loaded directly from the "BDT" addon folder. The only things you need from that download are the two .lua files, which go where the instructions say.
The first post has been updated to reflect the new content available in Dark Times II: Rising Son. The directions are slightly more complicated, but there is a lot more content available for you to add in to your own mod.
lucasfart wrote:Awesome! I've been planning on asking you about this ever since Rising Son came out .
I would have done it immediately, but I needed access to my modding computer to cross-reference any information I put up. As mentioned in the release topic, my power supply fried itself last week, and so I had to wait until a new power supply came in the mail.