Multiple Galactic Conquest .lvl files
Posted: Thu Sep 10, 2020 7:57 pm
So I have been working on an Era mod and I wanted to include Galactic Conquest. so I read Firefang's tutorial on creating your own galactic conquest with success! However, I ran into the problem when making galactic conquest campains.
See to make a multiple galactic conquest campains you need to have each shell file represent a galactic conquest campain. This is because when you munge the shell.lvl you need to rename it to your galactic conquest for example my republic campagin is "custom_gc_9" then I drag this to my Battlefront 2 _lvl_pc folder, However I want to make a CIS campain as well so I need to rename my "shell" folder to "shell rep" and rename my "shell cis" to "shell" that way it reads my (cis) shell instead and i can rename that to "custom_gc_8" that way I can have both "custom_gc_8" and "custom_gc_9". however when I do this my campaign list shows both campaigns but only the button for my republic campaign functions properly. however when I remove either the "custom_gc_8" or the "custom_gc_9" both the republic and cis campaigns works fine.
"custom_gc_8" Cis Campaign
"custom_gc_9" Republic Campaign
If anyone could explain how to solve this situation that would be much appriciated.
See to make a multiple galactic conquest campains you need to have each shell file represent a galactic conquest campain. This is because when you munge the shell.lvl you need to rename it to your galactic conquest for example my republic campagin is "custom_gc_9" then I drag this to my Battlefront 2 _lvl_pc folder, However I want to make a CIS campain as well so I need to rename my "shell" folder to "shell rep" and rename my "shell cis" to "shell" that way it reads my (cis) shell instead and i can rename that to "custom_gc_8" that way I can have both "custom_gc_8" and "custom_gc_9". however when I do this my campaign list shows both campaigns but only the button for my republic campaign functions properly. however when I remove either the "custom_gc_8" or the "custom_gc_9" both the republic and cis campaigns works fine.
"custom_gc_8" Cis Campaign
Code: Select all
print("custom_gc_8: Entered")
local gcTag = "Separatist Alliance"
local gcString = "Age of Republic: Separatist Alliance"
ScriptCB_DoFile("ifs_freeform_init_precis")
ScriptCB_DoFile("ifs_freeform_start_precis")
local start_gc = ifs_freeform_start_precis
ReadDataFile("..\\..\\addon\\zte\\core.lvl")
-------------------------------------------------------------------------------
-- The end of the 7 step section
-------------------------------------------------------------------------------
--add a button to the shell for our custom Galactic Conquest
if custom_GetGCButtonList then
print("custom_gc_8: Taking control of custom_GetGCButtonList()...")
--check for possible loading errors
if precis_custom_GetGCButtonList then
print("custom_gc_8: Warning: Someone else is using our precis_custom_GetGCButtonList variable!")
print("custom_gc_8: Exited")
return
end
--backup the current custom_GetGCButtonList function
precis_custom_GetGCButtonList = custom_GetGCButtonList
--this is our new custom_GetGCButtonList function
custom_GetGCButtonList = function()
print("custom_gc_8: custom_GetGCButtonList(): Entered")
--get the button table from the real function
local list = precis_custom_GetGCButtonList()
--add in the button for our Galactic Conqust
local ourButton = { tag = gcTag, string = gcString, }
table.insert( list, 1, ourButton )
print("custom_gc_8: custom_GetGCButtonList(): Exited")
return list
end
else
print("custom_gc_8: Warning: No custom_GetGCButtonList() to take over")
print("custom_gc_8: Exited")
return
end
--Note: if you want your Galactic Conquest to only be visible at certain times (like when some other GC is completed), you will need to take over the ifs_sp_campaign_fnUpdateButtonVis() and/or ifs_sp_gc_fnUpdateButtonVis() functions (like you did with custom_GetGCButtonList()). Both of these functions can be found in Common\scripts\PC\ifs_sp_campaign.lua
--listen for when our Galactic Conquest button is clicked
if custom_PressedGCButton then
print("custom_gc_8: Taking control of custom_PressedGCButton()...")
--check for possible loading errors
if precis_custom_PressedGCButton then
print("custom_gc_8: Warning: Someone else is using our precis_custom_PressedGCButton variable!")
print("custom_gc_8: Exited")
return
end
--backup the current custom_GetGCButtonList function
precis_custom_PressedGCButton = custom_PressedGCButton
--this is our new custom_GetGCButtonList function
custom_PressedGCButton = function( tag )
print("custom_gc_8: custom_PressedGCButton(): Entered")
--not our conquest, so let the game process it normally
if tag ~= gcTag then
return precis_custom_PressedGCButton()
end
--it is our Galactic Conquest button, so get our game going
start_gc(ifs_freeform_main)
print("custom_gc_8: custom_PressedGCButton(): Exited")
return true
end
else
print("custom_gc_8: Warning: No custom_PressedGCButton() to take over")
print("custom_gc_8: Exited")
return
end
print("custom_gc_8: Exited")
"custom_gc_9" Republic Campaign
Code: Select all
print("custom_gc_9: Entered")
local gcTag = "Galactic Republic"
local gcString = "Age of Republic: Galactic Republic"
ScriptCB_DoFile("ifs_freeform_init_prerep")
ScriptCB_DoFile("ifs_freeform_start_prerep")
local start_gc = ifs_freeform_start_prerep
ReadDataFile("..\\..\\addon\\zte\\core.lvl")
-------------------------------------------------------------------------------
-- The end of the 7 step section
-------------------------------------------------------------------------------
--add a button to the shell for our custom Galactic Conquest
if custom_GetGCButtonList then
print("custom_gc_9: Taking control of custom_GetGCButtonList()...")
--check for possible loading errors
if prerep_custom_GetGCButtonList then
print("custom_gc_9: Warning: Someone else is using our prerep_custom_GetGCButtonList variable!")
print("custom_gc_9: Exited")
return
end
--backup the current custom_GetGCButtonList function
prerep_custom_GetGCButtonList = custom_GetGCButtonList
--this is our new custom_GetGCButtonList function
custom_GetGCButtonList = function()
print("custom_gc_9: custom_GetGCButtonList(): Entered")
--get the button table from the real function
local list = prerep_custom_GetGCButtonList()
--add in the button for our Galactic Conqust
local ourButton = { tag = gcTag, string = gcString, }
table.insert( list, 1, ourButton )
print("custom_gc_9: custom_GetGCButtonList(): Exited")
return list
end
else
print("custom_gc_9: Warning: No custom_GetGCButtonList() to take over")
print("custom_gc_9: Exited")
return
end
--Note: if you want your Galactic Conquest to only be visible at certain times (like when some other GC is completed), you will need to take over the ifs_sp_campaign_fnUpdateButtonVis() and/or ifs_sp_gc_fnUpdateButtonVis() functions (like you did with custom_GetGCButtonList()). Both of these functions can be found in Common\scripts\PC\ifs_sp_campaign.lua
--listen for when our Galactic Conquest button is clicked
if custom_PressedGCButton then
print("custom_gc_9: Taking control of custom_PressedGCButton()...")
--check for possible loading errors
if prerep_custom_PressedGCButton then
print("custom_gc_9: Warning: Someone else is using our zte1_custom_PressedGCButton variable!")
print("custom_gc_9: Exited")
return
end
--backup the current custom_GetGCButtonList function
prerep_custom_PressedGCButton = custom_PressedGCButton
--this is our new custom_GetGCButtonList function
custom_PressedGCButton = function( tag )
print("custom_gc_9: custom_PressedGCButton(): Entered")
--not our conquest, so let the game process it normally
if tag ~= gcTag then
return prerep_custom_PressedGCButton()
end
--it is our Galactic Conquest button, so get our game going
start_gc(ifs_freeform_main)
print("custom_gc_9: custom_PressedGCButton(): Exited")
return true
end
else
print("custom_gc_9: Warning: No custom_PressedGCButton() to take over")
print("custom_gc_9: Exited")
return
end
print("custom_gc_9: Exited")