How to add "Rising Son" to your mod
Moderator: Moderators
33 posts
• Page 1 of 2 • 1, 2
- Maveritchell
-
- Posts: 7421
- Joined: Mon Aug 21, 2006 11:03 pm
How to add "Rising Son" to your mod
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:
It will look like this:
You will now need to edit what you're adding, find the part that lists your map/s and add in:
You will also need to add in a change parameter (a function of the 1.3 Patch, r117). This follows after your modes have been defined:
All in all, an example of this could look like this:
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.
First, download this: http://www.mediafire.com/?jdyp2m9tj5qpam3
http://www.filefront.com/17159566/DT2add.zip (broken - take first link)
[This is updated for Dark Times II: Rising Son. If you've downloaded the previous version, you will need to now download this version as the TFUrandom.lua script has been updated.]
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:
Now you're ready to edit your mission .lua.
Mission .lua editing
Open up your ABC1_con.lua. Make your top look like this (note that ALL and IMP need to be globally and not locally defined):
Just below that, add in this:
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:
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:
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:
This makes sure you can load the files from "The Dark Times" without having to duplicate them in your own sides folder.
Your SetupTeams is next, it should look like this:
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 "lead.lvl" (Jedi heroes) 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:
And finally here is a full list of the space vehicles (dtspace.lvl), which will also need to have their appropriate sounds if you use them:
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.
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: Select all
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\dtshell.lvl")
It will look like this:
Hidden/Spoiler:
You will now need to edit what you're adding, find the part that lists your map/s and add in:
- Code: Select all
era_1 = 1
You will also need to add in a change parameter (a function of the 1.3 Patch, r117). This follows after your modes have been defined:
- Code: Select all
change = {
era_1 = { name="Dark Times", icon2="darktimes_icon" },
},
All in all, an example of this could look like this:
Hidden/Spoiler:
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.
First, download this: http://www.mediafire.com/?jdyp2m9tj5qpam3
http://www.filefront.com/17159566/DT2add.zip (broken - take first link)
[This is updated for Dark Times II: Rising Son. If you've downloaded the previous version, you will need to now download this version as the TFUrandom.lua script has been updated.]
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:
Hidden/Spoiler:
Now you're ready to edit your mission .lua.
Mission .lua editing
Open up your ABC1_con.lua. Make your top look like this (note that ALL and IMP need to be globally and not locally defined):
Hidden/Spoiler:
Just below that, add in this:
- Code: Select all
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\core.lvl")
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:
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)
Hidden/Spoiler:
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:
- Code: Select all
bail, kota, oldben, marekimp, marekall, shaakti, shadow, yoda, sidious, vader, maris
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:
- Code: Select all
vader, sidious, shadow, stalker, fett, dengar, jade, kota, skywalker, solo, colserra, marek, yoda, vace
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:
Right after that, you'll see where your .lua loads the stock ingame.lvl. Before that line, add in the following:
- Code: Select all
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\ingame.lvl")
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:
- Code: Select all
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\sound\\tes.lvl;tescw")
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\sound\\bgl.lvl;bglgcw")
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:
Hidden/Spoiler:
This makes sure you can load the files from "The Dark Times" without having to duplicate them in your own sides folder.
Your SetupTeams is next, it should look like this:
Hidden/Spoiler:
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:
Hidden/Spoiler:
Here is a full list of the "lead.lvl" (Jedi heroes) side's .req file:
Hidden/Spoiler:
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:
Hidden/Spoiler:
And finally here is a full list of the space vehicles (dtspace.lvl), which will also need to have their appropriate sounds if you use them:
Hidden/Spoiler:
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.
Re: How to add "The Dark Times" to your mod
'Scuse me a second.
Anyway will get to work adding DT compatability to DS maps. You're the man Mav.
Hidden/Spoiler:
Anyway will get to work adding DT compatability to DS maps. You're the man Mav.

- RC-1207
- Private Second Class
-
- Posts: 63
- Joined: Thu Mar 26, 2009 11:54 pm
- Location: BFII: [merc]_RC-1207[sniper]
Re: How to add "The Dark Times" to your mod
I don't care if you stated this ain't for new people, just tell me how to read an lvl file.
- Maveritchell
-
- Posts: 7421
- Joined: Mon Aug 21, 2006 11:03 pm
- Teancum
-
- Posts: 11087
- Joined: Wed Sep 07, 2005 11:42 pm
- Location: Indiana
- Projects :: No Mod project currently.
- Games I'm Playing :: Destiny
- xbox live or psn: No gamertag set
Re: How to add "The Dark Times" to your mod
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.
Re: How to add "The Dark Times" to your mod
Hey Mav could you post a list of the tfuvehicle names???
Oh and a question:
Shouldn't this:
be this?
It's just I did it the first way and the heroes didn't load......
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......
- Maveritchell
-
- Posts: 7421
- Joined: Mon Aug 21, 2006 11:03 pm
Re: How to add "The Dark Times" to your mod
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).
- Teancum
-
- Posts: 11087
- Joined: Wed Sep 07, 2005 11:42 pm
- Location: Indiana
- Projects :: No Mod project currently.
- Games I'm Playing :: Destiny
- xbox live or psn: No gamertag set
Re: How to add "The Dark Times" to your mod
Just glancing at the code I had wondered the same thing. Looking at it again that makes sense.
Re: How to add "The Dark Times" to your mod
Maveritchell wrote: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?
- Maveritchell
-
- Posts: 7421
- Joined: Mon Aug 21, 2006 11:03 pm
Re: How to add "The Dark Times" to your mod
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
- Private Second Class
-
- Posts: 63
- Joined: Thu Mar 26, 2009 11:54 pm
- Location: BFII: [merc]_RC-1207[sniper]
Re: How to add "The Dark Times" to your mod
Teancum wrote: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.
Re: How to add "The Dark Times" to your mod
is there a list of what each vehicle actually is, like the names.
- Teancum
-
- Posts: 11087
- Joined: Wed Sep 07, 2005 11:42 pm
- Location: Indiana
- Projects :: No Mod project currently.
- Games I'm Playing :: Destiny
- xbox live or psn: No gamertag set
Re: How to add "The Dark Times" to your mod
Yes, two posts above yours. 

Re: How to add "The Dark Times" to your mod
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?
- Maveritchell
-
- Posts: 7421
- Joined: Mon Aug 21, 2006 11:03 pm
Re: How to add "The Dark Times" to your mod
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.
- Maveritchell
-
- Posts: 7421
- Joined: Mon Aug 21, 2006 11:03 pm
Re: How to add "The Dark Times" to your mod
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.
- Darth_Spiderpig
-
- Posts: 2728
- Joined: Fri Mar 27, 2009 10:23 am
- Location: Does whatever a Spiderpig does
- Projects :: Something cool...
- Games I'm Playing :: BF2 CoDBO BFBC2
- xbox live or psn: Has no xbox....Yup
Re: How to add "Rising Son" to your mod
Y-A-Y.
Thanks a bunch Mav, so finally I can use the Y-Wing.

EDIT:
haha, just realised Mav double-posted.
Thanks a bunch Mav, so finally I can use the Y-Wing.


EDIT:
haha, just realised Mav double-posted.

Last edited by Darth_Spiderpig on Sat Jul 31, 2010 6:09 pm, edited 1 time in total.
Re: How to add "Rising Son" to your mod
Awesome! I've been planning on asking you about this ever since Rising Son came out
.

- Maveritchell
-
- Posts: 7421
- Joined: Mon Aug 21, 2006 11:03 pm
Re: How to add "Rising Son" to your 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.
33 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest