No Respawn Gun deprecated

by ouk_ouk

After death, player respawns without any inventory. (Possible to configure to remove only weapons.) DEPRECATED: The mod "Hardcore Start" took over the features of this mod.

Tweaks
3 years ago
0.16 - 1.0
21

i Freeplay Remote Calls

5 years ago

Rather than clearing the player's inventory on respawn (detecting the event yourself), you could make use of the free play scenario's remote call system and change the respawn_items to be nothing.

5 years ago

I can see how this would help with compatibility.
However, I'm not an expert Factorio API and I have no idea how to get to the freeplay scenario data. Google isn't particularly helpful. I'm gonna try some more but I cannot promise anything.

5 years ago

https://lua-api.factorio.com/latest/LuaRemote.html

remote.call("freeplay", "set_respawn_items", respawn_items_here)

You can see the definition of the default respawn items in Factorio\data\base\scenarios\freeplay\control.lua

5 years ago
(updated 5 years ago)

Arguably your current method is "more" compatible with other scenarios as it forces respawning with nothing regardless of scenario, but if other mods do similar things, it would be cleaner in freeplay to use get_respawn_items, remove the gun/ammo, and then set_respawn_items with the result (which would default to empty).

5 years ago

OK, I've tried that but there is a problem. Inventory set by "remote.call("freeplay", "set_respawn_items", respawn_items_here)" is stored in the save file. It means that even after disabling my mod there still is no respawn inventory. This is not really what I'm going for.

3 years ago

In the end, after rewriting the code and merging this mod with "Hardcore Start", I've ended using this method. Still not perfect, turning the mod off is a while procedure.

New response