i just thought it is time to start a new big project i have no knowledge about
So i want to make a new custom GC, but it looks like it is not working.
Actually i just took the example codes, changed a little bit here and a little bit there, but it never worked. As you can see in the error log the script doesn't know that i pressed the right button. But i pressed on the button that says Republic Commando. I hope someone of you can help me.
An other question is there a more detailed tutorial on how to add maps/planets to the gc, and how to set up the mission you are playing on these planets? How to set up own fleet icons, how to change the units you can buy, the bonus things,...??
custom_gc_5.lua
Hidden/Spoiler:
[code]--This is the main setup script for a custom Galactic Conquest
print("custom_gc_5: RCM GC Entered")
-------------------------------------------------------------------------------
-- Those 7 steps are in this section
-------------------------------------------------------------------------------
--Modders, for basic custom Galactic Conquest support
-- you only need to change the variables in this section.
-- If you want to do advanced things, you will need to
-- learn how the real game does it.
-- If you need to change something else in the game, it is
-- best to 'take control' of the function as done
-- a few times below this section. This allows you to
-- change parts of the shell without replacing shell.lvl.
--To use this script in your own custom Galactic Conquest,
-- 1) you need to search/replace: cgc1/cgc#
-- 2) you need to search/replace: gc_1/cg_#
-- where '#' is the number of this custom Galactic Conquest
-- 3) this button tag must be unique for each button in the Galactic Conquest screen
local gcTag = "RC"
-- 4) this is the string your Galactic Conquest button will use
-- if the game cannot find the a localization version of the string,
-- it will directly display the text on the button
local gcString = "Republic Commando" --"mods.custom_gc.tht.name"
-- 5) load any other scripts from your custom_gc_1.lvl
ScriptCB_DoFile("ifs_freeform_init_rc")
ScriptCB_DoFile("ifs_freeform_start_rc")
-- 6) this is your script that starts your Galactic Conquest game
local start_gc = ifs_freeform_start_rc
-- 7) read in any strings you need
--ReadDataFile("..\\..\\addon\\XXX\\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_5: Taking control of custom_GetGCButtonList()...")
--check for possible loading errors
if cgc5_custom_GetGCButtonList then
print("custom_gc_5: Warning: Someone else is using our cgc5_custom_GetGCButtonList variable!")
print("custom_gc_5: Exited")
return
end
--backup the current custom_GetGCButtonList function
cgc5_custom_GetGCButtonList = custom_GetGCButtonList
--this is our new custom_GetGCButtonList function
custom_GetGCButtonList = function()
print("custom_gc_5: custom_GetGCButtonList(): Entered")
--get the button table from the real function
local list = cgc5_custom_GetGCButtonList()
--add in the button for our Galactic Conqust
local ourButton = { tag = gcTag, string = gcString, }
table.insert( list, 1, ourButton )
print("custom_gc_5: custom_GetGCButtonList(): Exited")
return list
end
else
print("custom_gc_5: Warning: No custom_GetGCButtonList() to take over")
print("custom_gc_5: 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_5: Taking control of custom_PressedGCButton()...")
--check for possible loading errors
if cgc5_custom_PressedGCButton then
print("custom_gc_5: Warning: Someone else is using our cgc5_custom_PressedGCButton variable!")
print("custom_gc_5: Exited")
return
end
--backup the current custom_GetGCButtonList function
cgc5_custom_PressedGCButton = custom_PressedGCButton
--this is our new custom_GetGCButtonList function
custom_PressedGCButton = function( tag )
print("custom_gc_5: custom_PressedGCButton(): Entered")
--not our conquest, so let the game process it normally
if tag ~= gcTag then
print("looks like it's not me")
return cgc5_custom_PressedGCButton()
end
print("i'm here but i don't know what i'm doing")
--it is our Galactic Conquest button, so get our game going
start_gc(ifs_freeform_main)
print("custom_gc_5: custom_PressedGCButton(): Exited")
return true
end
else
print("custom_gc_5: Warning: No custom_PressedGCButton() to take over")
print("custom_gc_5: Exited")
return
end
print("custom_gc_5: Exited")
[/code]
print("custom_gc_5: RCM GC Entered")
-------------------------------------------------------------------------------
-- Those 7 steps are in this section
-------------------------------------------------------------------------------
--Modders, for basic custom Galactic Conquest support
-- you only need to change the variables in this section.
-- If you want to do advanced things, you will need to
-- learn how the real game does it.
-- If you need to change something else in the game, it is
-- best to 'take control' of the function as done
-- a few times below this section. This allows you to
-- change parts of the shell without replacing shell.lvl.
--To use this script in your own custom Galactic Conquest,
-- 1) you need to search/replace: cgc1/cgc#
-- 2) you need to search/replace: gc_1/cg_#
-- where '#' is the number of this custom Galactic Conquest
-- 3) this button tag must be unique for each button in the Galactic Conquest screen
local gcTag = "RC"
-- 4) this is the string your Galactic Conquest button will use
-- if the game cannot find the a localization version of the string,
-- it will directly display the text on the button
local gcString = "Republic Commando" --"mods.custom_gc.tht.name"
-- 5) load any other scripts from your custom_gc_1.lvl
ScriptCB_DoFile("ifs_freeform_init_rc")
ScriptCB_DoFile("ifs_freeform_start_rc")
-- 6) this is your script that starts your Galactic Conquest game
local start_gc = ifs_freeform_start_rc
-- 7) read in any strings you need
--ReadDataFile("..\\..\\addon\\XXX\\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_5: Taking control of custom_GetGCButtonList()...")
--check for possible loading errors
if cgc5_custom_GetGCButtonList then
print("custom_gc_5: Warning: Someone else is using our cgc5_custom_GetGCButtonList variable!")
print("custom_gc_5: Exited")
return
end
--backup the current custom_GetGCButtonList function
cgc5_custom_GetGCButtonList = custom_GetGCButtonList
--this is our new custom_GetGCButtonList function
custom_GetGCButtonList = function()
print("custom_gc_5: custom_GetGCButtonList(): Entered")
--get the button table from the real function
local list = cgc5_custom_GetGCButtonList()
--add in the button for our Galactic Conqust
local ourButton = { tag = gcTag, string = gcString, }
table.insert( list, 1, ourButton )
print("custom_gc_5: custom_GetGCButtonList(): Exited")
return list
end
else
print("custom_gc_5: Warning: No custom_GetGCButtonList() to take over")
print("custom_gc_5: 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_5: Taking control of custom_PressedGCButton()...")
--check for possible loading errors
if cgc5_custom_PressedGCButton then
print("custom_gc_5: Warning: Someone else is using our cgc5_custom_PressedGCButton variable!")
print("custom_gc_5: Exited")
return
end
--backup the current custom_GetGCButtonList function
cgc5_custom_PressedGCButton = custom_PressedGCButton
--this is our new custom_GetGCButtonList function
custom_PressedGCButton = function( tag )
print("custom_gc_5: custom_PressedGCButton(): Entered")
--not our conquest, so let the game process it normally
if tag ~= gcTag then
print("looks like it's not me")
return cgc5_custom_PressedGCButton()
end
print("i'm here but i don't know what i'm doing")
--it is our Galactic Conquest button, so get our game going
start_gc(ifs_freeform_main)
print("custom_gc_5: custom_PressedGCButton(): Exited")
return true
end
else
print("custom_gc_5: Warning: No custom_PressedGCButton() to take over")
print("custom_gc_5: Exited")
return
end
print("custom_gc_5: Exited")
[/code]
Hidden/Spoiler:
[code]Opened logfile BFront2.log 2015-01-24 1438
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy german 4
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: Found custom_gc_5.lvl
custom_gc_5: RCM GC Entered
ifs_freeform_init_rc.lua
ifs_freeform_start_rc.lua
custom_gc_5: Taking control of custom_GetGCButtonList()...
custom_gc_5: Taking control of custom_PressedGCButton()...
custom_gc_5: Exited
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: No custom_gc_12.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_gc_5: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_5: custom_GetGCButtonList(): Exited
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawlgr.mvs
shell_interface: Opening movie: movies\shellgr.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
Found ..\..\addon\BDT\data\_LVL_PC\SIDE\lead.lvl. Adding ETR's extra Dark Times missions
Cannot find ..\..\addon\BF1\data\_LVL_PC\SIDE\sen.lvl. Skipping ETR's extra Dark Times + Conversion Pack missions
prev = none iLastPage = nil
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: _tab_gc
custom_gc_11: custom_PressedGCButton(): Entered
custom_gc_5: custom_PressedGCButton(): Entered
looks like it's not me
custom_PressedGCButton()
[/code]
shell_interface: Entered
shell_interface: gPlatformStr, gOnlineServiceStr, gLangStr, gLangEnum: PC GameSpy german 4
ifs_era_handler - Entered
ifs_era_handler - Exited
shell_interface: No custom_gc_0.lvl
shell_interface: No custom_gc_1.lvl
shell_interface: No custom_gc_2.lvl
shell_interface: No custom_gc_3.lvl
shell_interface: No custom_gc_4.lvl
shell_interface: Found custom_gc_5.lvl
custom_gc_5: RCM GC Entered
ifs_freeform_init_rc.lua
ifs_freeform_start_rc.lua
custom_gc_5: Taking control of custom_GetGCButtonList()...
custom_gc_5: Taking control of custom_PressedGCButton()...
custom_gc_5: Exited
shell_interface: No custom_gc_6.lvl
shell_interface: No custom_gc_7.lvl
shell_interface: No custom_gc_8.lvl
shell_interface: No custom_gc_9.lvl
shell_interface: Found custom_gc_10.lvl
custom_gc_10: Entered
custom_gc_10: Found custom_gc_11.lvl
custom_gc_11: Entered
ifs_freeform_init_dt.lua
ifs_freeform_start_dt.lua
custom_gc_11: Taking control of custom_GetGCButtonList()...
custom_gc_11: Taking control of custom_PressedGCButton()...
custom_gc_11: Exited
custom_gc_10: No custom_gc_12.lvl. Will stop searching for any more cGC scripts.
custom_gc_10: Exited
custom_EraButtonList(): Finished building era button table Known eras buttons: 28
custom_GetGMapEras(): Finished building era table Known eras: 28
custom_GetGMapModes(): Finished building game mode table Known Modes: 39
custom_GetMPGameModeList(): Finished building game mode list table List Length: 40
custom_SetMovieLocation()
custom_gc_11: custom_GetGCButtonList(): Entered
custom_gc_5: custom_GetGCButtonList(): Entered
custom_GetGCButtonList()
custom_gc_5: custom_GetGCButtonList(): Exited
custom_gc_11: custom_GetGCButtonList(): Exited
custom_SetMovieLocation()
custom_GetFreeformBattleModeList(): Finished building freeform battle mode list Known Modes: 39
ingame stream movies\crawlgr.mvs
shell_interface: Opening movie: movies\shellgr.mvs
shell_interface: Leaving
Mission Checker: Entered addme
Mission Checker: addme: Now listening in on AddDownloadableContent() calls
Mission Checker: Exited addme
Found ..\..\addon\BDT\data\_LVL_PC\SIDE\lead.lvl. Adding ETR's extra Dark Times missions
Cannot find ..\..\addon\BF1\data\_LVL_PC\SIDE\sen.lvl. Skipping ETR's extra Dark Times + Conversion Pack missions
prev = none iLastPage = nil
prev = texture iLastPage = 2
prev = texture iLastPage = 3
ifs_legal.Exit
Message Severity: 2
C:\Battlefront2\main\Battlefront2\Source\GameMovie.cpp(399)
Unable to find open movie segment shell_main
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadFileList
ifs_saveop_DoOps LoadProfile
ifs_saveop_DoOps LoadProfile
ifs_sp_campaign: Input_Accept(): Entered: _tab_gc
custom_gc_11: custom_PressedGCButton(): Entered
custom_gc_5: custom_PressedGCButton(): Entered
looks like it's not me
custom_PressedGCButton()
[/code]
just an idea i had
print(tag)
print(gcTag)
result:
nil
RC
so it looks like the tag isn't setup right for the button. Any Idea why??
==EDIT2==
An other question: How can i check if there are special files somewhere in the addon directory??
(I saw that dt is looking for ETR and made an output like i found ... so i add bla bla bla.)
I'd like to search for my custom era mod before i add the button to the gc list. So is there a function, how to check this??