[Request] Stranded: Alien Dawn

Ask about cheats/tables for single player games here
Ashar
Expert Cheater
Expert Cheater
Posts: 278
Joined: Mon May 01, 2017 7:04 pm
Reputation: 34

Re: [Request] Stranded: Alien Dawn

Post by Ashar »

thx, but no real need for that, the game has built in option to have all your survivors have lvl 10 skills

User avatar
jst_dust
Noobzor
Noobzor
Posts: 5
Joined: Tue Aug 21, 2018 7:41 am
Reputation: 8

Re: [Request] Stranded: Alien Dawn

Post by jst_dust »

@Ashar true i just stubled upon it trying to find a way to enable the build in cheat menu :D

Just found a hacky way to do it.

Before starting the game goto:
%APPDATA%\Stranded - Alien Dawn\LocalStorage.lua

before `return {` add Platform.cheats = true

so:

Code: Select all

Platform.cheats = true
return {
and Ctrl+c toggles the ingame menus'

schoolofmonkey
What is cheating?
What is cheating?
Posts: 4
Joined: Wed Mar 28, 2018 9:00 am
Reputation: 1

Re: [Request] Stranded: Alien Dawn

Post by schoolofmonkey »

jst_dust wrote:
Fri Oct 28, 2022 10:35 pm
@Ashar true i just stubled upon it trying to find a way to enable the build in cheat menu :D

Just found a hacky way to do it.

Before starting the game goto:
%APPDATA%\Stranded - Alien Dawn\LocalStorage.lua

before `return {` add Platform.cheats = true

so:

Code: Select all

Platform.cheats = true
return {
and Ctrl+c toggles the ingame menus'
Hey, I've been following this thread for a while, new here, but have been using cheat engine for a while, this game is doing my head in.

I have tried your suggestion of editing the LocalStorage.lua file, didn't do anything for me.

Edit: Worked it out, it was the ` key for me.

Ashar
Expert Cheater
Expert Cheater
Posts: 278
Joined: Mon May 01, 2017 7:04 pm
Reputation: 34

Re: [Request] Stranded: Alien Dawn

Post by Ashar »

yeah, same for me, this is a game changer, its basicly like creative mode now

Zellno
Noobzor
Noobzor
Posts: 6
Joined: Tue Oct 25, 2022 3:54 pm
Reputation: 0

Re: [Request] Stranded: Alien Dawn

Post by Zellno »

schoolofmonkey wrote:
Sat Oct 29, 2022 3:41 am
jst_dust wrote:
Fri Oct 28, 2022 10:35 pm
@Ashar true i just stubled upon it trying to find a way to enable the build in cheat menu :D

Just found a hacky way to do it.

Before starting the game goto:
%APPDATA%\Stranded - Alien Dawn\LocalStorage.lua

before `return {` add Platform.cheats = true

so:

Code: Select all

Platform.cheats = true
return {
and Ctrl+c toggles the ingame menus'
Hey, I've been following this thread for a while, new here, but have been using cheat engine for a while, this game is doing my head in.

I have tried your suggestion of editing the LocalStorage.lua file, didn't do anything for me.

Edit: Worked it out, it was the ` key for me.
I also realized that I need to change the LocalStorage.lua file to read-only. If not the game rewrites it as soon as it starts, "reminded me of the xcom2 file edit". :shock:

statictime
What is cheating?
What is cheating?
Posts: 1
Joined: Fri Oct 28, 2022 8:53 pm
Reputation: 0

Re: [Request] Stranded: Alien Dawn

Post by statictime »

Anyone know how to prevent freezing after a couple hours or days when modifying your resources? dismantling the storage in which the modified resource is located works, any other method?

souldev7
What is cheating?
What is cheating?
Posts: 4
Joined: Wed Aug 11, 2021 12:46 am
Reputation: 1

Re: [Request] Stranded: Alien Dawn

Post by souldev7 »

It'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:

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 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/UnitComponents/UnitHealth.lua
  invulnerable = false,
  is_falling = false,
  next_vomit_time = false,
  is_vomiting = false,
  movement_adjust = 2000
Or speed up bandage craft speed:

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)"),
Or let people chill the F out a little:

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/survivingmars ... ?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 :P ).
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.
Last edited by souldev7 on Sun Oct 30, 2022 4:32 am, edited 2 times in total.

schoolofmonkey
What is cheating?
What is cheating?
Posts: 4
Joined: Wed Mar 28, 2018 9:00 am
Reputation: 1

Re: [Request] Stranded: Alien Dawn

Post by schoolofmonkey »

You can set units to to invulnerable within the game, so with Ctrl+C it'll add options to the info panels of settlers, plants, animal etc, and ` tide brings the cheat menu down.
Now you can break your game if you say delete an assignment to a building, like when you click on the floor of the building, it highlights orange, if you delete that the orange selection is gone, but the building is still there, which then marks it's as an invalid item, Autosave will stop, plus you can't manual save due to owning an invalid item (can't remember the error exactly).

Plus you can even earn achievements with the cheat menu.

Zellno
Noobzor
Noobzor
Posts: 6
Joined: Tue Oct 25, 2022 3:54 pm
Reputation: 0

Re: [Request] Stranded: Alien Dawn

Post by Zellno »

souldev7 wrote:
Sun Oct 30, 2022 12:16 am
It'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:

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 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/UnitComponents/UnitHealth.lua
  invulnerable = false,
  is_falling = false,
  next_vomit_time = false,
  is_vomiting = false,
  movement_adjust = 2000
Or speed up bandage craft speed:

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)"),
Or let people chill the F out a little:

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 :P ).
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.
Thanks, this was a doubt I was having, I even thought about it but my lua.hpk file after packing it again got a size of 13.2 MB, and when the game loads the screen goes black after a while and so don't go forward. Will it be a corrupted file? I also heard a guy talking on the forum [Link] that Stranded: Alien Dawn are zipped with Zstd

ok, I found out that the one with the lua file here doesn't work, but with the Data.hpk file it works very well, why one works and the other doesn't, I have no idea. :shock: :shock:
Last edited by Zellno on Sun Oct 30, 2022 6:10 pm, edited 3 times in total.

Phantom Flan Flinger
What is cheating?
What is cheating?
Posts: 4
Joined: Sun Oct 30, 2022 1:15 pm
Reputation: 0

Re: [Request] Stranded: Alien Dawn

Post by Phantom Flan Flinger »

Akira wrote:
Thu Oct 13, 2022 10:57 pm
WarStalkeR wrote:
Thu Oct 13, 2022 9:39 am
Actually, I've managed to change amount of survivors you can start game with. Search one byte for amount of selected survivors. Freeze it at 1, add 20+ survivors, unfreeze, game will ask if you want to start only with 1 survivor, click OK/continue. And viola, you start with whole colony of survivors.
You can also scan for this AoB F2 0F ? ? 0F B6 ? ? 88 42 ? E9 ? ? ? ? 8B F7 and find out what the address accesses to get the value, saves you the time of scanning.
The address handles a few more values which i couldn't separate so far which is why I haven't made a script.

Edit:
Here ya go, activate it, add a survivor, disable script and remove a survivor and you can add as many as you want.

Code: Select all

[ENABLE]

aobscanmodule(SurvivorMaxCountAndWhoKnowsWhatElse,StrandedSteam.exe,F2 0F ? ? 4C 8B ? ? ? ? ? 4C 8B ? ? ? ? ? 4C 8B ? ? ? ? ? F2 41 ? ? ? ? 0F B6 ? ? 41 88 ? ? ? E9 ? ? ? ? 4D 8B)
alloc(newmem,$1000,SurvivorMaxCountAndWhoKnowsWhatElse)

label(code)
label(return)

newmem:
  cmp byte ptr [rax],04
  jne code
  mov byte ptr [rax],FF //;MaxSurvivorSelectCount

code:
  movsd xmm0,[rax]
  mov r8,[rbp+000001F8]
  jmp return

SurvivorMaxCountAndWhoKnowsWhatElse:
  jmp newmem
  nop 6
return:
registersymbol(SurvivorMaxCountAndWhoKnowsWhatElse)

[DISABLE]

SurvivorMaxCountAndWhoKnowsWhatElse:
  db F2 0F 10 00 4C 8B 85 F8 01 00 00

unregistersymbol(SurvivorMaxCountAndWhoKnowsWhatElse)
dealloc(newmem)
How does one make this have 8 survivors only ?

pandalorian
What is cheating?
What is cheating?
Posts: 3
Joined: Thu Oct 27, 2022 3:01 pm
Reputation: 0

Re: [Request] Stranded: Alien Dawn

Post by pandalorian »

souldev7 wrote:
Sun Oct 30, 2022 12:16 am


For instance, you can increase max # of survivors when starting a game:

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
First, big thanks for your post! It really helped me get the game to where it's actually enjoyable.

Regarding the survivor count, do you modify the existing GetMaxSurvivorsCount() in PreGameSetup.lua, or does preceeding it with the keyword "function" make enough of a difference (tbh, I'm more familiar with java than lua).

Phantom Flan Flinger
What is cheating?
What is cheating?
Posts: 4
Joined: Sun Oct 30, 2022 1:15 pm
Reputation: 0

Re: [Request] Stranded: Alien Dawn

Post by Phantom Flan Flinger »

jst_dust wrote:
Fri Oct 28, 2022 10:35 pm
@Ashar true i just stubled upon it trying to find a way to enable the build in cheat menu :D

Just found a hacky way to do it.

Before starting the game goto:
%APPDATA%\Stranded - Alien Dawn\LocalStorage.lua

before `return {` add Platform.cheats = true

so:

Code: Select all

Platform.cheats = true
return {
and Ctrl+c toggles the ingame menus'
does not seem to be command to spawn another survivor as that is all i would use it for :)

Zellno
Noobzor
Noobzor
Posts: 6
Joined: Tue Oct 25, 2022 3:54 pm
Reputation: 0

Re: [Request] Stranded: Alien Dawn

Post by Zellno »

Phantom Flan Flinger wrote:
Sun Oct 30, 2022 6:57 pm
jst_dust wrote:
Fri Oct 28, 2022 10:35 pm
@Ashar true i just stubled upon it trying to find a way to enable the build in cheat menu :D

Just found a hacky way to do it.

Before starting the game goto:
%APPDATA%\Stranded - Alien Dawn\LocalStorage.lua

before `return {` add Platform.cheats = true

so:

Code: Select all

Platform.cheats = true
return {
and Ctrl+c toggles the ingame menus'
does not seem to be command to spawn another survivor as that is all i would use it for :)
If you press ' on the keyboard and search for place (survivor's name) it can bring up anyone I think. example: Place Annette G_SpawnCharacter

Phantom Flan Flinger
What is cheating?
What is cheating?
Posts: 4
Joined: Sun Oct 30, 2022 1:15 pm
Reputation: 0

Re: [Request] Stranded: Alien Dawn

Post by Phantom Flan Flinger »

If you press ' on the keyboard and search for place (survivor's name) it can bring up anyone I think. example: Place Annette G_SpawnCharacter
Thanks will give that a go :D

souldev7
What is cheating?
What is cheating?
Posts: 4
Joined: Wed Aug 11, 2021 12:46 am
Reputation: 1

Re: [Request] Stranded: Alien Dawn

Post by souldev7 »

pandalorian wrote:
Sun Oct 30, 2022 3:51 pm

First, big thanks for your post! It really helped me get the game to where it's actually enjoyable.

Regarding the survivor count, do you modify the existing GetMaxSurvivorsCount() in PreGameSetup.lua, or does preceeding it with the keyword "function" make enough of a difference (tbh, I'm more familiar with java than lua).
Certainly! I almost feel like this stuff is better suited in a different thread since it's more Modding than anything else.
I think an LuaState hook for 5.3 on this would be the best course of action, a remote console would suffice.
Haven't dabbled in that myself since warhammer online a decade ago. But I'm sure there's a dll out there somewhere and any injector would do.

But yep you have to modify that function in PreGameSetup, it uses a null coalesce so if you remove the "left hand side" of the return, it forces the value from the __const.lua global variable. Otherwise it pulls it from the Scene (which for current avail scene, is 4).


-----------------
Zellno wrote:
Sun Oct 30, 2022 6:44 am
I found out that the one with the lua file here doesn't work, but with the Data.hpk file it works very well, why one works and the other doesn't, I have no idea. :shock: :shock:
Definitely thinking it's corruption.
You can actually find the true error log here: C:\Users\<Username here>\AppData\Roaming\Stranded - Alien Dawn\logs
It'll tell you precisely which file and why.

It seemed that the unluac fails to properly decompile the bytecode for a few of the files, leaving strange unicode sequences on the ends of things.
There's a post from earlier , page 3/4 i think where someone mentioned using luadec and compiling it from sources to do so, specifically for 5.3 of lua.
That would likely fix the decompilation en-masse since it's properly targeting lua v5.3 (unless devs modded theirs ofc)

But for me the easier solution was to simply not bundle the full decompiled sources.
So i basically am doing a "switcheroo" approach. Whereby I extract the HPK's with hpk.exe, which leaves them in the byte-code state.
Then use the unpacker to get the sources for everything in a separate folder.
Then I overwrite the file that I want to target with the non-byte-code decompiled source code, and just give it a quick scroll to look for syntax errors.
And pack that. So it's 99% comprised of original bytecode lua files (via hpk.exe), and a handful of modded ones by me (via unluac, copy/pasted to overwrite original).

It's not pretty but for me takes significantly less time than getting luadec compiled properly from source on a windows machine.
So far none of the lua sources I've run into (the one's I've cared about) are broken. It truly could be that unluac only failed a couple files here and there.
When mine crashed, the logs indicated bits like this:

Code: Select all

...itAnimalCompositeDef/Scissorhands_Hatchling_Starving.lua:1: syntax error near '<\144>'
...UnitAnimalCompositeDef/Skarabei_Manhunting_Explosive.lua:1: syntax error near '<\172>'
Hope this helps! I may not respond further, I feel like I'm hijacking the thread away with this stuff.
But the game is in Lua... so, idunno lol. LuaState hook vs modding, meh! hard to say which is the right path.

If the game devs implement true modding support, or perhaps if someone can figure out why the metadata files aren't being processed like Surviving Mars, then we could wrap this up neatly into a little package for everyone.
But that'd be better suited for a nexus submission.
A new UI element on the root menu of the game would be awesome, with tweaks for all the various goodies.

Post Reply

Who is online

Users browsing this forum: 5545ggdgdf