Page 2 of 2

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sun Feb 01, 2015 8:38 am
by FreeER
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.

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sun Feb 01, 2015 1:08 pm
by FishSandwich
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

Posted: Sun Feb 01, 2015 3:34 pm
by FreeER
FishSandwich wrote:New error, both MP and SP maps. :(
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)

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sun Feb 01, 2015 4:08 pm
by FishSandwich
Hmm, no error, no crash, but the clock doesn't show on MP saves. :/

Edit: Works on new games created in multiplayer.

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sun Feb 01, 2015 4:20 pm
by FreeER
FishSandwich wrote:Hmm, no error, no crash, but the clock doesn't show on MP saves. :/
Edit: Works on new games created in multiplayer.
Right... I thought about that as soon as I made made the post and tried to change it before anyone noticed :lol: just to make sure this is line 159 of the one I first did

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 
then I updated dropbox to use this instead

Code: Select all

    if not glob[player.name] then
      set_defaults(playerindex)
      init_gui(playerindex)
    end
If you have the first then redownload (or do so anyways if you want) and try again, IF the 'updated' one still doesn't work then try enabling it via script the interface and let me know if that works.

Code: Select all

/c remote.call("TimeDisplay", "SetSetting", "enabled", true, "nickname")
edit: it seems like onload isn't working as desired for mp saves (ie, that the game.players list is empty during the event so the gui and settings aren't set properly)

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sun Feb 01, 2015 4:36 pm
by FishSandwich
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

Posted: Sun Feb 01, 2015 5:06 pm
by FreeER
FishSandwich wrote:Okay so, it works fine when I use the remote.call, but after a few seconds the clock disappears again.
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.
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 :(

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sun Feb 01, 2015 9:03 pm
by FishSandwich
FreeER wrote:try removing the game.onsave code so that the gui isn't removed
That worked. Thanks FreeER. :D

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sun Feb 01, 2015 9:18 pm
by FreeER
FishSandwich wrote:
FreeER wrote:try removing the game.onsave code so that the gui isn't removed
That worked. Thanks FreeER. :D
Glad I could help :P Sorry it took so long :lol:

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

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sun Feb 01, 2015 9:54 pm
by FishSandwich
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

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Fri Feb 13, 2015 11:04 am
by delfiler
can i add your mod to a modpack?

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Tue Mar 03, 2015 11:11 am
by kovarex
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

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Tue Mar 03, 2015 4:35 pm
by Mr. Thunder_Tw
from kovarex
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.
I've also made a mod that does something similar though as an option that's off as default.
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)

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Tue Apr 07, 2015 1:39 am
by dragon011
How can I disable this time 07:41:43

Did the commands entered into the console Can you post what i copy must

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Tue Jun 30, 2015 8:22 am
by Peter34
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.

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sat Jul 11, 2015 8:52 pm
by PurpleFrog
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.

Re: [MOD 0.10.x] Time Display - v1.0.0

Posted: Sat Jul 11, 2015 10:35 pm
by FishSandwich
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.
This version of the mod is the most up to date.