Combat autosave

by kid2407

This mod will save the game automatically when you have left combat for a number of seconds you can specify in the options

Utilities
4 years ago
0.17 - 0.18
6

b (0.18) v1.2.0, multiplayer, headless server

4 years ago
(updated 4 years ago)

combat_autosave/control.lua:9: attempt to index global 'player' (a nil value)

https://github.com/kid2407/CombatAutosave/issues/1
Probably, the problem related to headless servers

4 years ago

Thanks for reporting this error, I think I know why it happens, maybe should check if there are any players at all, since on the server there are none when it just started ^^

4 years ago

Ummm, and your variables are not in the global variable, btw. It means no sync between a server and clients.

4 years ago
(updated 4 years ago)

And also
1. You didn't make local variables. For instance, control.lua:9: player = ... -> local player = ...
2. Put firstRun, saved, current_time_without_combat in global through on_init and on_configuration_changed
3. It'll be like: global.firstRun = global.firstRun or true

4 years ago

Valid points, guess I have some work to do ^^
For some of the stuff like global I didn't knew about when making this, but you always learn more and better ways to do stuff :)

4 years ago

Say me, which IDE do you using?

4 years ago

VSCode, why do you ask?

4 years ago

Just out of curiosity.

New response