how to make a custom campaign button using shell builder ?

Started by wsa30h, May 20, 2020, 12:34:07 PM

Previous topic - Next topic
how do i make a new button on the campaign to give an entirely new era ?
mods and maps in progress:<br />--Bf1 expanded edition 3.0 version
-- bf1 tcw battles
-- bf1 seasons mod season 1
-- bf2 expanded edition tbh

May 22, 2020, 10:12:46 AM #1 Last Edit: May 22, 2020, 01:02:28 PM by Dark_Phantom
Answered in discord, but for posterity's sake:
It's in ifs_sp: you're going to have to trace around and look at how BF1 calls it.  ifs_sp goes to ifs_sp_briefing, which then references the new campaign.
You have to follow the logic - when you click the campaignCW button, it goes to ifs_sp_briefing, which then does the logic on which campaign in Missionlist to select. So there's 3 files you have to edit off the bat for a custom campaign.

Edit:
Rough campaign button tutorial:
add campaign button:
Under ifs_sp.lua
ifs_sp_vbutton_layout - add another entry to buttonlist
Scroll down to Input_Accept, and add another elseif (this.Curbutton == "same button name as before"), copy and paste meta/historical code from other campaign and change ifs_sp_briefing.era to your campaign name like this:
ifs_sp_briefing.era = "random"

ifs_sp_briefing.lua
Find ' this.era == "new" ', change code here to reflect adding a third:
if(this.era == "new") then
this.iCampaignNum = 1
elseif (this.era == "classic") then
this.iCampaignNum = 2
else
--assert(0) -- uhoh!
                    this.iCampaignNum = 3
end


Also do this:

if(this.iCampaignNum == 1) then
gCurCampaign = SPCampaign_CW
elseif (this.iCampaignNum == 2) then
gCurCampaign = SPCampaign_GCW
            elseif (this.iCampaignNum == 3) then
                gCurCampaign = SPCampaign_yournamehere
end


Also go down to this.CurButton == "new", scroll down and add another elseif, same as the one above it, change this.CurButton to the button name from earlier

Then go to missionlist and create your campaign, using SPCampaign_CW as a baseline (copy it and edit it)

This code should really be used for academic purposes and not for a released mod until it can be refined and made extensible.
The BOBclan:  A Rich History


Quote from: Unit 33 on November 29, 2014, 03:44:44 AM
'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

i dont know what am doing wrong but the new button doesent show. you wouldnt happen to have the one you edited for your randomizer campaign so i can look over it ?  :bye:
mods and maps in progress:<br />--Bf1 expanded edition 3.0 version
-- bf1 tcw battles
-- bf1 seasons mod season 1
-- bf2 expanded edition tbh