Hi, I'm more of a developer, and I'm trying to figure out all this stuff so we can mod it freely. There are trainers out there in the other threads, though.
More technical information I've figure out is below.
I've got the decompilation working, and recompilation, as well. In order to recompile the decompiled lua files from the Lua.hpk file, you need to alter the compiler functions in the file lua-5.3/src/ldump.c, in the function DumpHeader. (Code below).
Code: Select all
static void DumpHeader (DumpState *D) {
DumpLiteral(LUA_SIGNATURE, D);
DumpByte(LUAC_VERSION, D);
DumpByte(LUAC_FORMAT, D);
DumpLiteral(LUAC_DATA, D);
DumpByte(sizeof(int), D);
DumpByte(sizeof(size_t), D);
// DumpByte(sizeof(Instruction), D); // Comment these out!
// DumpByte(sizeof(lua_Integer), D); // Comment these out!
DumpByte(sizeof(lua_Number), D);
DumpInteger(LUAC_INT, D);
DumpNumber(LUAC_NUM, D);
}
If you rebuild the lua-5.3 compiler, you can now replace the compiled lua files in the HPK! I had to use Linux to decompile/recompile the Lua files. Also, you want to be sure to reconstruct the source path from the original file (in the example below that is /Mars/Lua/Cheats.lua).
I've enclosed the file here since I can't attach it. I've made modifications to the base Cheats.lua file. Namely, adding key shortcuts to some of the functions, adding a CheaterGiftBasket function and shortcut (shift-G) and most importantly, changed CheatsEnabled() to return true.
Code: Select all
-- Decompiled using luadec 2.2 rev: 895d923 for Lua 5.3 from https://github.com/viruscamp/luadec
-- function check Command line: -fc Cheats.lua
-- params : ...
-- function num : 0 , upvalues : _ENV
-- function check fail 0 : sizecode org: 131, decompiled: 131, same: 79;
CheatsEnabled = function()
-- function num : 0_0
-- function check pass 0_0
return true
end
CheatMapExplore = function(status)
-- function num : 0_1 , upvalues : _ENV
-- function check pass 0_1
if #g_MapSectors == 0 then
return
end
CreateGameTimeThread(function()
-- function num : 0_1_0 , upvalues : _ENV, status
-- function check pass 0_1_0
local old = IsDepositObstructed
IsDepositObstructed = empty_func
for x = 1, const.SectorCount do
for y = 1, const.SectorCount do
((g_MapSectors[x])[y]):Scan(status)
end
end
IsDepositObstructed = old
end
)
end
local GetCameraLookAtPassable = function()
-- function num : 0_2 , upvalues : _ENV
-- function check fail 0_2 : sizecode org: 17, decompiled: 17, same: 13;
local _, lookat = GetCamera()
if not (terrain.IsPassable)(lookat) or not lookat then
return GetRandomPassableAround(lookat, 100 * guim)
end
end
CheatDustDevil = function(major)
-- function num : 0_3 , upvalues : GetCameraLookAtPassable, _ENV
-- function check fail 0_3 : sizecode org: 29, decompiled: 29, same: 19;
local pos = GetCameraLookAtPassable()
if pos then
local data = DataInstances.MapSettings_DustDevils
if mapdata.MapSettings_DustDevils == "disabled" or not data[mapdata.MapSettings_DustDevils] then
local descr = data.DustDevils_VeryLow
end
local devil = GenerateDustDevil(pos, descr, nil, major)
devil:Start()
else
do
print("No passable point around camera look at")
end
end
end
CheatMeteors = function(meteors_type)
-- function num : 0_4 , upvalues : GetCameraLookAtPassable, _ENV
-- function check fail 0_4 : different code size; sizecode org: 21, decompiled: 20, same: 15;
local pos = GetCameraLookAtPassable()
if pos then
local data = DataInstances.MapSettings_Meteor
do
if mapdata.MapSettings_Meteor == "disabled" or not data[mapdata.MapSettings_Meteor] then
local descr = data.Meteor_VeryLow
end
CreateGameTimeThread(function()
-- function num : 0_4_0 , upvalues : _ENV, descr, meteors_type, pos
-- function check pass 0_4_0
MeteorsDisaster(descr, meteors_type, pos)
end
)
end
end
end
CheatResearchAll = function()
-- function num : 0_5 , upvalues : _ENV
-- function check pass 0_5
if not UICity then
return
end
for filed_id,list in sorted_pairs(UICity.tech_field) do
if (TechFields[filed_id]).discoverable then
for i = 1, #list do
UICity:SetTechResearched(list[i])
end
end
end
end
CheatResearchCurrent = function()
-- function num : 0_6 , upvalues : _ENV
-- function check pass 0_6
if not UICity then
return
end
UICity:SetTechResearched()
end
CheatCompleteAllWiresAndPipes = function(list)
-- function num : 0_7 , upvalues : _ENV
-- function check pass 0_7
SuspendTerrainInvalidations("cheat_wires_and_pipes")
ForEach({class = "ConstructionGroupLeader", exec = function(obj)
-- function num : 0_7_0
-- function check pass 0_7_0
if obj.building_class ~= "LifeSupportGridElement" and obj.building_class ~= "ElectricityGridElement" then
return
end
obj:Complete("quick_build")
end
})
ResumeTerrainInvalidations("cheat_wires_and_pipes")
end
local CompleteBuildConstructionSite = function(site)
-- function num : 0_8
-- function check pass 0_8
if not site.construction_group or (site.construction_group)[1] == site then
site:Complete("quick_build")
end
end
CheatCompleteAllConstructions = function()
-- function num : 0_9 , upvalues : _ENV, CompleteBuildConstructionSite
-- function check pass 0_9
SuspendTerrainInvalidations("cheat_all_constructions")
CheatCompleteAllWiresAndPipes()
for i = 1, 2 do
ForEach({class = "ConstructionSite", exec = CompleteBuildConstructionSite})
end
ResumeTerrainInvalidations("cheat_all_constructions")
end
CheatChangeMap = function(map)
-- function num : 0_10 , upvalues : _ENV
-- function check pass 0_10
if Platform.developer then
CreateRealTimeThread(function()
-- function num : 0_10_0 , upvalues : _ENV, map
-- function check pass 0_10_0
CloseAllDialogs()
Sleep(1)
CloseMenuWizards()
ChangeMap(map)
-- DECOMPILER ERROR at PC12: Confused about usage of register: R0 in 'UnsetPending'
LocalStorage.last_map = map
SaveLocalStorage()
end
)
end
end
UnlockAllTech = function()
-- function num : 0_11 , upvalues : _ENV
-- function check pass 0_11
if not UICity then
return
end
for filed_id,list in sorted_pairs(UICity.tech_field) do
if (TechFields[filed_id]).discoverable then
for i = 1, #list do
UICity:SetTechDiscovered(list[i])
end
end
end
end
CheatUnlockAllBuildings = function()
-- function num : 0_12 , upvalues : _ENV
-- function check pass 0_12
local templates = DataInstances.BuildingTemplate
for i = 1, #templates do
local category = (templates[i]).build_category
-- DECOMPILER ERROR at PC13: Confused about usage of register: R6 in 'UnsetPending'
if not BuildMenuPrerequisiteOverrides[category] then
BuildMenuPrerequisiteOverrides[category] = true
end
end
end
CheatUnlockBreakthroughs = function()
-- function num : 0_13 , upvalues : _ENV
-- function check pass 0_13
local anomalies = 0
local reveal = function(anomaly)
-- function num : 0_13_0 , upvalues : _ENV, anomalies
-- function check pass 0_13_0
if not IsValid(anomaly) or anomaly.tech_action ~= "breakthrough" then
return
end
anomaly:SetRevealed(true)
anomaly:ScanCompleted(false)
DoneObject(anomaly)
anomalies = anomalies + 1
end
ForEach({class = "SubsurfaceAnomalyMarker", exec = function(marker)
-- function num : 0_13_1 , upvalues : reveal, _ENV
-- function check pass 0_13_1
reveal(marker:PlaceDeposit())
DoneObject(marker)
end
})
ForEach({class = "SubsurfaceAnomaly", exec = reveal})
print(anomalies, "breakthroughs technologies have been unlocked")
end
local l_add_funding = 500000000
AddCheatsUA = function()
-- function num : 0_14 , upvalues : _ENV, l_add_funding
-- function check pass 0_14
local CheatsUA = {
MapExplorationScan = {mode = "Game", menu = "Cheats/[01]Map Exploration/[01]Scan", description = "Reveal all Deposits (all)", action = function()
-- function num : 0_14_0 , upvalues : _ENV
-- function check pass 0_14_0
if not CheatsEnabled() then
return
end
CheatMapExplore("scanned")
end
}
,
MapExplorationDeepScan = {mode = "Game", menu = "Cheats/[01]Map Exploration/[02]Deep Scan", description = "Reveal all deposits level 1 and above", action = function()
-- function num : 0_14_1 , upvalues : _ENV
-- function check pass 0_14_1
if not CheatsEnabled() then
return
end
CheatMapExplore("deep scanned")
end
}
,
ChangeMapEmpty = {mode = "Game", menu = "Cheats/[02]Change Map/[1]Empty Map", action = function()
-- function num : 0_14_2 , upvalues : _ENV
-- function check pass 0_14_2
CheatChangeMap("POCMap_Alt_00")
end
}
,
ChangeMapPocMapAlt1 = {mode = "Game", menu = "Cheats/[02]Change Map/[2]Phase 1", action = function()
-- function num : 0_14_3 , upvalues : _ENV
-- function check pass 0_14_3
CheatChangeMap("POCMap_Alt_01")
end
}
,
ChangeMapPocMapAlt2 = {mode = "Game", menu = "Cheats/[02]Change Map/[3]Phase 2 (Early)", action = function()
-- function num : 0_14_4 , upvalues : _ENV
-- function check pass 0_14_4
CheatChangeMap("POCMap_Alt_02")
end
}
,
ChangeMapPocMapAlt3 = {mode = "Game", menu = "Cheats/[02]Change Map/[4]Phase 2 (Late)", action = function()
-- function num : 0_14_5 , upvalues : _ENV
-- function check pass 0_14_5
CheatChangeMap("POCMap_Alt_03")
end
}
,
ChangeMapPocMapAlt4 = {mode = "Game", menu = "Cheats/[02]Change Map/[5]Phase 3", action = function()
-- function num : 0_14_6 , upvalues : _ENV
-- function check pass 0_14_6
CheatChangeMap("POCMap_Alt_04")
end
}
,
TriggerDisasterDustDevil = {mode = "Game", menu = "Cheats/[03]Trigger Disaster/[1]Dust Devil", description = "Dust Devil", action = function()
-- function num : 0_14_7 , upvalues : _ENV
-- function check pass 0_14_7
if not CheatsEnabled() then
return
end
CheatDustDevil()
end
}
,
TriggerDisasterDustDevilMajor = {mode = "Game", menu = "Cheats/[03]Trigger Disaster/[1m]Major Dust Devil", description = "Major Dust Devil", action = function()
-- function num : 0_14_8 , upvalues : _ENV
-- function check pass 0_14_8
if not CheatsEnabled() then
return
end
CheatDustDevil("major")
end
}
,
TriggerDisasterDustStormNormal = {mode = "Game", menu = "Cheats/[03]Trigger Disaster/[2]Dust Storm", description = "Dust Storm", action = function()
-- function num : 0_14_9 , upvalues : _ENV
-- function check pass 0_14_9
if not CheatsEnabled() then
return
end
CheatDustStorm("normal")
end
}
,
TriggerDisasterDustStormGreat = {mode = "Game", menu = "Cheats/[03]Trigger Disaster/[3]Great Dust Storm", description = "Dust Storm", action = function()
-- function num : 0_14_10 , upvalues : _ENV
-- function check pass 0_14_10
if not CheatsEnabled() then
return
end
CheatDustStorm("great")
end
}
,
TriggerDisasterDustStormElectrostatic = {mode = "Game", menu = "Cheats/[03]Trigger Disaster/[4]Electrostatic Dust Storm", description = "Dust Storm", action = function()
-- function num : 0_14_11 , upvalues : _ENV
-- function check pass 0_14_11
if not CheatsEnabled() then
return
end
CheatDustStorm("electrostatic")
end
}
,
TriggerDisasterColdWave = {mode = "Game", menu = "Cheats/[03]Trigger Disaster/[5]Cold Wave", description = "Cold Wave", action = function()
-- function num : 0_14_12 , upvalues : _ENV
-- function check pass 0_14_12
if not CheatsEnabled() then
return
end
CheatColdWave()
end
}
,
TriggerDisasterMeteorsSingle = {mode = "Game", menu = "Cheats/[03]Trigger Disaster/[6]Meteors Single", description = "Meteors", action = function()
-- function num : 0_14_13 , upvalues : _ENV
-- function check pass 0_14_13
if not CheatsEnabled() then
return
end
CheatMeteors("single")
end
}
,
TriggerDisasterMeteorsMultiSpawn = {mode = "Game", menu = "Cheats/[03]Trigger Disaster/[7]Meteors Multi Spawn", description = "Meteors", action = function()
-- function num : 0_14_14 , upvalues : _ENV
-- function check pass 0_14_14
if not CheatsEnabled() then
return
end
CheatMeteors("multispawn")
end
}
,
TriggerDisasterMeteorsStorm = {mode = "Game", menu = "Cheats/[03]Trigger Disaster/[8]Meteors Storm", description = "Meteors", action = function()
-- function num : 0_14_15 , upvalues : _ENV
-- function check pass 0_14_15
if not CheatsEnabled() then
return
end
CheatMeteors("storm")
end
}
,
TriggerDisasterStop = {key = "Alt-S", mode = "Game", menu = "Cheats/[03]Trigger Disaster/[9]Stop Disaster", description = "Stop Disaster", action = function()
-- function num : 0_14_16 , upvalues : _ENV
-- function check pass 0_14_16
if not CheatsEnabled() then
return
end
if g_DustStorm then
StopDustStorm()
else
if g_ColdWave then
StopColdWave()
end
end
end
}
,
G_OpenPregameMenu = {mode = "Game", menu = "Cheats/[06]New Game", description = "Open Pregame Menu", action = function()
-- function num : 0_14_17 , upvalues : _ENV
-- function check pass 0_14_17
CreateRealTimeThread(OpenPreGameMainMenu)
end
}
,
["G_UnlockАllТech"] = {mode = "Game", menu = "Cheats/[04]Research/[10]Unlock all Tech", description = "Unlock all techs instantly", action = function()
-- function num : 0_14_18 , upvalues : _ENV
-- function check pass 0_14_18
if not CheatsEnabled() then
return
end
UnlockAllTech()
end
}
,
G_ResearchCurrent = {key = "Alt-R", mode = "Game", menu = "Cheats/[04]Research/[08]Research current tech", description = "Finish current research instantly", action = function()
-- function num : 0_14_19 , upvalues : _ENV
-- function check pass 0_14_19
if not CheatsEnabled() then
return
end
CheatResearchCurrent()
end
}
,
G_ResearchAll = {key = "Alt-P", mode = "Game", menu = "Cheats/[04]Research/[09]Research all", description = "Research all techs instantly", action = function()
-- function num : 0_14_20 , upvalues : _ENV
-- function check pass 0_14_20
if not CheatsEnabled() then
return
end
CheatResearchAll()
end
}
,
G_UnlockAllBuildings = {mode = "Game", menu = "Cheats/[10]Unlock all buildings", description = "Unlock all buildings for construction", action = function()
-- function num : 0_14_21 , upvalues : _ENV
-- function check pass 0_14_21
if not CheatsEnabled() then
return
end
CheatUnlockAllBuildings()
end
}
,
G_UnpinAll = {mode = "Game", menu = "Cheats/[10]Unpin All Pinned Objects", description = "Unpin All Pinned Objects", action = function()
-- function num : 0_14_22 , upvalues : _ENV
-- function check pass 0_14_22
if not CheatsEnabled() then
return
end
UnpinAll()
end
}
,
UnlockAllBreakthroughs = {key = "Shift-R", mode = "Game", menu = "Cheats/[04]Research/[11]Unlock all Breakthroughs", description = "Unlock all breakthroughs on this map", action = function()
-- function num : 0_14_23 , upvalues : _ENV
-- function check pass 0_14_23
if not CheatsEnabled() then
return
end
CheatUnlockBreakthroughs()
end
}
,
SpawnColonist1 = {key = "Shift-T", mode = "Game", menu = "Cheats/[05]Spawn Colonist/[1]Spawn 1 Colonist", description = "Spawn 1 Colonist", action = function()
-- function num : 0_14_24 , upvalues : _ENV
-- function check pass 0_14_24
if not CheatsEnabled() then
return
end
CheatSpawnNColonists(1)
end
}
,
SpawnColonist10 = {key = "Shift-Y", mode = "Game", menu = "Cheats/[05]Spawn Colonist/[2]Spawn 10 Colonist", description = "Spawn 10 Colonist", action = function()
-- function num : 0_14_25 , upvalues : _ENV
-- function check pass 0_14_25
if not CheatsEnabled() then
return
end
CheatSpawnNColonists(10)
end
}
,
SpawnColonist100 = {mode = "Game", menu = "Cheats/[05]Spawn Colonist/[3]Spawn 100 Colonist", description = "Spawn 100 Colonist", action = function()
-- function num : 0_14_26 , upvalues : _ENV
-- function check pass 0_14_26
if not CheatsEnabled() then
return
end
CheatSpawnNColonists(100)
end
}
,
G_CompleteWiresPipes = {mode = "Game", menu = "Cheats/[12]Complete wires\\pipes", description = "Complete all wires and pipes instantly", action = function()
-- function num : 0_14_27 , upvalues : _ENV
-- function check pass 0_14_27
if not CheatsEnabled() then
return
end
CheatCompleteAllWiresAndPipes()
end
}
,
G_CompleteConstructions = {mode = "Game", menu = "Cheats/[13]Complete constructions", key = "Alt-B", description = "Complete all constructions instantly", action = function()
-- function num : 0_14_28 , upvalues : _ENV
-- function check pass 0_14_28
if not CheatsEnabled() then
return
end
CheatCompleteAllConstructions()
end
}
,
G_ModsEditor = {mode = "Game", menu = "Cheats/[14]Mod editor", action = function()
-- function num : 0_14_29 , upvalues : _ENV
-- function check pass 0_14_29
if not CheatsEnabled() then
return
end
ModEditorOpen()
end
}
,
G_AddFunding = {mode = "Game", menu = "Cheats/[15]Add funding $" .. l_add_funding, key = "Shift-F", action = function()
-- function num : 0_14_30 , upvalues : _ENV, l_add_funding
-- function check pass 0_14_30
if not CheatsEnabled() then
return
end
UICity:ChangeFunding(l_add_funding)
end
}
,
G_ToggleOnScreenHints = {mode = "Game", menu = "Cheats/[16]Toggle on-screen hints", action = function()
-- function num : 0_14_31 , upvalues : _ENV
-- function check pass 0_14_31
if not CheatsEnabled() then
return
end
SetHintNotificationsEnabled(not HintsEnabled)
UpdateOnScreenHintDlg()
end
}
,
G_ResetOnScreenHints = {mode = "Game", menu = "Cheats/[17]Reset on-screen hints", action = function()
-- function num : 0_14_32 , upvalues : _ENV
-- function check pass 0_14_32
if not CheatsEnabled() then
return
end
g_ShownOnScreenHints = {}
UpdateOnScreenHintDlg()
end
}
,
G_ToggleSigns = {key = "Ctrl-U", mode = "Game", menu = "Cheats/[18]Toggle Signs", action = function()
-- function num : 0_14_33 , upvalues : _ENV
-- function check pass 0_14_33
if not CheatsEnabled() then
return
end
ToggleSigns()
end
}
,
G_ToggleInGameInterface = {key = "Ctrl-I", mode = "Game", menu = "Cheats/[19]Toggle InGame Interface", action = function()
-- function num : 0_14_34 , upvalues : _ENV
-- function check pass 0_14_34
-- DECOMPILER ERROR at PC9: Confused about usage of register: R0 in 'UnsetPending'
hr.RenderUIL = hr.RenderUIL == 0 and 1 or 0
end
}
,
G_ToggleInfopanelCheats = {key = "Shift-I", menu = "Cheats/[07]Toggle Infopanel Cheats", description = function()
-- function num : 0_14_35 , upvalues : _ENV
-- function check pass 0_14_35
local action = config.BuildingInfopanelCheats and "Disable" or "Enable"
return action .. " the cheats in the infopanels"
end
, action = function()
-- function num : 0_14_36 , upvalues : _ENV
-- function check pass 0_14_36
-- DECOMPILER ERROR at PC4: Confused about usage of register: R0 in 'UnsetPending'
config.BuildingInfopanelCheats = not config.BuildingInfopanelCheats
ReopenSelectionXInfopanel()
end
},
G_CheatBasket = {key = "Shift-G", mode = "Game", menu = "Cheats/[21]Cheater Gift Basket", action = function()
UICity:ChangeFunding(50000000)
config.BuildingInfopanelCheats = true
CheatMapExplore("scanned")
return "gift basket deployed"
end
}
}
CheatsUA.FreeCamera = {key = "Shift-C", mode = "Game", menu = "Cheats/[20]Toggle Free Camera", action = function()
-- function num : 0_14_37 , upvalues : _ENV
-- function check pass 0_14_37
if not mapdata.GameLogic then
return
end
if (cameraFly.IsActive)() then
SetMouseDeltaMode(false)
ShowMouseCursor("InGameCursor")
;
(cameraRTS.Activate)(1)
else
print("Camera Fly")
;
(cameraFly.Activate)(1)
HideMouseCursor("InGameCursor")
SetMouseDeltaMode(true)
end
end
}
if Platform.editor or Platform.pc or Platform.desktop then
(UserActions.AddActions)(CheatsUA)
end
end
-- DECOMPILER ERROR at PC31: Confused about usage of register: R3 in 'UnsetPending'
OnMsg.DataLoaded = function()
-- function num : 0_15 , upvalues : _ENV
-- function check pass 0_15
AddCheatsUA()
end
if not FirstLoad then
AddCheatsUA()
end
GamepadCheatsList = {
{display_name = T({7790, "Research Current Tech"}), func = CheatResearchCurrent}
,
{display_name = T({7791, "Research all Techs"}), func = CheatResearchAll}
,
{display_name = T({7792, "Unlock all Techs"}), func = UnlockAllTech}
,
{display_name = T({7793, "Unlock all Breakthroughs"}), func = CheatUnlockBreakthroughs}
,
{display_name = T({7794, "Construct all buildings"}), func = CheatCompleteAllConstructions}
,
{display_name = T({7795, "Add funding ($500,000,000)"}), func = function()
-- function num : 0_16 , upvalues : _ENV, l_add_funding
-- function check pass 0_16
UICity:ChangeFunding(l_add_funding)
end
}
,
{display_name = T({7796, "Spawn 1 Colonist"}), func = function()
-- function num : 0_17 , upvalues : _ENV
-- function check pass 0_17
CheatSpawnNColonists(1)
end
}
,
{display_name = T({7797, "Spawn 10 Colonists"}), func = function()
-- function num : 0_18 , upvalues : _ENV
-- function check pass 0_18
CheatSpawnNColonists(10)
end
}
,
{display_name = T({7798, "Spawn 100 Colonists"}), func = function()
-- function num : 0_19 , upvalues : _ENV
-- function check pass 0_19
CheatSpawnNColonists(100)
end
}
}
There's also (of course) a way to simply enable cheats from Cheat Engine, but you don't get the perks of having things like the InfoPanel cheats enabled, etc. That method is:
1. Search for the binary array "03 00 00 00 26 00 00 01 26 00 80 00 73 02 00 00 D0 B0 76 80 73 02 00 00 18 00 00 00 00 00 00 00". This is the series of instructions that cause "return false" to be returned when the function CheatsEnabled is called.
2. Replace the first four bytes value at that memory location with "03 00 80 00". This will turn the return false into a return true.
This cheat isn't overly effective in my opinion, since it only really lets you use free camera, and Alt-B to complete building quickly. For the real power house, you have to work for it and build the tools to replace the Cheats.lua file in the HPK. The process for that (roughly) is below:
1. Extract the HPK file using the HPK Archiver tool found at:
[Link]
2. Build the Lua decompiler following the instructions at:
[Link] Be sure to configure it for version 5-3 of Lua!!!
3. Comment out the lines below in the file : lua-5.3/src/lundump.c
//checksize(S, Instruction);
//checksize(S, lua_Integer);
4. Comment out the lines below in the file: lua-5.3/src/ldump.c
// DumpByte(sizeof(Instruction), D); // Comment these out!
// DumpByte(sizeof(lua_Integer), D); // Comment these out!
5. Rebuild the decompiler/compiler suit per the instructions on the luadec page. This will give you a compiler that can produce compiled lua files compatible with the game.
6. Create a directory tree for the Cheats.lua file (enclosed above) of ./Mars/Lua/ and place the Cheats.lua file from above in that location.
7. Compile it with: <path to your luadec/lua-5.3/src location> luac -o Cheats.lua Mars/Lua/Cheats.lua
8 Copy the resulting Cheats.lua file OVER the old one at <HPK Extraction Path>/Lua/Cheats.lua
9. Rebuild the HPK archive to a new Lua.HPK file.
10. Move the original Lua.HPK file to Lua.HPK.original
11. Move the new Lua.HPK file you just made into the original Lua.HPK location.
12. Start the game!
13. Press the Shift-G key to get the Cheater's Gift Basket.
Use the keys below to get stuff when you need it, etc.
Alt-S -- May stop disaster (had varying luck on this one).
Alt-R -- Research the current technology in the tech tree.
Alt-P -- Research ALL the techs in the tech tree.
Shift-R -- May research all breakthroughs. (should work, but haven't tested yet)
Shift-T -- Add one colonist at the dome selected. NOTE THAT YOU MUST HAVE FOOD, AIR, WATER, AND POWER for this to work.
Alt-B -- Complete all placed but incomplete buildings (does NOT count against current resources)
Shift-F -- Add funding (maybe?)
Shift-I -- Turn on/off info panel cheats (maybe?)
Alt-G -- Gift Basket! (Scan map, give $50,000,000, and turn on info panel cheats).
So this was long winded, but I wanted to share what I had learned. I hope it's helpful to folks out there who want to know more about building cheats and modifying games to play they way we want them to.
I also have give kudos to the developers of this game. It's fun, well balanced, and a great game over all. I bought it and I'm glad I did. Also, clever work on changing the way the compiler builds compiled lua files. It made is tricky to debug the decompilation failures. I can't wait to buy (and learn to cheat) on your next title Paradox!