SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: wsa30h on May 20, 2020, 12:34:07 PM

Title: how to make a custom campaign button using shell builder ?
Post by: wsa30h on May 20, 2020, 12:34:07 PM
how do i make a new button on the campaign to give an entirely new era ?
Title: Re: how to make a custom campaign button using shell builder ?
Post by: Dark_Phantom on May 22, 2020, 10:12:46 AM
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.
Title: Re: how to make a custom campaign button using shell builder ?
Post by: wsa30h on May 22, 2020, 01:44:48 PM
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:
EhPortal 1.34 © 2024, WebDev