Search found 69 matches

by mk-fg
Sun Aug 04, 2019 12:24 pm
Forum: Mods
Topic: [MOD 1.1] Will-o'-the-Wisps updated
Replies: 56
Views: 16060

Re: [MOD 0.17.x] Will-o'-the-Wisps updated

If anything, I have been looking to get more into programming with my friends and we've talked about making mods for a couple games, Factorio being one. I still have to learn Lua, but am willing to take on owning this mod if you are desiring such a wish. You and I have discussed ideas about a year ...
by mk-fg
Sun Aug 04, 2019 7:39 am
Forum: Mods
Topic: [MOD 1.1] Will-o'-the-Wisps updated
Replies: 56
Views: 16060

Re: [MOD 0.17.x] Will-o'-the-Wisps updated

Thanks for a good mod! Just glad I caught this rarity! :D Maybe it should get a new dev though, as I didn't really do anything with it since 0.16.x days, just updated for compatibility. And there are many interesting things that can be done, with at least visuals and more complex behaviors being no...
by mk-fg
Sat Aug 03, 2019 12:38 pm
Forum: Mods
Topic: [MOD 1.1] Will-o'-the-Wisps updated
Replies: 56
Views: 16060

Re: [MOD 0.17.x] Will-o'-the-Wisps updated

Though maybe if something in lua glitched and spawned a ton of purples at exactly same place... maybe in some kind of fast singularity-like event involving red wisp getting damaged very fast, splitting many times immediately, then all of them getting killed, producing all purple residue there. Weird...
by mk-fg
Sat Aug 03, 2019 12:33 pm
Forum: Mods
Topic: [MOD 1.1] Will-o'-the-Wisps updated
Replies: 56
Views: 16060

Re: [MOD 0.17.x] Will-o'-the-Wisps updated

What is this?!?! A second coming of Our Lord? :) If it's unselectable, so is actually a toxic-cloud-type purple wisp, maybe some other mod that automatically enhances enemies scaled it up somehow? Though it gotta be complicated to scale stuff, and why'd other mods scale clouds... so I'd think it's ...
by mk-fg
Sat May 18, 2019 5:37 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

If a mod is added to an existing save file, both on_init and on_configuration_changed run for this mod. Already present mods don't run on_init, but only on_configuration_changed. on_configuration_changed is only omitted when creating a new game, because there is no pre-existing configuration that c...
by mk-fg
Sat May 18, 2019 5:21 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

... If all relevant mods are already present when creating a new game (i.e. no on_configuration_changed), there was no way to deal with this issues. That last part was my point. And it is exactly the case Rseding fixed by raising events during the initial on_init. You still have to deal with mods a...
by mk-fg
Sat May 18, 2019 12:26 am
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

Is it not possible to put all events generated by all on_init in all mods into some list and then once all mods are initialized and loaded, call all handlers for each of them? From the standpoint of any individual mod, I'd think such delay will make no difference, as none of its other code can run d...
by mk-fg
Fri May 17, 2019 11:38 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

on_configuration_changed is not triggered when you start a new game, only when you load an existing save and something changed. I don't see a good way to deal with this situation in a new game :? Thats why I ended up doing full set of checks in both on_init and on_configuration_changed. This seems ...
by mk-fg
Fri May 17, 2019 7:37 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

I think it's just a documentation bug though, as 0.16.21 changelog ( https://forums.factorio.com/viewtopic.php?f=3&t=57372 ) says this in no uncertain terms: "Changed events so they won't fire until every mod has had on_init ran." So expectation that *any* event handlers will run durin...
by mk-fg
Fri May 17, 2019 7:27 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

Just to anticipate further line of thinking, as it was mentioned in https://forums.factorio.com/viewtopic.php?f=25&t=70952#p430659 : If you put print() in: - first_mod and second_mod's on_init functions. - right before game.create_force() in first_mod (only first_mod does that). - into second_mo...
by mk-fg
Fri May 17, 2019 7:21 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

You say first_mod creates force_x in on_init. Note that "first_mod" does not imply any kind of on_init run ordering here, and as you also pointed out, it's not a good idea to rely on any kind of ordering there when mods can be added/removed at random times. I only meant "first" ...
by mk-fg
Fri May 17, 2019 6:34 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

Now to modding. Something that strikes me as weird is that you rely on the force created being called for every force in your second_mod. It is well known that mods can be added in the middle of the game, so you must loop through all forces, regardless of whether events are received before on_init ...
by mk-fg
Fri May 17, 2019 5:57 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

Ah, right, think I've seen this "done wrong" case happening in my mods indeed. But guess there's no other way to co-operate with mods that use only on_init + on_force_created events (not the author/maintainer of other mod and potentially many others), and forces created on some arbitrary n...
by mk-fg
Fri May 17, 2019 5:42 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

Yes, guess I'll need to move init for these forces into first on_nth_tick event. Happy desyncing. Wait, do creating forces outside of on_init causes multiplayer desync? (which is really weird, as then why there're even events for force-created/merged, if this should never be done in practice) Never...
by mk-fg
Fri May 17, 2019 5:35 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

If event raising is completely suspended during on_init that would mean no mod would ever recieve events caused by on_init. And mean that mods would need to re-scanning on on_config_changed too, which would be a major PITA. Yes, guess I'll need to move init for these forces into first on_nth_tick e...
by mk-fg
Fri May 17, 2019 5:29 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

You think i'm wrong, but you observe i'm right? Added the relevant changelog in above posts Edit2. Well, if documentation says "sky is red", you observe that it's actually blue, it doesn't change the fact that documentation says that it's red. Which is all that I meant, not that you're wr...
by mk-fg
Fri May 17, 2019 5:27 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

In the opening post you describe that the first_loaded_mod creates a force in its on_init, which would then naturally *not* be recieved by the second_loaded_mod (as described above). Now you say the force creation happens in the second_loaded_mod? I didn't mean to imply any kind of "mod load o...
by mk-fg
Fri May 17, 2019 5:23 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

I do not follow that logic. The rules stated above *do* apply for different mods. While indeed it seem to be the case in practice, it's very unobvious from the text you quoted to me: Note: until on_init has finished executing for a given mod (scenario scripts are also counted as a mod) the game wil...
by mk-fg
Fri May 17, 2019 5:03 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

4. control.lua init [...] Note: until on_init has finished executing for a given mod (scenario scripts are also counted as a mod) the game will not raise any game events for that mod . Also, to be clear on this - I'm talking about on_force_created events not being raised in mod-B from on_init of mo...
by mk-fg
Fri May 17, 2019 5:00 pm
Forum: Modding help
Topic: [0.17.41] lua on_force_created event handler is not called on game.create_force()
Replies: 36
Views: 7234

Re: [0.17.41] lua on_force_created event handler is not called on game.create_force()

Replying to updated message above: A mod can not recieve events before it's own on_init has finished. You need to for pairs() through all existing forces in the on_init of the second mod, and call your own handler internally. Otherwise you'd also miss any events that happend before the mod was even ...

Go to advanced search