longer time ago I made this -> viewtopic.php?p=121562#p121562
back then in early-access the devs used the Monogame-Engine, the final release changed the engine.
this topic is only about the used Lua I won't bother to do a normal table( e.g doing string compares to get pointers to the Lua variables ) so this here is for people who likes to experiment and explore with commands.
While looking at the Lua in this game I noticed that some stuff is different,the Lua functions are inside the EngineWin64s.dll instead of in the Lua52.dll and some of the macros are replaced with functions.
what do I mean with macros:
Code: Select all
#define luaL_dostring(L, s) \
(luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0))
my table is getting the lua_state before a lua_gettop call ( the game has more than one lua_state) and then calling dostring with the lua_state instance and a string that contains Lua script
how the table works:
activate Enable and if you click on Execute Lua a input window will appear, you can use lua commands here.
some easy commands that are tested and working:
Code: Select all
AddMoney( 1000, "GrantUpgrade" )
AddResource( "MetaPoints", 100, "Debug" )
AddResource( "Gems", 100, "Debug" )
AddResource( "LockKeys", 100, "Debug" )
AddResource( "GiftPoints", 100, "Debug" )
AddResource( "SuperLockKeys", 100, "Debug" )
AddResource( "SuperGems", 100, "Debug" )
AddResource( "SuperGiftPoints", 100, "Debug" )
AddRerolls( 99, "Debug", { IgnoreMetaUpgrades = true } )
CreateWeaponLoot()
CreateStackLoot()
AddSuperRarityBoost()
SetPlayerInvulnerable()
SetPlayerVulnerable()
BuildSuperMeter( CurrentRun, 100 )
DestroyRequiredKills() --kills all enemies in room
xxx = any value you want:
Code: Select all
CurrentRun.Hero.MaxHealth = xxx
CurrentRun.Hero.Health = xxx
HeroData.DefaultHero.MaxHealth = xxx
DefaultHero.MaxHealth is permanent until you reload the savegame.
not tested / not working correctly:
Code: Select all
LiveFillInShopOptions() StartUpStore()
GenerateMarketItems()
RecordFish(GetFish("Tartarus", "Good"))
you can also do more complex stuff:
e.g if you want a full heal you could spawn lots of heal items:
Code: Select all
local playerId = GetIdsByType({ Name = "_PlayerUnit" }) for i=0,20 do DropHealth( "HealDropMinor", playerId ) end
Code: Select all
CreateLoot({ Name = "AthenaUpgrade" , OffsetX = 100 })
--
CreateLoot({ Name = "DionysusUpgrade" , OffsetX = 100 })
--
CreateLoot({ Name = "AresUpgrade" , OffsetX = 100 })
--
CreateLoot({ Name = "PoseidonUpgrade" , OffsetX = 100 })
--
CreateLoot({ Name = "ZeusUpgrade" , OffsetX = 100 })
--
CreateLoot({ Name = "AphroditeUpgrade" , OffsetX = 100 })
--
CreateLoot({ Name = "ArtemisUpgrade" , OffsetX = 100 })
--
CreateLoot({ Name = "HermesUpgrade" , OffsetX = 100 })
--
CreateLoot({ Name = "DemeterUpgrade" , OffsetX = 100 })
Code: Select all
local consumableName = "ChaosWeaponUpgrade" local playerId = GetIdsByType({ Name = "_PlayerUnit" }) local consumableId = SpawnObstacle({ Name = consumableName, DestinationId = playerId, Group = "Standing" }) local consumable = CreateConsumableItem( consumableId, consumableName, 0 )
Code: Select all
UnlockEntireCodex() thread( ShowCodexUpdate )
Code: Select all
EquipPlayerWeapon( WeaponData.SwordWeapon, { PreLoadBinks = true, LoadPackages = true } )
--
EquipPlayerWeapon( WeaponData.SpearWeapon, { PreLoadBinks = true, LoadPackages = true } )
--
EquipPlayerWeapon( WeaponData.ShieldWeapon, { PreLoadBinks = true, LoadPackages = true } )
--
EquipPlayerWeapon( WeaponData.BowWeapon, { PreLoadBinks = true, LoadPackages = true } )
--
EquipPlayerWeapon( WeaponData.GunWeapon, { PreLoadBinks = true, LoadPackages = true } )
--
EquipPlayerWeapon( WeaponData.FistWeapon, { PreLoadBinks = true, LoadPackages = true } )
Code: Select all
AddTraitToHero({TraitData = GetProcessedTraitData({ Unit = CurrentRun.Hero, TraitName = "SpearThrowBounce", Rarity = "Common"}) })
of course you can do way way more didn't have the time yet to dig deep into it ... also I didn't look yet to dump all the _G globals edit : dumped some stuff - its now attached as txt file to this post and I've added some more useful Lua commands here.
feel free to share lua scripts if you find something useful
if you go into the Hades\Content\Scripts folder you can see all the .lua scripts that are loaded from the game, this should help to figure out more stuff.
note : its only for the x64 version of the game
make sure to use Cheat Engine 7.3 - some older versions will freeze if you attach it to the game!
make sure that the game is paused if you are playing in windowed mode while executing lua scripts
Im not sure why but windowed mode can cause a crash if you spawn something,
solutions to it : play in fullscreen mode or pause the process with a cheat engine hotkey (settings->hotkey->pause the selected process)
//
added the UDF method from SunBeam, thanks for that!
now there is a big input field and a Log that shows previous commands, you can send commands with Shift+Enter.
//
reuploaded the UDF table with "0FR" prefix to exclude it from FearlessRevolution BETA ( UDF controls are not compatible for now )
How to use this cheat table?
- Install Cheat Engine
- Double-click the .CT file in order to open it.
- Click the PC icon in Cheat Engine in order to select the game process.
- Keep the list.
- Activate the trainer options by checking boxes or setting values from 0 to 1