SWBFGamers

Modding for the Original SWBF1 and SWBF2 => SWBF1 Modding => Topic started by: wsa30h on July 14, 2020, 10:18:54 AM

Title: how to edit custom campaign name above planet ? (solved)
Post by: wsa30h on July 14, 2020, 10:18:54 AM
i tried everything added the entries in the same way and place as the stock campaigns tried changing my campaign name and reference a stock nothing works all i get is stupid question marks above the planet. something else must reference it outside of the shell and core lvl but what ?
Title: Re: how to edit custom campaign name above planet ?
Post by: Dark_Phantom on July 14, 2020, 11:05:06 AM
[spoiler]ifs_sp_briefing
Code (lua) Select
for k,v in metagame_state.planets do
if(Planet3 == v.MapName) then
gCurCampaign[i].PlanetStr = v.LocalizeName
end
end
in metagame_state
Code (lua) Select
planets = {
bespin = {
-- constants
MapName = "BES", -- 3-char name for base map name
LocalizeName = "planets.bespin.name",
-- fnGetBonusText = metagame_state_fnGetBonusText_bespin,
chargemax = 1,
ShortBonusText = "planets.bespin.shortbonus",
LongBonusText = "planets.bespin.longbonus",
MapName1 = "planets.bespin.mapname1", -- localization key to first map
MapName2 = "planets.bespin.mapname2", -- localization key to second map
RotateSpeed = 0.5,
ModelScale = 0.183,
BonusType = "Sabotage",

-- variables (must be saved)
-- owner = 0, -- 0= unassigned, 1 = left, 2 = right
charge = 1, -- charge level
pickorder = 2, -- 1 = picked first, 2 = second, etc
}, add your planet here
[/spoiler]

I traced the screen ifs_sp_briefing, which showed me that your string is gCurCampaign[i].PlanetStr.  It's looping through Metagame_state.planets (this second section) to find a name.  You don't need all the stuff it calls for metagame code, all you should need to add is mapname and localizename.
Title: Re: how to edit custom campaign name above planet ?
Post by: wsa30h on July 14, 2020, 11:11:16 AM
thanks phantom i will let you know if it works after i try this i have a feeling it might.
Title: Re: how to edit custom campaign name above planet ?
Post by: wsa30h on July 14, 2020, 11:28:07 AM
thank you so much phantom it works perfectly.
EhPortal 1.34 © 2024, WebDev