I hacked this in to regenerate mine after my modules got eaten by the mk1 upgrade.
This was my solution by modifying the mod's control.lua to insert a new regenerate command
1. unzip the mod in AppData/Roaming/Factorio/mods
2. modify control.lua
3. re-zip folder and delete the unzipped folder
4. Relaunch game and load save.
5. In game run /tinystart-regen
I hope this helps someone.
Add this to control.lua:
commands.add_command(
"tinystart-regen",
"Gives/equips TinyStart armor and regenerates its equipment (safe, no duplication).",
function(cmd)
local player = game.get_player(cmd.player_index)
if not player then return end
local chara = player.character or player.cutscene_character
if not chara then
player.print("[TinyStart] No character available (sandbox/cutscene).")
return
end
local armor_inv = player.get_inventory(defines.inventory.character_armor)
if not armor_inv then
player.print("[TinyStart] No armor inventory available.")
return
end
-- Get currently equipped armor (if any)
local armor = armor_inv[1]
local wearing_tiny = armor.valid_for_read and armor.name == "tiny-armor-mk0"
-- If not wearing Tiny armor, create/equip it
if not wearing_tiny then
-- If another armor is equipped, move it to main inventory (or drop if full)
if armor.valid_for_read then
local main = player.get_main_inventory()
local inserted = main and main.insert(armor)
if not inserted or inserted == 0 then
player.surface.spill_item_stack(player.position, armor, true, player.force, false)
end
armor.clear()
end
armor_inv.insert({ name = "tiny-armor-mk0", count = 1 })
armor = armor_inv[1]
player.print("[TinyStart] Equipped tiny-armor-mk0.")
end
if not armor.valid_for_read then
player.print("[TinyStart] Failed to equip TinyStart armor.")
return
end
-- Prevent duplication
if armor.grid.count() > 0 then
player.print("[TinyStart] Armor already has equipment; not regenerating.")
return
end
genarmor(player, chara)
player.print("[TinyStart] TinyStart equipment regenerated.")
end
)