Page 1 of 1
Saving/loading additional (separate) camapaigns
Posted: Sat Oct 31, 2009 4:42 pm
by Teancum
The closest thing I've found is Zerted's save/load scripts, which might do just what I need, but I'm curious about separate mini-campaigns I could possibly add from the shell. Doing the shell-side stuff and missions isn't difficult, but I don't know if I can actually save/load totally separate campaign files.
Re: Saving/loading additional (separate) camapaigns
Posted: Sun Nov 01, 2009 3:25 am
by Maveritchell
I'm not sure entirely what you're trying to do, but you don't need to create something special to save/load if you're just using a stock setup. You can use a shell addon (i.e. a custom GC) with the 1.3 patch to load in a custom campaign, which you can save like any stock campaign sequence. Or so I understand, I haven't tried it yet.
Re: Saving/loading additional (separate) camapaigns
Posted: Sun Nov 01, 2009 4:33 pm
by Teancum
Dang -- this is for the Xbox, which means no 1.3 patch. Guess I'll keep looking into it. It was more for a mini-campaign (Smuggler mode) than a GC thing.
Re: Saving/loading additional (separate) camapaigns
Posted: Sun Nov 01, 2009 4:40 pm
by Frisbeetarian
Which files are you able to edit again? Also, just to clear things up, campaigns and GCs are basically the same thing.
Re: Saving/loading additional (separate) camapaigns
Posted: Sun Nov 01, 2009 6:12 pm
by [RDH]Zerted
Campaigns and Galactic Conquest (metagames) are almost exactly the same thing. Their main difference is that one uses the ScriptCB functions with 'Campaign' in its name and the other uses 'Metagame' in the function's name.
The SaveAndLoadUtils has no dependences. It can run without modifications to the shell, ingame, or common. However metagames use the metagame state which is also what SaveAndLoadUtils uses. Unless you back that table up and restore it right afterwards, using SaveAndLoadUtils inside a metagame/GC will mess everything up (or you could edit SaveAndLoadUtils to use campaign states).
There were only two changes needed to support custom Galactic Conquests. First, change where the button list is generated into a function call. Each new cGC should override this function to add in its button data into the returning table. Next, add a new function into where the button presses are handled. Each new cGC should override this function to determine when its button was pressed. If you name the new functions custom_GetGCButtonList and custom_PressedGCButton, then you can use the v1.3 cGC templates.
At the time, I didn't think of adding in support for custom Campaigns. In theory, the shell changes should be almost exactly the same as in cGCs. However, I think campaigns only use campaign states. If so, the SaveAndLoadUtils will work fine within it.
In saving metagames, SWBF2 just stores the game's main table. I would assume the same is for Campagins. If so, there is nothing extra you need to do once the campaign has loaded.
Re: Saving/loading additional (separate) camapaigns
Posted: Sun Nov 01, 2009 8:36 pm
by Teancum
Yeah, but what exactly differentiates a custom campaign from the shipped 501st? I don't really need any GC stuff - I just wanted to do a mini-campaign where you need to smuggle things from several planets, one at a time, in a linear order, one unlocking after the other - just like in the shipped campaign - just separate.
Re: Saving/loading additional (separate) camapaigns
Posted: Sun Nov 01, 2009 11:42 pm
by [RDH]Zerted
Like I said, I'm not sure why I never looked closely at Campaigns so I don't know all their details. Skimming through the code, it seems the push screen sequence roughly follows:
ifs_sp
ifs_sp_briefing
ifs_freeform_rise_newload
or
ifs_sp_campaign
and
ifs_campaign_main (or ifs_campaign_load if loading an existing campaign)
ifs_campaign_turn_intro
ifs_campaign_battle
ifs_campaign_battle_card
ifs_campaign_battle_intro (plays intro movie, then ScriptCB_EnterMission() to load the set map)
I'm not exactly sure what ScriptCB_SetSPProgress( num1, num2 ) does. A quick guess is the first parameter is the Campaign number and the second number is that Campaign's progress, but thats just a bad guess.
The Campaign mission sequence is stored in ifs_campaign_data's ifs_campaign_mission table. The scripts just go to the next index at each Campaign 'turn'.
A really cheap/poor way of supporting Custom Campaigns would be to replace that mission table with your own whenever the player clicks on your Campaign button.
Re: Saving/loading additional (separate) camapaigns
Posted: Mon Nov 02, 2009 2:34 pm
by Teancum
Hmmm -- that might be an option. Thanks for the ideas.