In Cheats there is the Option "Toggle Infopanel Cheats" click on it.
Select an Survivor on the Last Panel you have many Options like ToggleInvulnerable.
In Cheats there is the Option "Toggle Infopanel Cheats" click on it.
I too found myself in the same problem.Omani2999 wrote: ↑Mon Nov 21, 2022 11:33 amHow to read data from a file in Lua ?souldev7 wrote: ↑Sun Oct 30, 2022 12:16 amIt's the same as [Surviving Mars] by same company, except would appear mods are disabled.
The loader apparatus is there, and it uses same bootstrap. But obviously not shown in the UI, nor does it appear to load metadata files.
So instead, best way to tweak the insanity of this game to some degree, is to unpack the HPK, decompile the LUA, modify it, and pack it back up.
This 100% worked for me, was easy enough to do with GREP scans to find what I wanted.
For instance, you can increase max # of survivors when starting a game:Or double the speed of movement of your survivors (1000 = 1, so 2000 = 2; same applies for all integers in the game, if you search for "movement_adjust" you'll see it's a multiplier reduced by 1k affecting a 100% scaled integer.. so it's like: 0.25 * 1 = 25% where .25 is dynamic based on condition of the unit):Code: Select all
-- ./Lua/Lua/__const.lua DefineConst({ group = "Gameplay", id = "MaxSurvivorsCount", value = 6 }) -- ./Lua/Lua/PreGameSetup.lua function GetMaxSurvivorsCount(scenario_id) local scenario_def = scenario_id and ScenarioDefs[scenario_id] return const.Gameplay.MaxSurvivorsCount end
Or speed up bandage craft speed:Code: Select all
-- ./Lua/Lua/UnitComponents/UnitHealth.lua invulnerable = false, is_falling = false, next_vomit_time = false, is_vomiting = false, movement_adjust = 2000
Or let people chill the F out a little:Code: Select all
-- ./Data/Recipe.lua Activity = "Crafting", ActivityDuration = 10000, ActivityXPGrade = "Crafting_Low", BuildCategory = "CraftResources", Description = T(746560224749, "Make bandages from cloth pieces."), DisplayName = T(751595636010, "Bandages (scrap cloth)"),
---------------------Code: Select all
-- ./Lua/Lua/UnitComponents/UnitRelaxation.lua category = "Relaxation", id = "RelaxationLossPerDay", name = T(241929465459, "Daily relaxation loss"), editor = "number", modifiable = true, scale = 1000, default = 30000
So in order to do that, you need the HPK extractor.. [Link]
Then you need a decompiler. I used the Mod package here: https://www.fearlessrevolution.com/surv ... ?tab=files
(which is just a powershell script to extract everything)
Combined with unluac: [Link]
I found that the Victor Vran bytecode header situation applies here. Given that they switched to lua 5.3.
Powershell script handles that for you when executing hpk.exe.
However when repackaging I found that you HAVE to disable compression or the game just crashes, or fails to load the main menu runtime (step 4 below).
That could just be a switch for lz4 algorithm that needs tweaked a bit. Not sure, but uncompressed works just fine for me.
So the process is like so:
1. Follow the guide for the NexusMod powershell script (you need java, unluac, and hpk.exe sitting in the root folder of the game. set exec policy, and run it)
2. Now you have extracted everything (__Unpacked folder). __Unpacked/Packs/Lua and ./Data are of interest.
3. Modify whatever you want.
4. Pack it up using the command: (specify the folder to repackage, ex. "Lua", or "Data")Code: Select all
hpk create --cripple-lua-files --dont-compress-files Lua Lua.hpk
and copy that to C:\Program Files (x86)\Steam\SteamApps\common\Stranded Alien Dawn\Packs (and overwrite, after you backup original obviously).
Test that game boots and no corrupt decompilation/repackaging, & off you go.
I still haven't been able to find certain things, like % chance of Expedition resulting in a new recruit (I'm on year 8 and still 5 people; rough as hell with 100+ unit enemy spawns. I like it tough, just not without hope for the future ).
I'm also very curious about fixing the pathing (character runs back and forth across a field to gather, when it could rather target the closest pickup), and spotted several files in there relating to it. So far looks like potentially a simple array sort will resolve.
Anyway - good luck to he who reads, and he who doesn't too.
RecipeTweaks mod won't show up in in-game mod options, HumanTweaks works fine.souldev7 wrote: ↑Tue Nov 08, 2022 10:39 amAlright, first up:
Notice: Please don't quote reply me! my posts are too long, you blowin' up the thread (>^.^)>
Related intel i've discovered:Notably: I found that Mods don't have the proper ENV to manipulate pre-game-setup.Spoiler
- Game runs LUA 5.4, not 5.3 (which is why luadec doesn't work; size_t header mismatch).
- LUA 5.4 apparently deeply changed how constant pointers are managed. couldn't fix luadec myself.
- Researched sources and found in Mod.lua that mod loading can be forced using:Since config requires manipulating HPK's, the better strategy is to use AccountStorage.Code: Select all
AccountStorage.LoadAllMods || config.LoadAllMods
- One could place the following into LocalStorage.lua to enable all mods:However, mods can't manipulate the pre-game-setup. Mods are heavily restricted by ENV, and only truly execute with a useful scope once the game runs (playing)Spoiler
Then boot the game once. Then mods are forcefully enabled. Warning: ALL mods in the mod folder will be loaded, even if they are broken.Code: Select all
-- C:\Users\<you>\AppData\Roaming\Stranded - Alien Dawn\LocalStorage.lua local ranOnce=false local function temp() if (ranOnce) then return end ranOnce = true AccountStorage.LoadAllMods = true SaveAccountStorage(1000) end OnMsg.AccountStorageChanged = temp return { ...
Since LocalStorage is overwritten (object dump with "return" prefix) each game exit, the above will simply disappear.
But now your AccountStorage.lua object specifies to load all mods in the default mods folder: C:\Users\<you>\AppData\Roaming\Stranded - Alien Dawn\Mods\
(which follows same methodology as Surviving Mars, to which there are plenty of online guides).
- Some notes about AccountStorage:Spoiler
- AccountStorage is a memory object exported to a file: AccountStorage.lua
- AccountStorage.lua is encrypted using AES with SHA256 key
- The key is comprised of:- Thus: "Stranded - Alien Dawn1ac7d4eb8be00f1bf6ae7af04142b8fc"Code: Select all
GetAppId() .. (config.ProjectKey or "1ac7d4eb8be00f1bf6ae7af04142b8fc")
- They append an "HMAC" (sha256 of above key) onto the end of it in a strange obfuscation/verification attempt I suppose.
- That file is then HPK packed into something called Account.dat, stored in the SaveGames folder.
Which is the whole reason above that I used LocalStorage.lua to hook the AccountStorageChanged event, so as to manipulate it without having to manually reengineer their encryption algo to tweak the file..
So stumbled across DLC.lua, which provisions _G env scope.
Thus: "SADEnabler DLC" has been born.
Zip file Attached (password per forum regulations: F34RL3SS)
With this, Mods can be enabled.
Read the README please.
[Link][Link][Link][Link][Link]
-----------
SADEnabler_tool_src.zip
I do not intend to provide support, nor updates.
All source code included, so it's all yours.
--------------
Additional Notes:Spoiler
This greatly simplifies things, as no longer have to repackage and overwrite the HPK bundles.
You can if you want -- but if you've been following along -- that is unstable.
However it's still useful to unpack(hpk) and decompile(unluac) for [Link] research/hook purposes.
Also in the attachment is my custom tool, which basically is a rewrite of the Powershell Script into C#.
This should help those of you having powershell problems.
It runs on .net core 6, which comes to you via Windows Update (should just work oob).
Use: Tool-Menu.bat, then look at the sources folder after Initializing.
If any of this doesn't make sense I can't help you. Sorry! Reread above perhaps.
I cannot say it any more simply than I have, and googling of how Surviving Mars works should tell you everything you need.
Did my best to make this as simple as possible.
number colony still work.. I just try right now.. it's easy make sureChristheW wrote: ↑Sun Apr 30, 2023 10:07 pmHey guys
So, since today it looks like, nothing is working anymore...
If you search for the survivors at the beginning (for a start with 5+), you need to check for 4byte unknown values and in-/decreasing.
I got mostly (not always) 3 values back, one is 1+number of survivors, one is like in binary (65k) and the last one is kinda 3+2*survivor.
HOWEVER, when you lock thos three values, the game freezes within 30-60sec. When you are fast enough, you can start.
Next: The Storage method doesn't work (With the stockpile earlier in this post).
You can still find the 3 values for your stockpile, however, the global values is somehow fading away (at first it looks like its fine but when you got back to game by ALT+TAB it changes.
The skills you can still calculate for some. (lvl1,0exp=1000, lvl2,0exp=2400, lvl3,0exp=4400, ---- as basic and just add the exp of the skilllevel)
However, intelligence and some other seem to work with a different calkulation (maybe its not that clear stepped as physiology [maybe float?])
Someboday has a workaround to get something or hooking up on this game for table dev as it is released now?
The cheat-SW developer still doesn't support the game. At least, there is nothing on the sites.
Cheers
Chris