"Have you ever dreamed of making your own campaign series for SWBF2, only to give up because lack of support? Well now youcan with this magical [unexplained] folder that gives you the opportunity to make that dream come true!" - Random Commercial Guy
Because this is such a random release, I couldn't think of any other way to introduce this. The mod gives custom campaigns for SWBF2 their own
dedicated menu, and it saves progress for them as well. To add your campaign with the support of ZE_ccsupport, read the tutorial below.
Readme:
Hidden/Spoiler:
-------------- ZE_ccsupport (v1) --------------
ZE_ccsupport allows for custom campaigns in SWBF2.
Install:
- Place in addon folder (reverse process to uninstall)
Changes/Adds:
- Ordered the "Load" and "Start Campaign" buttons above the "Campaign List" button
- Single player campaign menu has "Added Campaigns" button
- Added "Added Campaigns" menu; dropdown list of downloaded campaigns
- Added "Battlecard" menu; serves as a launcher to custom campaigns
Info:
- Saves are automatically generated, and they do not need to be loaded through the
-- campaign menu's loading menu. However, the campaign loading menu allows you to
-- access your saved games. DO NOT LOAD THEM, only delete. All auto generated saves
-- are named in this fashion <playername><campaign>_ccsupport.
DISCLAIMER: THIS MOD IS NOT MADE, DISTRIBUTED, OR SUPPORTED BY LUCASARTS, A DIVISION OF LUCASFILM ENTERTAINMENT COMPANY LTD. ELEMENTS TM & (C) LUCASARTS, A DIVISION OF LUCASFILM ENTERTAINMENT COMPANY LTD.
[code]if cc_campaign_missions == nil then -- Important, this block creates the tables if they don't exist already
cc_campaign_missions = {}
cc_missions = {}
cc_n = 0 else
cc_n = table.getn(cc_campaign_missions)
end -- End of that
-- Add Campaign to list
cc_campaign_missions[cc_n+1] = {
screen = "", -- Your campaign's unique name. NO SPACES or PUNCTUATION (be safe and only use abcs and numbers)
showstr = "", -- Your campaign's unique title. (The name seen in the dropdown)
[1] = { -- This subtable is designated 1 (mission 1); for each additional mission increase by one
preview = "", -- Preview image (tga: 512x256); load in your shell.lvl
desc = "", -- Description (196 characters max); use string if you like (localize), but you can write it here
name = "", -- Name (??? characters max); use string if you like (localize), but you can write it here
lua = "", -- Name of LUA script
}, -- end of subtable
}
cc_n = nil[/code]
You will need to fill in the quotations. Leave every thing else as it is. Example:
Hidden/Spoiler:
[code]if cc_campaign_missions == nil then
cc_campaign_missions = {}
cc_missions = {}
cc_n = 0 else
cc_n = table.getn(cc_campaign_missions)
end
-- Add Campaign to list
cc_campaign_missions[cc_n+1] = {
screen = "the_old_republic",
showstr = "The Old Republic",
-- recursively merges the second given table into the first given table
function MergeTables( mission, newFlags )
--for each table entry,
local array = type({})
for key,value in pairs(newFlags) do
--check for nested tables
if type(value) == array then
--mission must have this key as a table too
if type(mission[key]) ~= array then
mission[key] = {}
end
--merge these two tables recursively
MergeTables(mission[key], value)
else
--the key is a simple variable, so simply store it
mission[key] = value
end
end
end
--Search through the missionlist to find a map that matches mapName,
--then insert the new flags into said entry.
--Use this when you know the map already exists, but this content patch is just
--adding new gamemodes (otherwise you should just add whole new entries to the missionlist)
function AddNewGameModes(missionList, mapName, newFlags)
for i, mission in missionList do
if mission.mapluafile == mapName then
MergeTables(mission, newFlags)
end
end
end
--insert totally new maps here:
ReadDataFile("..\\..\\addon\\TOR\\data\\_LVL_PC\\shell.lvl")
local sp_n = 0
local mp_n = 0
sp_n = table.getn(sp_missionselect_listbox_contents)
--add my modes to the singleplayer map selection screen
-- associate this mission name with the current downloadable content directory
-- (this tells the engine which maps are downloaded, so you need to include all new mission lua's here)
-- first arg: mapluafile from above
-- second arg: mission script name
-- third arg: level memory modifier. the arg to LuaScript.cpp: DEFAULT_MODEL_MEMORY_PLUS(x)
-- Now load our core.lvl into the shell to add our localize keys
ReadDataFile("..\\..\\addon\\TOR\\data\\_LVL_PC\\core.lvl")
[/code]
Now all you need to do is load the scripts through the mission REQ file like an era or game mode mod.
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Wed Jan 28, 2015 11:53 pm
by AQT
Good to see you were able to figure everything out, Nedarb! Great work!
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Thu Jan 29, 2015 1:50 am
by hunpeter12
Yeah! Custom campaigns here I come!
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Thu Jan 29, 2015 3:56 am
by Anakin
i'm a bit confused. wasn't thtat possible before, too?? as far as i remember there were a campaign for dt without this. So i think i don't really understand what this mod here is good for.
Or maybe i haven't read/understand all from your intro text
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Thu Jan 29, 2015 11:22 am
by Nedarb7
What Mav did for DT was a galactic conquest that he very successfully managed to make in a campaign fashion. Here's what's different (from readme):
Changes/Adds:
- Ordered the "Load" and "Start Campaign" buttons above the "Campaign List" button
- Single player campaign menu has "Added Campaigns" button
- Added "Added Campaigns" menu; dropdown list of downloaded campaigns
- Added "Battlecard" menu; serves as a launcher to custom campaigns
We could always make custom campaigns, either through GC or IA, but they were never their own dedicated thing, which is what this does. Both GC and IA weren't really designed for campaign. While a GC campaign can be done, from what I understand there is a limit of 11, and it can't be done directly from the project's folder. Further, IA campaigns lacked any form of saved progress, making it more of an objective game mode. So basically what this does is gives modders a campaign format for custom campaigns instead of using a GC or game mode in IA.
plus it's easy
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Thu Jan 29, 2015 11:59 am
by hunpeter12
However, in GC you can have a choice of which planet you want to continue with, like in DT.
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Thu Jan 29, 2015 1:02 pm
by Maveritchell
For what it's worth, I only used GC as a fall-back plan. I think it eventually made for a more unique experience overall, but I would've used something like this had I figured it out (which I didn't). Kudos, Nedarb - this is really nice work.
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Thu Jan 29, 2015 1:07 pm
by Anakin
Sounds great
Maybe i'll give that a try after my CGC will work
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Thu Jan 29, 2015 1:16 pm
by GAB
This is great!
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Fri Jan 30, 2015 2:20 pm
by [RDH]Zerted
Another shell enhancement. Yay.
Did you use SaveAndLoadUtils.lua for the saving/loading or something else?
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Fri Jan 30, 2015 9:37 pm
by jedimoose32
This is excellent - actually my current project is a new campaign so this is well-timed indeed. Thanks for working hard on this and releasing it Nedarb!
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Fri Jan 30, 2015 9:55 pm
by Nedarb7
[RDH]Zerted wrote:Another shell enhancement. Yay.
Did you use SaveAndLoadUtils.lua for the saving/loading or something else?
No I didn't, but I used it as one of my references. (The stock scripts had it scattered around various different scripts which got a little overwhelming after a while, so it was nice to see a working save system set up all together.) What I needed to do for this project was figure out how to work saving through the ScriptCB functions since Battlefront's saving works through a menu, erasing important variables from my menu. I narrowed it down to about eight functions that exist, and they are managed through the battlecard menu.
SaveAndLoadUtils is great btw, it helps a bunch with one of my game mode mods.
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Tue Feb 17, 2015 7:08 pm
by willinator
Wow, this is great Nedarb! I was just wondering, is it possible to have a campaign with this tool, without the preview screens in-between missions, and yet still have the saving take place. What I'm suggesting is this: Player finishes mission 1, next mission starts automatically. If the player quits to the menu, the game has saved their progress, just like the stock campaign (minus pause screens).
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Tue Feb 17, 2015 10:03 pm
by Nedarb7
I appreciate the feedback, willinator. What you suggested is actually a feature that was lost during the development of the mod. When I first began this project I had no idea how saving worked, and I hoped that I'd be able to figure it out for the purposes of the mod. That meant I had to do some research (obviously). After digging the code down to the ScriptCB functions I was ready to implement the save feature. There was, however, one problem that I came across. This had to do with one of the two saving ScriptCB functions; it is used to save a state (so keep the information in the game, not save to a file). The issue was that if you have a campaign state saved, you will be immediately sent to the stock campaign mission launcher on returning to the shell. Now, why that matters. In order to keep information from a play sequence, it would be required to save the campaign state at the end of each mission. That means that if I were to return to the main menu I have the option to go to the stock campaign mission launcher (due to the saved campaign state) or lose the information that tells ZE_ccsupport what the outcome of the battle was (if the saved data were to be erased on going to the shell). Which means data can't be saved. Now, the only solution to this was to make the next mission launch right when you return to the shell, mimicking a play sequence. That too had a problem. Since that solution requires returning to the shell, you would have to wait for two loading screens, making it completely pointless.
--- That said ---
It may be possible to work around it through your mission script. The mission list is setup with this function:
The idea is to load the temporary saved data via Zerted's SaveAndLoadUtils, set the next mission name in the current mission with the code above, save over the temporary saved data via Zerted's SaveAndLoadUtils, and end the mission. I could further explain this, but I'm not sure if the second part would work. However, if I understand correctly, something similar or the same thing is/can be done by a server admin. So again, the second part would need to be tested alone before trying anything else.
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Thu Feb 19, 2015 12:55 pm
by Jaspo
Quick question without much thought or reading:
Could this be used to solve the problem of only being able to have 1 custom galactic conquest active at a time?
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Thu Feb 19, 2015 7:38 pm
by lucasfart
From what I can tell it has nothing to do with GC? I'm pretty sure this is meant to be used like the stock campaign following the 501st, not like the galactic conquest mode.
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Fri May 08, 2015 9:04 pm
by [RDH]Zerted
The one cGC limitation is due to a bug in the cGC template. You need to replace
(assuming you're using slot 5. Change the number to whatever it needs to be.). If you do that and the other cGCs do that then you'll have multiple cGCs. I've been too busy to release an official fix (would have to install Windows, setup a SWBF2 dev environment, and do a bunch of testing).
Re: Custom Campaign Support (ZE_ccsupport)
Posted: Tue Feb 27, 2018 6:23 am
by Lako3000
hey guys, ive got a problem with a custom campaign im trying to make, any help would be greatly appreciated.
so i want to just copy and paste the original campaign except just remove some objective and add some sounds to it, but i cant for the life of my, figure out how to munge a map which has the gamemode for campaign, moreso, i tried to follow this guide to add the dropdown for a campaign and it doesnt seem to be doing anything?. did i put my script in the wrong addme? am i supposed to put it into the addme that is in the addon folder of the game?. also, do i do this inside a munged data_ABC or can i copy the maps from assets since thats what i want to use?
im not very good at this modding stuff and im quite new, so be gentle XD thanks for any help