Page 1 of 1

RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 9:59 am
by Demosthenex
I found settings.global["rso-biter-generation"] in the source which controls whether biters are created. Can I disable this mid-game using the lua console, like changing ore settings?

Re: RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 2:33 pm
by steinio
Demosthenex wrote:I found settings.global["rso-biter-generation"] in the source which controls whether biters are created. Can I disable this mid-game using the lua console, like changing ore settings?
There is a setting in Settings -> Mods -> Map

Re: RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 2:45 pm
by Demosthenex
steinio wrote:
Demosthenex wrote:I found settings.global["rso-biter-generation"] in the source which controls whether biters are created. Can I disable this mid-game using the lua console, like changing ore settings?
There is a setting in Settings -> Mods -> Map
While I appreciate that, I'm asking about in Lua. I'm working on a mod which disabled biters in the late game. It works in vanilla by changing the surface mapgen settings. RSO does it separately elsewhere.

My only other workaround would be to add a hook to chunk creation which clears the bugs, but I'd rather tell RSO to stop.

Thanks.

Re: RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 4:00 pm
by steinio
Demosthenex wrote:
steinio wrote:
Demosthenex wrote:I found settings.global["rso-biter-generation"] in the source which controls whether biters are created. Can I disable this mid-game using the lua console, like changing ore settings?
There is a setting in Settings -> Mods -> Map
While I appreciate that, I'm asking about in Lua. I'm working on a mod which disabled biters in the late game. It works in vanilla by changing the surface mapgen settings. RSO does it separately elsewhere.

My only other workaround would be to add a hook to chunk creation which clears the bugs, but I'd rather tell RSO to stop.

Thanks.
Sorry my fault.
What happen if you use

Code: Select all

settings.global["rso-biter-generation"] = false

Re: RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 4:33 pm
by Demosthenex
steinio wrote:

Code: Select all

settings.global["rso-biter-generation"] = false
I believe I tried that on the console and it had no effect. I think that may be read only. I can check my scrollback logs later on my test box.

Re: RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 5:35 pm
by orzelek
Demosthenex wrote:
steinio wrote:

Code: Select all

settings.global["rso-biter-generation"] = false
I believe I tried that on the console and it had no effect. I think that may be read only. I can check my scrollback logs later on my test box.
AFAIK settings are global and any mod can edit any other setting. It is possible that console might not have the same access as a mod.
Another thing is that you might need to look far to check if it worked since game seems to generate chunks in the dark areas - with a lot of pollution it can go pretty far.

Also your code has one small issue. It should be:

Code: Select all

settings.global["rso-biter-generation"].value = false
(And yes I made this mistake to many times when adding settings to RSO ;) )

Re: RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 8:17 pm
by Demosthenex
orzelek wrote:

Code: Select all

settings.global["rso-biter-generation"].value = false
So I tried that, both in my mod and on the console. Then I revealed the map around my char in a new game out to 1km. They kept spawning. I'm on RSO 3.5.14.

Any other suggestions?

I know the Biter's Begone mod compensates for this by having an on_chunk_created event hook that kills all the enemies in a new chunk when it is created. I can revert to that if RSO can't be changed dynamically mid-game.

Re: RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 8:35 pm
by Demosthenex
To reply to myself, settings says in the API documentation that it is read only.

http://lua-api.factorio.com/latest/LuaSettings.html

Any other ideas? I think I'll have to do a hook on chunk creation.

Re: RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 10:40 pm
by orzelek
Only other way I see is to add remote interface to RSO to allow enemy spawning override separately.

Using chunk generation event will not give you the full effect. RSO can spawn entities outside of currently generated chunk.

Re: RSO and disable biter generation mid-game

Posted: Tue May 08, 2018 10:47 pm
by Demosthenex
orzelek wrote:Only other way I see is to add remote interface to RSO to allow enemy spawning override separately.

Using chunk generation event will not give you the full effect. RSO can spawn entities outside of currently generated chunk.
So I've set it up at the moment to purge all active enemies, set the vanilla mapgen to disable spawning, and then have an on generation hook where I clear the new chunk and adjacent chunks. Seems to work fine.

Re: RSO and disable biter generation mid-game

Posted: Wed May 09, 2018 6:17 am
by orzelek
Demosthenex wrote:
orzelek wrote:Only other way I see is to add remote interface to RSO to allow enemy spawning override separately.

Using chunk generation event will not give you the full effect. RSO can spawn entities outside of currently generated chunk.
So I've set it up at the moment to purge all active enemies, set the vanilla mapgen to disable spawning, and then have an on generation hook where I clear the new chunk and adjacent chunks. Seems to work fine.
Actually if you enable option for RSO to use vanilla generation and then disable that generation it should work without chunk clearing.
Enablind vanilla generation will disable the one built into RSO. Thats something user would need to do since you can't edit the settings.

Re: RSO and disable biter generation mid-game

Posted: Wed May 09, 2018 11:11 am
by Demosthenex
orzelek wrote:
Demosthenex wrote: Actually if you enable option for RSO to use vanilla generation and then disable that generation it should work without chunk clearing.
Enablind vanilla generation will disable the one built into RSO. Thats something user would need to do since you can't edit the settings.
I did see that. Unfortunately that won't work. The point of this mod is to research a way to kill bugs in the late game. I don't want to use user input.