Author Topic: how to make a custom campaign button using shell builder ?  (Read 133 times)

wsa30h

  • casual cross era map maker
  • Advanced Member
  • *****
  • Posts: 609
    • View Profile
    • Awards
how do i make a new button on the campaign to give an entirely new era ?

Dark_Phantom

  • The Official Ghost
  • Administrator
  • This Man Has No Life
  • *****
  • Posts: 1349
  • Awards SWBFspy SWBF1-Player of the Month To recognize Modders that make a most excellent contribution within the Month A member of the winning team of ICW6 Administered events in ICW5 A member of the winning team of ICW5 Special Award for those that play the original SWBF ICW4 Participant Recognizes someone who most generously donated funds to the site or the site ICW3 Participant
    • View Profile
    • The BOBclan
    • Awards
  • PSN: phantom567459
  • Steam ID:
  • Origin ID: phantom567459
Re: how to make a custom campaign button using shell builder ?
« Reply #1 on: May 22, 2020, 11: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:
Code: [Select]
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:
Code: [Select]
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.
« Last Edit: May 22, 2020, 02:02:28 PM by Dark_Phantom »
The BOBclan:  A Rich History


'Please, tell me more about the logistics of the design of laser swords being wielded by space wizards' - Some guy on the internet.

wsa30h

  • casual cross era map maker
  • Advanced Member
  • *****
  • Posts: 609
    • View Profile
    • Awards
Re: how to make a custom campaign button using shell builder ?
« Reply #2 on: May 22, 2020, 02: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:

 

SimplePortal 2.3.7 © 2008-2020, SimplePortal