Type: Mod
Name: Train knockback
Description: Knocks player back instead of killing him if hit by a train. In MP player is stunned for 10s.
License: MIT
Version: 0.1.0
Release: 2016-04-17
Tested-With-Factorio-Version: 0.12.29
This is an initially simple mod which overrides deaths caused by a train by positioning player to the right of a tracks in front of the locomotive (angle and distance configurable). Train deaths are really annoying and without solution like bridges, crossings or even horns they don't add much to gameplay.
I decided to override player death, which causes some issues. In SP your middle click hotbar setup isn't preserved, while in multiplayer you have normal respawn timer and after it you are moved to new position with restored inventory. Also you may respawn this way if you are killed by other means right next to locomotive. I thought about two other solutions: removing collision box from the train (rail crossing mod already does it) or checking every tick if player is near locomotive (possible performance problems, however if I were to do it again I'd do it this way).
I don't know what will happen if a player dc during respawn timer, probably inventory will be missing and there will be a dummy indestructible player left. However script will crash if it were the case so it matters only when autosave happens .
[MOD 0.12.x] Train knockback 0.1.0
[MOD 0.12.x] Train knockback 0.1.0
- Attachments
-
- train-knockback_0.1.0.zip
- (2.83 KiB) Downloaded 97 times