Every time i edit my map, i have to rename my control.lua or it will screw up literally everything.
for me, this is not a too big deal - but if the end-user wants to change something, he/she won't be able to.
on the on_player_joined event and the on_player_created event, the player still has a character and is controller_type 1.
the editor's gui is not detectable either.
How to check if game is running in editor?
How to check if game is running in editor?
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: How to check if game is running in editor?
Just check if the player is using the editor controller in your events. Or use https://lua-api.factorio.com/latest/eve ... map_editor.
I'm curious though, how do things get screwed up?
I'm curious though, how do things get screwed up?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: How to check if game is running in editor?
cause the script is placing and replacing lots of stuff on init^^
i fixed it now by delaying the player controller check by 1 tick and only then triggering the init...
i fixed it now by delaying the player controller check by 1 tick and only then triggering the init...
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
Re: How to check if game is running in editor?
That's... not how you make mods in Factorio.ownlyme wrote: Mon Jun 03, 2019 3:26 pm cause the script is placing and replacing lots of stuff on init^^
i fixed it now by delaying the player controller check by 1 tick and only then triggering the init...
If your mod is written correctly it will never care about the map editor being a thing. You can also run the game tick forward while editing through the map editor so you didn't actually fix anything.
If you want to get ahold of me I'm almost always on Discord.
Re: How to check if game is running in editor?
huh?Rseding91 wrote: Thu Jun 06, 2019 9:00 pmThat's... not how you make mods in Factorio.ownlyme wrote: Mon Jun 03, 2019 3:26 pm cause the script is placing and replacing lots of stuff on init^^
i fixed it now by delaying the player controller check by 1 tick and only then triggering the init...
If your mod is written correctly it will never care about the map editor being a thing. You can also run the game tick forward while editing through the map editor so you didn't actually fix anything.
i created alternative versions of the trees afterwards, with a bigger collision box (cause the creep's pathfinding is still suboptimal)
also i was too lazy to place the base's walls in a perfect circle, so i did that with tiles^^
Guess thats still fixable but it also puts a gui into every player's face ... and i have so many global variables and i don't even know how much other stuff that checking for editor status was the simplest solution...
https://mods.factorio.com/mod/dota ^^
creator of 55 mods
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds
My api requests/suggestions: ui relative for overlay||Grenade arc||Player Modifiers||textbox::selection||Singleplayer RCON||disable car's ground sounds