Science packs for peace

This is the place to request new mods or give ideas about what could be done.
darkcry
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jun 17, 2023 9:54 am
Contact:

Science packs for peace

Post by darkcry »

Setup:
Server is running with auto_pause = off meaning the game is running even without a player connected.

Idea:
Having some sort of machinery that will disable enemy expansion and attacks (only when no players are connected) by consuming current unlocked science packs.


I like to play on a server that is always running. This requires well thought out planning as one bottleneck will cause a blackout in the factory if no one is around to fix it. Or even worse the defense breaks and the factory gets destroyed.
But there are times when i know in advance that i will not be able to play the next two or three days so it would be nice to have some sort of safe guard by disabling the attacks by providing the most valuable items the science packs.

For every science pack unlocked the machinery requires one of each to pause the attacks by 1 minute. (probably a mod setting to tweak)
1min * 24h = 1440 packs to pause for 1 day


I was thinking of different ways in how this can be implemented:
- Special infinite research and as long it is researching it will enable the "peace-mode"
- New Entity to unlock, then build it and feed resources
- Just a new technology to research and after that the labs switch automatically to the "peace-mode" whenever the last player disconnects


Any thoughts on this mod idea?
And could somebody hint me to the required script functionalities? (Disabling enemy behavior stuff)
Funtime60
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Apr 09, 2025 2:59 am
Contact:

Re: Science packs for peace

Post by Funtime60 »

Alternative suggestion, conditional pausing, either on damage, enemy range, or logistics/circuit conditions when no users are online.
darkcry
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jun 17, 2023 9:54 am
Contact:

Re: Science packs for peace

Post by darkcry »

I like the fact that players have to plan for this functionality and can't just rely on an automatic safety net.

I just made a first iteration of that mod https://mods.factorio.com/mod/ScienceForPeace

Players must provide a significant amount of production value in order to pause the attacks. I guess diplomacy is costly.
It takes 1 min and 60 science packs to craft this recipe. This equates to 1/s of military science for as long as they plan to be absent and have their factory protected.


I implemented an interval (1min or 3600ticks) that checks whether the new furnace has produced more products than in the previous interval. It compares the products_finished property, and if so, it sets peaceful_mode = true on the surface where the furnace is placed; otherwise, it sets it to false.
It's working, but it's certainly not properly implemented, because there will be an offset between the end of crafting and the interval triggering.
So, if anyone has a better way to implement it, I would be interested.
darkcry
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Jun 17, 2023 9:54 am
Contact:

Re: Science packs for peace

Post by darkcry »

Another thing i could not figure out was how to limit the allowed building count to 1 like the landing pad (only 1 per surface).
At the moment you can place as many new science furnances as you like but there is no benefit just resource waste.

If anyone knows the answer to that qustion please inform me.
Post Reply

Return to “Ideas and Requests For Mods”