[MOD 0.10.x] Time Display - v1.0.0
Re: [MOD 0.10.x] Time Display - v1.0.0
Here's my updated version for 11.x MP, note I haven't tested this in MP or with prior saves so... if something happens let me know (with the error message)
script commands updated to take the nickname (in "quotes") as the last parameter so that settings can be separate for each player.
note: double post is so that people subscribed to the topic will be notified of this post, editing my previous one wouldn't notify them.
script commands updated to take the nickname (in "quotes") as the last parameter so that settings can be separate for each player.
note: double post is so that people subscribed to the topic will be notified of this post, editing my previous one wouldn't notify them.
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [MOD 0.10.x] Time Display - v1.0.0
New error, both MP and SP maps.
Code: Select all
Error while running the event handler
__TimeDisplay__control.lua:159:attempt to index field '?' (a nil value)
Re: [MOD 0.10.x] Time Display - v1.0.0
Hm, I didn't encounter that myself... I added a couple checks for what I assume happened there (that ontick got called when there was a player without any TD settings, not much else could happen there but I wouldn't have expected that since default settings are applied to during player creation and for all players during onload) and a fix for an error I noticed when I loaded a save (that didn't have the mod). download (last download link would also work since I updated Dropbox)FishSandwich wrote:New error, both MP and SP maps.
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [MOD 0.10.x] Time Display - v1.0.0
Hmm, no error, no crash, but the clock doesn't show on MP saves. :/
Edit: Works on new games created in multiplayer.
Edit: Works on new games created in multiplayer.
Re: [MOD 0.10.x] Time Display - v1.0.0
Right... I thought about that as soon as I made made the post and tried to change it before anyone noticed just to make sure this is line 159 of the one I first didFishSandwich wrote:Hmm, no error, no crash, but the clock doesn't show on MP saves. :/
Edit: Works on new games created in multiplayer.
Code: Select all
if glob[player.name] and glob[player.name].minute_rounding and
(event.tick % (UPDATE_INTERVAL * glob[player.name].minute_rounding) == 0) then
Code: Select all
if not glob[player.name] then
set_defaults(playerindex)
init_gui(playerindex)
end
Code: Select all
/c remote.call("TimeDisplay", "SetSetting", "enabled", true, "nickname")
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [MOD 0.10.x] Time Display - v1.0.0
Okay so, it works fine when I use the remote.call, but after a few seconds the clock disappears again.
Re: [MOD 0.10.x] Time Display - v1.0.0
I was afraid that might happen, onsave it's setup to remove the gui (so that if the mod is removed it doesn't leave the gui behind with no way to remove it except manual game commands), if onload isn't working then it doesn't bring it back up properly.FishSandwich wrote:Okay so, it works fine when I use the remote.call, but after a few seconds the clock disappears again.
I made a further alteration in ontick to check for the gui actually being onscreen, if that for some reason isn't working for you then try removing the game.onsave code so that the gui isn't removed, if that doesn't work then I'm afraid I'll have to ask one of the other experts who can do proper testing to solve this. download, again
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [MOD 0.10.x] Time Display - v1.0.0
That worked. Thanks FreeER.FreeER wrote:try removing the game.onsave code so that the gui isn't removed
Re: [MOD 0.10.x] Time Display - v1.0.0
Glad I could help Sorry it took so longFishSandwich wrote:That worked. Thanks FreeER.FreeER wrote:try removing the game.onsave code so that the gui isn't removed
For everyone who comes across this here's the download link with all of the changes made (all the previous ones I posted should work too, but people tend to jump to the end so...) including commenting out game.onsave.
to manually remove the gui (in case you forgot to disable it before removing the mod and don't want to reinstall the mod just to disable it), note this is also listed in the control.lua file (just search for 'manually remove' or 'game.onsave' and you'll find it). Also, all script interface commands are correctly commented at the end of the file as they were originally (updated to show that the nickname is also needed)
removal code
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [MOD 0.10.x] Time Display - v1.0.0
Ack, my bad, premature celebrations here. ;_;
So, the clock still disappears with game.onsave commented out. I tried commenting out game.onload as well, and now it works as expected, but still need to use the remote.call
So, the clock still disappears with game.onsave commented out. I tried commenting out game.onload as well, and now it works as expected, but still need to use the remote.call
Re: [MOD 0.10.x] Time Display - v1.0.0
can i add your mod to a modpack?
Re: [MOD 0.10.x] Time Display - v1.0.0
I was managing this bug report https://forums.factorio.com/forum/vie ... =29&t=8806
You could take a look at it
Just a notice, I made it clear, that you should never do the stuff you are doing in the onsave method, it can break a lot of stuff, I even added warning in the wiki.
https://forums.factorio.com/wiki/inde ... ame.onsave
You could take a look at it
Just a notice, I made it clear, that you should never do the stuff you are doing in the onsave method, it can break a lot of stuff, I even added warning in the wiki.
https://forums.factorio.com/wiki/inde ... ame.onsave
- Mr. Thunder_Tw
- Long Handed Inserter
- Posts: 53
- Joined: Mon Sep 29, 2014 2:15 pm
- Contact:
Re: [MOD 0.10.x] Time Display - v1.0.0
from kovarex
In case of some mod-switching after saving, when a mod has gui open, and mod turned off, there's no way to remove it...
>> onSave-gui-removing hase this fixed (that's why i found it somewhat usefull during development testing and it works in sp, mp not tested)
I've also made a mod that does something similar though as an option that's off as default.Just a notice, I made it clear, that you should never do the stuff you are doing in the onsave method, it can break a lot of stuff, I even added warning in the wiki.
In case of some mod-switching after saving, when a mod has gui open, and mod turned off, there's no way to remove it...
>> onSave-gui-removing hase this fixed (that's why i found it somewhat usefull during development testing and it works in sp, mp not tested)
my Mod: ThunderGui
Re: [MOD 0.10.x] Time Display - v1.0.0
How can I disable this time 07:41:43
Did the commands entered into the console Can you post what i copy must
Did the commands entered into the console Can you post what i copy must
Re: [MOD 0.10.x] Time Display - v1.0.0
This mod doesn't work. When I try to start Factorio, with the .zip file in my Mods folder, I get an error box popup saying something about a case-sensitive problem. When I delete the .zip file, Factorio starts up fine.
-
- Manual Inserter
- Posts: 1
- Joined: Sat Jul 11, 2015 8:31 pm
- Contact:
Re: [MOD 0.10.x] Time Display - v1.0.0
The internal mod is expecting TimeDisplay_v1.0.0.zip as the file name. It currently downloads as TimeDisplay-v1.0.0.zip. If you change the dash to an underscore, the mod loads just fine.
-
- Smart Inserter
- Posts: 1847
- Joined: Sun Feb 23, 2014 3:37 pm
- Contact:
Re: [MOD 0.10.x] Time Display - v1.0.0
This version of the mod is the most up to date.Peter34 wrote:This mod doesn't work. When I try to start Factorio, with the .zip file in my Mods folder, I get an error box popup saying something about a case-sensitive problem. When I delete the .zip file, Factorio starts up fine.