Stranded: Alien Dawn

Stranded: Alien Dawn

Stranded: Alien Dawn Workshop
Explore other users workshop creations, upload, download and subscribe to new content
0utlaw 29 Nov, 2023 @ 11:58pm
Change Property Modifier
Can you add two modifiers to a single change property use/call on a preset? For example I want to change the HitNegation and Modify the temperature low/high to a single piece of armor, but when I use Change property I seem to only be given the option of changing one value per use, I cannot seem to find a way to add an additional change without adding a second change property usage.
Last edited by 0utlaw; 29 Nov, 2023 @ 11:59pm
< >
Showing 1-8 of 8 comments
Mnementh 21 1 Dec, 2023 @ 1:04am 
Hi, Outlaw!

The "Change Property" element is designed to modify a single property.
0utlaw 1 Dec, 2023 @ 7:13am 
Thanks for the follow up! Is there anyway to make a batch change? or like a flat file we can open and do a find/replace in like Notepad ++ or something?
Mnementh 21 2 Dec, 2023 @ 10:15am 
If you'd rather avoid having many Change Property elements in your mod, you can directly edit the Resources table that stores all the game's resource presets.

An example of that would be the following code:
Resources["Armor_Hat_Carbon"].HitNegation = { PlaceObj('EquipResourceHitNegation', { 'DamageType', "blunt", 'NegationChance', 10, }), PlaceObj('EquipResourceHitNegation', { 'DamageType', "piercing", 'NegationChance', 10, }), } Resources["Armor_Hat_Carbon"].Modifiers = { PlaceObj('ModifyHuman', { add = 10000, prop = "TemperatureHigh", }), PlaceObj('ModifyHuman', { add = -10000, prop = "TemperatureLow", }), }
Last edited by Mnementh; 2 Dec, 2023 @ 11:04am
0utlaw 2 Dec, 2023 @ 11:32am 
Very cool, thank you!
Olleus 1 4 Dec, 2023 @ 3:45pm 
Is there a way to do that via a loop? For example, if I wanted to double the height of all humans, could I do that without having to manually address each individual one by one?
Mnementh 21 4 Dec, 2023 @ 7:03pm 
Hi Olleus,

The most common approach to doing this would be:
for _, def in ipairs(CharacterDefs) do -- do something end

CharacterDefs is the global table that contains all character definitions in the game. If you want to modify all spawned characters on the map, replace it with UIPlayer.labels.Survivors. The labels are auto-updating tables that hold references to specific objects present on the map.
Olleus 1 5 Dec, 2023 @ 3:03am 
Thanks for all your help Mnementh, but I can't get the iteration to work. Even a simple test like
for i, char in ipairs(CharacterDefs) do print(char.id) end
prints out nothing on the console, while
print(CharacterDefs.Jack.id)
works as intended. It's not special to CharacterDefs either, I have the same issue, eg, with Plants.

EDIT: As always, it's asking a question that solved it. Replace 'ipairs' with 'pairs' works fine. There's clearly something about Lua data structures that I'm not getting yet...
Last edited by Olleus; 5 Dec, 2023 @ 3:09am
Mnementh 21 7 Dec, 2023 @ 12:12am 
Originally posted by Olleus:
EDIT: As always, it's asking a question that solved it. Replace 'ipairs' with 'pairs' works fine. There's clearly something about Lua data structures that I'm not getting yet...
I probably used the wrong pairing function for the example. Typically, one will work while the other won't. It depends on the structure of the table.
< >
Showing 1-8 of 8 comments
Per page: 1530 50