Page 1 of 1

Custom Galactic Conquest

Posted: Sat Sep 24, 2011 12:41 pm
by ARCTroopaNate
What files do you need to edit to make a custom Galactic Conquest. I know mav has made some and they're really epic, I'm trying to make a custom Galactic Conquest myself. The problem is that I don't know what files to edit, or how to edit them, if anyone could give me some more information I'd greatly appreciate it.

Re: Custom Galactic Conquest

Posted: Sat Sep 24, 2011 2:15 pm
by Firefang
In the v1.3 docs, Zerted included the docs on how to make a custom GC. But it will not tell you how to add new planets or units.

Re: Custom Galactic Conquest

Posted: Sat Sep 24, 2011 2:37 pm
by yuke5

Re: Custom Galactic Conquest

Posted: Sat Sep 24, 2011 3:04 pm
by ARCTroopaNate
I looked in the 1.3 docs and I could not find the Galactic conquest docs, Am I just blind or am I missing something?

Re: Custom Galactic Conquest

Posted: Sat Sep 24, 2011 5:47 pm
by Fiodis
You're just missing something. For some reason some installations of the v1.3 patch don't include all the docs. I had to get a full set from a friend, myself.
Hidden/Spoiler:
[quote]Overview
* The UnOfficial v1.3 patch r102+ supports up to 11 custom Galactic Conquests (cgc). Custom Galactic Conquest scripts are loaded and processed near the start of shell_interface.lua.
* The UnOfficial v1.3 patch r129+ supports an unlimited number of cGC scripts. These scripts must start at number 11 and increment that number one at a time. If there is a break in the numbering, such as: custom_gc_12, custom_gc_13, custom_gc_15, and custom_gc_16, then when the game sees script 14 missing, it will stop checking for other scripts. Thus custom_gc_15 and custom_gc_16 won't be loaded.


Requirements
* SWBF2 mod tools
* v1.3 patch r94+ installed
* Basic understanding of Lua
* Basic understanding of how the game works
* A willingness to look through the game's ifs_freeform shell stripts to learn how Galactic Conquest is really configured and played

How To Do It:
1) First, you will need to read and understand the 'Munge A Custom LVL File.txt' document
2) Then you need to pick a custom Galactic Conquest slot. This guide will use slot four: "3". If you plan to distribute your scripts to others, it is best to include the source code, as users might have to recompile it for a different slot.
3) Configure your map to munge the custom lvl: "custom_gc_3.lvl" (see the custom lvl doc for help)
4) custom_gc_3.lvl must, at the very least, contain the lua script: "custom_gc_3". When your custom lvl is processed by the game, it will load only this script. You can always include more scripts or resources in the lvl if you need them (and you do), but the expected script (custom_gc_3) must load them (use ScriptCB_DoFile() or ReadDataFile()).
) Look in the v1.3 patch's "code examples" folder for the "custom_gc_example.zip" file. Extract this zip file and rename its template custom_gc_1.lua to custom_gc_3.lua
) In custom_gc_3.lua, read the beginning section of comments. It goes over the 7 simple things you need to change for easily integerating your custom Galactic Conquest into the game's shell.
) Create the other scripts for your custom Galactic Conquest. You can look at the example and use its scripts as a guide.
) After you munge your custom_gc_3.lvl, copy it to the folder: "GameData\Data\_LVL_PC"
) Thats it! Run your game and check its debug output. You should see it saying it found and loaded your script each time the shell is reloaded.

More Info
* For an example custom Galactic Conquest, see "custom_gc_example.zip" in the "code eamples" folder of the v1.3 patch.

[/quote]
Munge a Custom .LVL doc:
Hidden/Spoiler:
[quote]Overview
* This tutorial will guide you through munging a custom lvl file

Requirements
* SWBF2 mod tools
* Basic understanding of modding
* Basic understanding of the munge process

How To Do It
1) This guide will assume the mod map is XXX
2) Create the folder: "data_XXX\Shell"
3) Create the text file: "data_XXX\Shell\shell.req"
4) Create the folder "data_XXX\Shell\scripts"
5) Create the script file: "data_XXX\Shell\scripts\test.lua"
6) In shell.req, add the following code. The 'test' should match the name of the script created in step 5, but without its file extension:

ucft
{
REQN
{
"script"
"test"
}
}

7) Open VisualMunge, click "Unselect All", check "Shell", click "Munge"
8) When VisualMunge finishes, it will have created the lvl file: "data_XXX\_LVL_PC\shell.lvl"
9) Rename shell.lvl to whatever name you need, then move it to where you need the file.

Notes
* The test.lua script is just an example script file. You should change the req file to reflect whatever it is you are trying to munging.
[/quote]

Re: Custom Galactic Conquest

Posted: Thu Sep 29, 2011 12:32 am
by Jaspo
my discoveries regarding GC limitations:
viewtopic.php?f=27&t=13034&hilit=limitation&start=113
a crazy idea that hasn't gotten anywhere yet:
viewtopic.php?f=27&t=25900
localization info:
viewtopic.php?f=27&t=23575
and I'll be nice and give you my scripts for reference (only, please!):
shell.req:
Hidden/Spoiler:
ucft
{

REQN
{
"script"
"custom_gc_4"
"ifs_freeform_init_egc"
"ifs_freeform_start_egc"
}
}
shell.req is in the shell folder of data_EGC which contains a scripts folder with these files:
custom_gc_4.lua:
Hidden/Spoiler:
--This is the main setup script for a custom Galactic Conquest
print("custom_gc_4: 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: cgc4/cgc#
-- 2) you need to search/replace: gc_4/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 = "ExtGC"

-- 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 = "Extended Galactic Conquest" --"mods.custom_gc.tht.name"

-- 5) load any other scripts from your custom_gc_4.lvl
ScriptCB_DoFile("ifs_freeform_init_egc")
ScriptCB_DoFile("ifs_freeform_start_egc")


-- 6) this is your script that starts your Galactic Conquest game
local start_gc = ifs_freeform_start_egc

-- 7) read in any strings you need
ReadDataFile("..\\..\\addon\\EGC\\data\\_LVL_PC\\EGC\\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_4: Taking control of custom_GetGCButtonList()...")

--check for possible loading errors
if cgc4_custom_GetGCButtonList then
print("custom_gc_4: Warning: Someone else is using our cgc4_custom_GetGCButtonList variable!")
print("custom_gc_4: Exited")
return
end

--backup the current custom_GetGCButtonList function
cgc4_custom_GetGCButtonList = custom_GetGCButtonList

--this is our new custom_GetGCButtonList function
custom_GetGCButtonList = function()
print("custom_gc_4: custom_GetGCButtonList(): Entered")

--get the button table from the real function
local list = cgc4_custom_GetGCButtonList()

--add in the button for our Galactic Conqust
local ourButton = { tag = gcTag, string = gcString, }
table.insert( list, 1, ourButton )

print("custom_gc_4: custom_GetGCButtonList(): Exited")
return list
end
else
print("custom_gc_4: Warning: No custom_GetGCButtonList() to take over")
print("custom_gc_4: 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_4: Taking control of custom_PressedGCButton()...")

--check for possible loading errors
if cgc4_custom_PressedGCButton then
print("custom_gc_4: Warning: Someone else is using our cgc4_custom_PressedGCButton variable!")
print("custom_gc_4: Exited")
return
end

--backup the current custom_GetGCButtonList function
cgc4_custom_PressedGCButton = custom_PressedGCButton

--this is our new custom_GetGCButtonList function
custom_PressedGCButton = function( tag )
print("custom_gc_4: custom_PressedGCButton(): Entered")

--not our conquest, so let the game process it normally
if tag ~= gcTag then
return cgc4_custom_PressedGCButton()
end

--it is our Galactic Conquest button, so get our game going
start_gc(ifs_freeform_main)

print("custom_gc_4: custom_PressedGCButton(): Exited")
return true
end
else
print("custom_gc_4: Warning: No custom_PressedGCButton() to take over")
print("custom_gc_4: Exited")
return
end

print("custom_gc_4: Exited")

if ifs_purchase_tech_cards then
ifs_purchase_tech_cards = {
[1] = {
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
},
[2] = {
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
}
}
return
end
I think you can ignore that part about tech cards at the end;
I still need to figure out how to edit bonus purchase settings for each mission and that was
part of me trying to do so (unsuccessfully).
ifs_freeform_init_egc.lua:
Hidden/Spoiler:
-- initialize for egc War
print("ifs_freeform_init_egc.lua")
ifs_freeform_init_egc = function(this, ALL, IMP)
print("ifs_freeform_init_egc: ifs_freeform_init_egc()")

SetMemoryPoolSize("ParticleTransformer::PositionTr", 1400)
SetMemoryPoolSize("ParticleTransformer::SizeTransf", 1500)
SetMemoryPoolSize("ParticleTransformer::ColorTrans", 2250)

SetMemoryPoolSize("ParticleEmitterObject", 32)
SetMemoryPoolSize("ParticleEmitterInfoData", 256)
SetMemoryPoolSize("ParticleEmitter", 256)

-- common init
ifs_freeform_init_common(this)

--replacing this table from init_common, by [RDH]Zerted
-- per-planet camera offsets
this.cameraOffset = {
["cor"] = { 0, 1, 1 },
["dag"] = { 0, 1, 1 },
["DRB"] = { 0, 1, 1 },
["fel"] = { 0, 1, 1 },
["tat"] = { 0, 1, 1 },
["dea"] = { 0, 1, 1 },
["kas"] = { 0, 1, 1 },
["SDA"] = { 0, 1, 1 },
["mus2"] = { 0, 1, 1 },
["star02"] = { 0, 1, 1 },
["JAG"] = { 0, 1, 1 },
["hot"] = { 0, 1, 1 },
["kam"] = { 0, 1, 1 },
["pol"] = { 0, 1, 1 },
["TRV"] = { 0, 1, 1 },
["myg"] = { 0, 1, 1 },
["myg2"] = { 0, 1, 1 },
["end"] = { 1, 1, 1 },
["BNE"] = { 0, 1, 1 },
["mus"] = { 0, 1, 1 },
["uta"] = { 0, 1, 1 },
["tan"] = { 0, 1, 1 },
["nab"] = { 0, 1, 1 },
["geo"] = { 0, 1, 1 },
["BHW"] = { 0, 1, 1 },
["HUT"] = { 0, 1, 1 },
["MMD"] = { 0, 1, 1 },
["GAD"] = { 0, 1, 1 },
["RPE"] = { 0, 1, 1 },
["WOJ"] = { 0, 1, 1 },
["KOR"] = { 0, 1, 1 },
["ALD"] = { 0, 1, 1 },
["yav"] = { 0, 1, 1 },
["DTF"] = { 0, 1, 1 },
["PRK"] = { 0, 1, 1 },
}

-- default victory condition (take all planets)
this:SetVictoryPlanetLimit(nil)

-- associate codes with teams
this.teamCode = {
[ALL] = "all",
[IMP] = "imp"
}

-- use GCW setup
this.Setup = function(this)
-- remove unused planets
DeleteEntity("end_star")
DeleteEntity("hot_star")

--create new planets (planet model, grid location, mission)
CreateEntity(GetEntityClass("yav"), GetEntityMatrix("end"), "TWH");
CreateEntity(GetEntityClass("pol"), GetEntityMatrix("kam"), "SDA");
CreateEntity(GetEntityClass("kas"), GetEntityMatrix("mus"), "MAL");
CreateEntity(GetEntityClass("myg"), GetEntityMatrix("nab"), "JAG");
CreateEntity(GetEntityClass("dag"), GetEntityMatrix("yav"), "TRV");
CreateEntity(GetEntityClass("yav"), GetEntityMatrix("star01"), "DRB");
CreateEntity(GetEntityClass("geo"), GetEntityMatrix("star04"), "BNE");
CreateEntity(GetEntityClass("nab"), GetEntityMatrix("star10"), "BHW");
CreateEntity(GetEntityClass("fel"), GetEntityMatrix("star11"), "HUT");
CreateEntity(GetEntityClass("kam"), GetEntityMatrix("star12"), "MMD");
CreateEntity(GetEntityClass("kas"), GetEntityMatrix("star13"), "GAD");
CreateEntity(GetEntityClass("cor"), GetEntityMatrix("star14"), "RPE");
CreateEntity(GetEntityClass("hot"), GetEntityMatrix("star15"), "WOJ");
CreateEntity(GetEntityClass("tat"), GetEntityMatrix("star16"), "KOR");
CreateEntity(GetEntityClass("nab"), GetEntityMatrix("star17"), "ALD");
CreateEntity(GetEntityClass("myg"), GetEntityMatrix("star18"), "DDC");
CreateEntity(GetEntityClass("kas"), GetEntityMatrix("star19"), "DTF");
CreateEntity(GetEntityClass("kas"), GetEntityMatrix("star20"), "PRK");

--create placeholders for stock planet relocation
CreateEntity(GetEntityClass("dea"), GetEntityMatrix("dea"), "dea2");
CreateEntity(GetEntityClass("kam"), GetEntityMatrix("kam"), "kam2");
CreateEntity(GetEntityClass("myg"), GetEntityMatrix("myg"), "myg2");
CreateEntity(GetEntityClass("end"), GetEntityMatrix("end"), "end2");
CreateEntity(GetEntityClass("mus"), GetEntityMatrix("mus"), "mus2");
CreateEntity(GetEntityClass("nab"), GetEntityMatrix("nab"), "nab2");
CreateEntity(GetEntityClass("yav"), GetEntityMatrix("yav"), "yav2");
CreateEntity(GetEntityClass("hot"), GetEntityMatrix("hot"), "hot2");
CreateEntity(GetEntityClass("geo"), GetEntityMatrix("geo"), "geo2");
CreateEntity(GetEntityClass("pol"), GetEntityMatrix("pol"), "pol2");
CreateEntity(GetEntityClass("tat"), GetEntityMatrix("tat"), "tat2");
CreateEntity(GetEntityClass("uta"), GetEntityMatrix("uta"), "uta2");

--delete old stock planets, create at new locations
DeleteEntity("dea")
DeleteEntity("kam")
DeleteEntity("end")
DeleteEntity("mus")
DeleteEntity("nab")
DeleteEntity("yav")
DeleteEntity("tat")
CreateEntity(GetEntityClass("dea2"), GetEntityMatrix("hot"), "dea");
DeleteEntity("hot")
CreateEntity(GetEntityClass("tat2"), GetEntityMatrix("geo"), "tat");
DeleteEntity("geo")
CreateEntity(GetEntityClass("yav2"), GetEntityMatrix("myg"), "yav");
DeleteEntity("myg")
CreateEntity(GetEntityClass("hot2"), GetEntityMatrix("pol"), "hot");
DeleteEntity("pol")
CreateEntity(GetEntityClass("kam2"), GetEntityMatrix("tat2"), "kam");
CreateEntity(GetEntityClass("pol2"), GetEntityMatrix("uta"), "pol");
DeleteEntity("uta")
CreateEntity(GetEntityClass("geo2"), GetEntityMatrix("star09"), "geo");
CreateEntity(GetEntityClass("myg2"), GetEntityMatrix("star02"), "myg");
CreateEntity(GetEntityClass("end2"), GetEntityMatrix("star03"), "end");
CreateEntity(GetEntityClass("mus2"), GetEntityMatrix("star05"), "mus");
CreateEntity(GetEntityClass("uta2"), GetEntityMatrix("star06"), "uta");
CreateEntity(GetEntityClass("tantive"), GetEntityMatrix("star07"), "tan");
CreateEntity(GetEntityClass("nab2"), GetEntityMatrix("star08"), "nab");


--delete placeholders
DeleteEntity("dea2");
DeleteEntity("kam2");
DeleteEntity("myg2");
DeleteEntity("end2");
DeleteEntity("mus2");
DeleteEntity("nab2");
DeleteEntity("yav2");
DeleteEntity("hot2");
DeleteEntity("geo2");
DeleteEntity("pol2");
DeleteEntity("tat2");
DeleteEntity("uta2");

------------------------------------------------------------------------------------------------

--create new planet systems
CreateEntity(GetEntityClass("yav_system"), GetEntityMatrix("end_system"), "TWH_system");
CreateEntity(GetEntityClass("kas_system"), GetEntityMatrix("mus_system"), "MAL_system");
CreateEntity(GetEntityClass("end_system"), GetEntityMatrix("nab_system"), "JAG_system");
CreateEntity(GetEntityClass("dag_system"), GetEntityMatrix("yav_system"), "TRV_system");
CreateEntity(GetEntityClass("yav_system"), GetEntityMatrix("star01"), "DRB_system");
CreateEntity(GetEntityClass("geo_system"), GetEntityMatrix("star04"), "BNE_system");
CreateEntity(GetEntityClass("nab_system"), GetEntityMatrix("star10"), "BHW_system");
CreateEntity(GetEntityClass("tat_system"), GetEntityMatrix("star11"), "HUT_system");
CreateEntity(GetEntityClass("kam_system"), GetEntityMatrix("star12"), "MMD_system");
CreateEntity(GetEntityClass("kas_system"), GetEntityMatrix("star13"), "GAD_system");
CreateEntity(GetEntityClass("cor_system"), GetEntityMatrix("star14"), "RPE_system");
CreateEntity(GetEntityClass("hot_system"), GetEntityMatrix("star15"), "WOJ_system");
CreateEntity(GetEntityClass("tat_system"), GetEntityMatrix("star16"), "KOR_system");
CreateEntity(GetEntityClass("nab_system"), GetEntityMatrix("star17"), "ALD_system");
CreateEntity(GetEntityClass("myg_system"), GetEntityMatrix("star18"), "DDC_system");
CreateEntity(GetEntityClass("kas_system"), GetEntityMatrix("star19"), "DTF_system");
CreateEntity(GetEntityClass("kas_system"), GetEntityMatrix("star20"), "PRK_system");

--create placeholders for stock planet system relocation
-- CreateEntity(GetEntityClass("dea_system"), GetEntityMatrix("dea_system"), "dea2_system");
CreateEntity(GetEntityClass("kam_system"), GetEntityMatrix("kam_system"), "kam2_system");
CreateEntity(GetEntityClass("myg_system"), GetEntityMatrix("myg_system"), "myg2_system");
CreateEntity(GetEntityClass("end_system"), GetEntityMatrix("end_system"), "end2_system");
CreateEntity(GetEntityClass("mus_system"), GetEntityMatrix("mus_system"), "mus2_system");
CreateEntity(GetEntityClass("nab_system"), GetEntityMatrix("nab_system"), "nab2_system");
CreateEntity(GetEntityClass("yav_system"), GetEntityMatrix("yav_system"), "yav2_system");
CreateEntity(GetEntityClass("hot_system"), GetEntityMatrix("hot_system"), "hot2_system");
CreateEntity(GetEntityClass("geo_system"), GetEntityMatrix("geo_system"), "geo2_system");
-- CreateEntity(GetEntityClass("pol_system"), GetEntityMatrix("pol_system"), "pol2_system");
CreateEntity(GetEntityClass("tat_system"), GetEntityMatrix("tat_system"), "tat2_system");
CreateEntity(GetEntityClass("uta_system"), GetEntityMatrix("uta_system"), "uta2_system");

--delete old stock planet systems, create at new locations
-- DeleteEntity("dea_system")
DeleteEntity("kam_system")
DeleteEntity("end_system")
DeleteEntity("mus_system")
DeleteEntity("nab_system")
DeleteEntity("yav_system")
DeleteEntity("tat_system")
-- CreateEntity(GetEntityClass("dea2_system"), GetEntityMatrix("hot_system"), "dea_system");
DeleteEntity("hot_system")
CreateEntity(GetEntityClass("tat2_system"), GetEntityMatrix("geo_system"), "tat_system");
DeleteEntity("geo_system")
CreateEntity(GetEntityClass("yav2_system"), GetEntityMatrix("myg_system"), "yav_system");
DeleteEntity("myg_system")
CreateEntity(GetEntityClass("hot2_system"), GetEntityMatrix("pol_system"), "hot_system");
-- DeleteEntity("pol_system")
CreateEntity(GetEntityClass("kam2_system"), GetEntityMatrix("tat2_system"), "kam_system");
-- CreateEntity(GetEntityClass("pol2_system"), GetEntityMatrix("uta_system"), "pol_system");
DeleteEntity("uta_system")
CreateEntity(GetEntityClass("geo2_system"), GetEntityMatrix("star09"), "geo_system");
CreateEntity(GetEntityClass("myg2_system"), GetEntityMatrix("star02"), "myg_system");
CreateEntity(GetEntityClass("end2_system"), GetEntityMatrix("star03"), "end_system");
CreateEntity(GetEntityClass("mus2_system"), GetEntityMatrix("star05"), "mus_system");
CreateEntity(GetEntityClass("uta2_system"), GetEntityMatrix("star06"), "uta_system");
-- CreateEntity(GetEntityClass("tantive"), GetEntityMatrix("star07"), "tan");
CreateEntity(GetEntityClass("nab2_system"), GetEntityMatrix("star08"), "nab_system");

--delete placeholders
-- DeleteEntity("dea2_system");
DeleteEntity("kam2_system");
DeleteEntity("myg2_system");
DeleteEntity("end2_system");
DeleteEntity("mus2_system");
DeleteEntity("nab2_system");
DeleteEntity("yav2_system");
DeleteEntity("hot2_system");
DeleteEntity("geo2_system");
-- DeleteEntity("pol2_system");
DeleteEntity("tat2_system");
DeleteEntity("uta2_system");

-----------------------------------------------------------------------------------------------

--create new planet cameras
CreateEntity(GetEntityClass("yav_camera"), GetEntityMatrix("end_camera"), "TWH_camera");
CreateEntity(GetEntityClass("pol_camera"), GetEntityMatrix("kam_camera"), "SDA_camera");
CreateEntity(GetEntityClass("kas_camera"), GetEntityMatrix("mus_camera"), "MAL_camera");
CreateEntity(GetEntityClass("myg_camera"), GetEntityMatrix("nab_camera"), "JAG_camera");
CreateEntity(GetEntityClass("dag_camera"), GetEntityMatrix("yav_camera"), "TRV_camera");
CreateEntity(GetEntityClass("yav_camera"), GetEntityMatrix("star01_camera"), "DRB_camera");
CreateEntity(GetEntityClass("geo_camera"), GetEntityMatrix("star04_camera"), "BNE_camera");
-- CreateEntity(GetEntityClass("nab_camera"), GetEntityMatrix("star10_camera"), "BHW_camera");--bad
CreateEntity(GetEntityClass("fel_camera"), GetEntityMatrix("star11_camera"), "HUT_camera");
-- CreateEntity(GetEntityClass("kam_camera"), GetEntityMatrix("star12_camera"), "MMD_camera");--bad
CreateEntity(GetEntityClass("kas_camera"), GetEntityMatrix("star13_camera"), "GAD_camera");
CreateEntity(GetEntityClass("cor_camera"), GetEntityMatrix("star14_camera"), "RPE_camera");
-- CreateEntity(GetEntityClass("hot_camera"), GetEntityMatrix("star15_camera"), "WOJ_camera");--bad
-- CreateEntity(GetEntityClass("tat_camera"), GetEntityMatrix("star16_camera"), "KOR_camera");--bad
-- CreateEntity(GetEntityClass("nab_camera"), GetEntityMatrix("star17_camera"), "ALD_camera");--bad
CreateEntity(GetEntityClass("myg_camera"), GetEntityMatrix("star18_camera"), "DDC_camera");
-- CreateEntity(GetEntityClass("kas_camera"), GetEntityMatrix("star19_camera"), "DTF_camera");--bad
-- CreateEntity(GetEntityClass("kas_camera"), GetEntityMatrix("star20_camera"), "PRK_camera");--bad


--create placeholders for stock planet camera relocation
CreateEntity(GetEntityClass("dea_camera"), GetEntityMatrix("dea_camera"), "dea2_camera");
CreateEntity(GetEntityClass("kam_camera"), GetEntityMatrix("kam_camera"), "kam2_camera");
CreateEntity(GetEntityClass("myg_camera"), GetEntityMatrix("myg_camera"), "myg2_camera");
CreateEntity(GetEntityClass("end_camera"), GetEntityMatrix("end_camera"), "end2_camera");
CreateEntity(GetEntityClass("mus_camera"), GetEntityMatrix("mus_camera"), "mus2_camera");
CreateEntity(GetEntityClass("nab_camera"), GetEntityMatrix("nab_camera"), "nab2_camera");
CreateEntity(GetEntityClass("yav_camera"), GetEntityMatrix("yav_camera"), "yav2_camera");
CreateEntity(GetEntityClass("hot_camera"), GetEntityMatrix("hot_camera"), "hot2_camera");
CreateEntity(GetEntityClass("geo_camera"), GetEntityMatrix("geo_camera"), "geo2_camera");
CreateEntity(GetEntityClass("pol_camera"), GetEntityMatrix("pol_camera"), "pol2_camera");
CreateEntity(GetEntityClass("tat_camera"), GetEntityMatrix("tat_camera"), "tat2_camera");
CreateEntity(GetEntityClass("uta_camera"), GetEntityMatrix("uta_camera"), "uta2_camera");

--delete old stock planet cameras, create at new locations
DeleteEntity("dea_camera")
DeleteEntity("kam_camera")
DeleteEntity("end_camera")
DeleteEntity("mus_camera")
DeleteEntity("nab_camera")
DeleteEntity("yav_camera")
DeleteEntity("tat_camera")
CreateEntity(GetEntityClass("dea2_camera"), GetEntityMatrix("hot_camera"), "dea_camera");
DeleteEntity("hot_camera")
CreateEntity(GetEntityClass("tat2_camera"), GetEntityMatrix("geo_camera"), "tat_camera");
DeleteEntity("geo_camera")
CreateEntity(GetEntityClass("yav2_camera"), GetEntityMatrix("myg_camera"), "yav_camera");
DeleteEntity("myg_camera")
CreateEntity(GetEntityClass("hot2_camera"), GetEntityMatrix("pol_camera"), "hot_camera");
DeleteEntity("pol_camera")
CreateEntity(GetEntityClass("kam2_camera"), GetEntityMatrix("tat2_camera"), "kam_camera");
CreateEntity(GetEntityClass("pol2_camera"), GetEntityMatrix("uta_camera"), "pol_camera");
DeleteEntity("uta_camera")
CreateEntity(GetEntityClass("geo2_camera"), GetEntityMatrix("star09_camera"), "geo_camera");
CreateEntity(GetEntityClass("myg2_camera"), GetEntityMatrix("star02_camera"), "myg_camera");
CreateEntity(GetEntityClass("end2_camera"), GetEntityMatrix("star03_camera"), "end_camera");
CreateEntity(GetEntityClass("mus2_camera"), GetEntityMatrix("star05_camera"), "mus_camera");
CreateEntity(GetEntityClass("uta2_camera"), GetEntityMatrix("star06_camera"), "uta_camera");
CreateEntity(GetEntityClass("uta2_camera"), GetEntityMatrix("star07_camera"), "tan_camera");
CreateEntity(GetEntityClass("nab2_camera"), GetEntityMatrix("star08_camera"), "nab_camera");

--delete placeholders
DeleteEntity("dea2_camera");
DeleteEntity("kam2_camera");
DeleteEntity("myg2_camera");
DeleteEntity("end2_camera");
DeleteEntity("mus2_camera");
DeleteEntity("nab2_camera");
DeleteEntity("yav2_camera");
DeleteEntity("hot2_camera");
DeleteEntity("geo2_camera");
DeleteEntity("pol2_camera");
DeleteEntity("tat2_camera");
DeleteEntity("uta2_camera");

--------------------------------------------------------------------------------------------

-- create the connectivity graph
this.planetDestination = {
["cor"] = { "PRK", "TWH", "ALD", "yav" },
["dag"] = { "nab", "uta", "MAL" },
["DRB"] = { "myg" },
["fel"] = { "GAD", "TRV", "RPE", "WOJ" },
["tat"] = { "tan", "kam", "geo"},
["dea"] = { "MAL", "BNE", "end" },
["kas"] = { "MMD", "ALD", "SDA" },
["HUT"] = { "BHW", "RPE", "kam", "SDA" },
["MAL"] = { "dea", "dag", "JAG", "mus" },
["myg"] = { "DRB", "TWH" },
["JAG"] = { "tan", "MMD", "ALD", "MAL" },
["hot"] = { "BNE", "pol" },
["kam"] = { "BHW", "tat", "geo", "HUT" },
["pol"] = { "hot", "mus" },
["TRV"] = { "fel" },
["DDC"] = { "DTF", "KOR", "yav" },
["yav"] = { "DDC", "ALD", "WOJ", "cor", "KOR" },
["end"] = { "dea" },
["BNE"] = { "hot", "dea" },
["mus"] = { "MAL", "pol" },
["uta"] = { "dag", "nab" },
["tan"] = { "JAG", "nab", "BHW", "tat" },
["nab"] = { "uta", "tan", "dag" },
["geo"] = { "tat", "kam" },
["BHW"] = { "HUT", "tan", "kam" },
["SDA"] = { "HUT", "kas", "MMD" },
["MMD"] = { "JAG", "kas", "SDA" },
["GAD"] = { "WOJ", "fel" },
["RPE"] = { "fel", "HUT" },
["WOJ"] = { "fel", "ALD", "GAD", "yav" },
["KOR"] = { "yav", "DDC" },
["ALD"] = { "cor", "kas", "yav", "JAG", "WOJ" },
["DTF"] = { "DDC", "TWH" },
["TWH"] = { "myg", "DTF", "cor" },
["PRK"] = { "cor" },
}


-- resource value for each planet
this.planetValue = {
["cor"] = { victory = 20, defeat = 10, turn = 3 }, --cor
["dag"] = { victory = 14, defeat = 7, turn = 2 }, --dag
["DRB"] = { victory = 14, defeat = 7, turn = 2 }, --DRB
["fel"] = { victory = 10, defeat = 5, turn = 1 }, --fel
["dea"] = { victory = 24, defeat = 12, turn = 4 }, --dea
["kas"] = { victory = 12, defeat = 6, turn = 1 }, --kas
["tat"] = { victory = 12, defeat = 6, turn = 1 }, --tat
["SDA"] = { victory = 8, defeat = 4, turn = 1 }, --SDA
["DDC"] = { victory = 10, defeat = 5, turn = 1 }, --(star)
["TWH"] = { victory = 10, defeat = 5, turn = 1 }, --(star)
["JAG"] = { victory = 14, defeat = 7, turn = 2 }, --JAG
["hot"] = { victory = 20, defeat = 10, turn = 3 }, --hot
["kam"] = { victory = 10, defeat = 5, turn = 1 }, --kam
-- ["tantive"] = { victory = 4, defeat = 2, turn = 1 }, --(unused, see "tan")
["pol"] = { victory = 10, defeat = 5, turn = 1 }, --pol
["TRV"] = { victory = 10, defeat = 5, turn = 1 }, --TRV
["myg"] = { victory = 12, defeat = 6, turn = 1 }, --myg
["MAL"] = { victory = 12, defeat = 6, turn = 1 }, --(star)
["end"] = { victory = 14, defeat = 7, turn = 2 }, --end
["BNE"] = { victory = 14, defeat = 7, turn = 2 }, --BNE
["mus"] = { victory = 14, defeat = 7, turn = 2 }, --mus
["uta"] = { victory = 12, defeat = 6, turn = 1 }, --uta
["tan"] = { victory = 4, defeat = 2, turn = 1 }, --tan
["nab"] = { victory = 12, defeat = 6, turn = 1 }, --nab
["geo"] = { victory = 10, defeat = 5, turn = 1 }, --geo
["BHW"] = { victory = 20, defeat = 10, turn = 3 }, --BHW
["HUT"] = { victory = 10, defeat = 5, turn = 1 }, --HUT
["MMD"] = { victory = 10, defeat = 5, turn = 1 }, --MMD
["GAD"] = { victory = 10, defeat = 5, turn = 1 }, --GAD
["RPE"] = { victory = 10, defeat = 5, turn = 1 }, --RPE
["WOJ"] = { victory = 10, defeat = 5, turn = 1 }, --WOJ
["KOR"] = { victory = 12, defeat = 6, turn = 1 }, --KOR
["ALD"] = { victory = 14, defeat = 7, turn = 2 }, --ALD
["yav"] = { victory = 24, defeat = 12, turn = 4 }, --yav
["DTF"] = { victory = 12, defeat = 6, turn = 1 }, --DTF
["PRK"] = { victory = 24, defeat = 12, turn = 4 }, --PRK
}

this.spaceValue = {
victory = 20, defeat = 10,
}

-- mission to launch for each planet
this.spaceMission = {
["con"] = { "EGCg_Diet Dr. Pepper" }
}

this.planetMission = {
["cor"] = {
["con"] = "cor1g_con",
},
["dag"] = {
["con"] = "dag1g_con",
},
["DRB"] = {
["con"] = "DRBg_con",
},
["fel"] = {
["con"] = "fel1g_con",
},
["dea"] = {
["con"] = { "dea1g_c2", "DSIg_con", }
},
["kas"] = {
["con"] = "kas2g_con",
},
["tat"] = {
["con"] = { "tat2g_con", "tat3g_con", "MOSg_con", }
},
["SDA"] = {
["con"] = "SDAg_con",
},
["TWH"] = {
["con"] = "TWHg_con",
},
["DDC"] = {
["con"] = "DDCg_con",
},
["JAG"] = {
["con"] = "JAGg_con",
},
["hot"] = {
["con"] = "hot1g_con",
},
["kam"] = {
["con"] = "kam1g_con",
},
-- ["tantive"] = {
-- ["con"] = "tan1g_con",
-- },
["pol"] = {
["con"] = "pol1g_c2",
},
["TRV"] = {
["con"] = "TRVg_con",
},
["myg"] = {
["con"] = "myg1g_con",
},
["MAL"] = {
["con"] = "TRVg_con", --change this when it's done.
},
["end"] = {
["con"] = "end1g_con",
},
["BNE"] = {
["con"] = "BNEg_con",
},
["mus"] = {
["con"] = {"mus1g_con", "MJEg_con"}
},
["uta"] = {
["con"] = "uta1g_con",
},
["tan"] = {
["con"] = "tan1g_con",
},
["nab"] = {
["con"] = "nab2g_con",
},
["geo"] = {
["con"] = "geo1g_con",
},
["BHW"] = {
["con"] = { "BHWg_con", "BBDg_con", }
},
["HUT"] = {
["con"] = "HUTg_con",
},
["MMD"] = {
["con"] = "MMDg_con",
},
["GAD"] = {
["con"] = "GADg_con",
},
["RPE"] = {
["con"] = "RPEg_con",
},
["WOJ"] = {
["con"] = { "WOJg_con", "RLSg_con", }
},
["KOR"] = {
["con"] = "KORg_con",
},
["ALD"] = {
["con"] = "ALDg_con",
},
["yav"] = {
["con"] = "yav1g_con",
},
["DTF"] = {
["con"] = "DTFg_con",
},
["PRK"] = {
["con"] = "PRKg_con",
},
}

-- associate names with teams
this.teamName = {
[0] = "",
[ALL] = "common.sides.all.name",
[IMP] = "common.sides.imp.name"
}

-- associate names with team bases
this.baseName = {
[ALL] = "ifs.freeform.base.all",
[IMP] = "ifs.freeform.base.imp"
}

-- associate names with team fleets
this.fleetName = {
[0] = "",
[ALL] = "ifs.freeform.fleet.all",
[IMP] = "ifs.freeform.fleet.imp"
}

-- associate entity class with team fleets
this.fleetClass = {
[ALL] = "gal_prp_moncalamaricruiser",
[IMP] = "gal_prp_stardestroyer"
}

-- associate icon textures with team fleets
this.fleetIcon = {
[ALL] = "all_fleet_normal_icon",
[IMP] = "imp_fleet_normal_icon"
}
this.fleetStroke = {
[ALL] = "all_fleet_normal_stroke",
[IMP] = "imp_fleet_normal_stroke"
}

-- set the explosion effect for each team
this.fleetExplosion = {
[ALL] = "gal_sfx_moncalamaricruiser_exp",
[IMP] = "gal_sfx_stardestroyer_exp"
}

-- team base planets
this.planetBase = {
[ALL] = "tan",
[IMP] = "SDA",
}

-- team potential starting locations
this.planetStart = {
[ALL] = { "dag", "DRB", "hot", "BHW", "MMD", "ALD", "yav" },
[IMP] = { "cor", "dea", "tat", "JAG", "TRV", "myg", "end", "mus", "uta", "geo", "RPE", "KOR", "DTF", "PRK", "kas", "fel", "pol", "kam", "nab", "WOJ", "GAD", "BNE", "HUT", "MAL", "DDC", "TWH" }
}




end
end
ifs_freeform_start_egc.lua:
Hidden/Spoiler:
-- start ALL campaign
print("ifs_freeform_start_egc.lua")
function ifs_freeform_start_egc(this)
print("ifs_freeform_start_egc(): Entered")

-- save scenario type
this.scenario = "egc"

-- assigned teams
local ALL = 1
local IMP = 2

-- egc init
print("ifs_freeform_start_egc(): Init")
ifs_freeform_init_egc(this, ALL, IMP)

-- set to versus play
ifs_freeform_controllers(this, { [0] = ALL, [1] = ALL, [2] = ALL, [3] = ALL })

-- ALL start
this.Start = function(this)
print("ifs_freeform_start_egc(): Start(): Entered")

-- perform common start
ifs_freeform_start_common(this)

-- set team for each planet
this.planetTeam = {
["cor"] = IMP, --cor
["dag"] = ALL, --dag
["DRB"] = ALL, --DRB
["fel"] = IMP, --fel
["dea"] = IMP, --dea
["kas"] = IMP, --kas
["tat"] = IMP, --tat
["SDA"] = IMP, --SDA
["MAL"] = IMP, --MAL
["TWH"] = IMP, --TWH
["JAG"] = IMP, --JAG
["hot"] = ALL, --hot
["kam"] = IMP, --kam
["pol"] = IMP, --pol
["TRV"] = IMP, --TRV
["myg"] = IMP, --myg
["DDC"] = IMP, --DDC
["end"] = IMP, --end
["BNE"] = IMP, --BNE
["mus"] = IMP, --mus
["uta"] = IMP, --uta
["tan"] = ALL, --tan
["nab"] = IMP, --nab
["geo"] = IMP, --geo
["BHW"] = ALL, --BHW
["HUT"] = IMP, --HUT
["MMD"] = ALL, --MMD
["GAD"] = IMP, --GAD
["RPE"] = IMP, --RPE
["WOJ"] = IMP, --WOJ
["KOR"] = IMP, --KOR
["ALD"] = ALL, --ALD
["yav"] = ALL, --yav
["DTF"] = IMP, --DTF
["PRK"] = IMP, --PRK
}

-- create starting fleets for each team
this.planetFleet = {}
for team, start in pairs(this.planetStart) do
local planet = start[math.random(table.getn(start))]
this.planetFleet[planet] = team
end
end
print("ifs_freeform_start_egc(): Finished")
end