[0.14]David WM's Timelapse crudely updated by script kiddie

Topics and discussion about specific mods
Post Reply
User avatar
featherwinglove
Filter Inserter
Filter Inserter
Posts: 579
Joined: Sat Jun 25, 2016 6:14 am
Contact:

[0.14]David WM's Timelapse crudely updated by script kiddie

Post by featherwinglove »

I decided to post this crude hack of the Timelapse mod here because it was a pain to get working in 0.14 (so if you're really desperate to get it working and are even less adept at getting broken 0.12 mod code working in newer versions than I am ...which is probably unlikely if you're here to read this :lol: go ahead and grab it.) The code hack is really pretty dumb and crufty, which is why I'm not posting a pull request or attempting to upload it to the portal.

Changes:
1. The "seed" and "ticks" parts of the screenshot filename have been replaced with "MuddyAt" because the line accessing was causing a crash and was commented out, and because the modpack is called "Muddy Mountains". This will have the side effect of causing screenshots to get overwritten if you play an older game with screenshots enabled and then play a newer game with screenshots enabled in the same Factorio installation (I had this problem in the Badlands back in 0.12 because I tended to play with the same seed anyway.)

2. The mod does not print a console message for each screenshot. I have no idea why, but game.player.print(string) causes 0.14 to crash (player is nil) when it is happening within script.on_event(defines.on_tick). All of the other console print commands (which are responses to timelapse console commands such as /c remote.call("timelapse", "active")) work fine.
Attachments
timelapse_0.1.3.zip
In order, but unofficial, version number.
(5.59 KiB) Downloaded 97 times

Jeroen D Stout
Inserter
Inserter
Posts: 33
Joined: Fri May 05, 2017 2:09 pm
Contact:

Re: [0.14]David WM's Timelapse crudely updated by script kiddie

Post by Jeroen D Stout »

I believe you need to use

Code: Select all

game.players[1].print(string)
Nice to see this, all the same :)

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.14]David WM's Timelapse crudely updated by script kiddie

Post by Choumiko »

game.player is only available inside a command run from the consol. In events you can use game.print() to print to all players. I think there's also a print for LuaSurface, LuaForce

User avatar
featherwinglove
Filter Inserter
Filter Inserter
Posts: 579
Joined: Sat Jun 25, 2016 6:14 am
Contact:

Re: [0.14]David WM's Timelapse crudely updated by script kiddie

Post by featherwinglove »

That explains why Pollution Damage has no problems. When going from 0.12 to 0.14, I switched from looping players array in ipairs to the connected players array in ipairs. I did this after realizing it has no need to bother logged out players (although logging into a game equipped with Pollution Damage could plausibly become impossible. I don't know if spawn can be moved, but if not, care would need to be taken to keep the origin clean. It isn't too hard to wind up with chunks that can kill an unarmored player in one second with Pollution Damage, since armor does a lot to reduce the damage if you don't mind the console spam, and once an area is automated and sorted out, it isn't hard to avoid ever visiting it again.) I don't loop just for printing, as the mod needs to figure out how much damage each player is taking.

The message problem isn't the only problem that needs to be fixed. For the map seed file name, the best thing to do is probably put it into a global that gets filled with the activate command and reused for each screenshot. Any thoughts?


Post Reply

Return to “Mods”