How can I increase construction times for all buildings?

Place to get help with not working mods / modding interface.
Post Reply
MrFactorio
Inserter
Inserter
Posts: 30
Joined: Tue Nov 13, 2018 4:50 pm
Contact:

How can I increase construction times for all buildings?

Post by MrFactorio »

Hi,

I would like to give buildings a specific construction time. With construction time I mean the time, a building needs to be placed on the ground (manually or with construction drones).
In multiplayer it shouldnt be possible to run around with dozens of towers in your backpack and instantly place them near the enemy base. This should take some time.

Is it possible? Is there a mod already?
How can I do this myself?


Thank you very much!

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: How can I increase construction times for all buildings?

Post by DaveMcW »

1. Create a global.final_tick table.
2. In on_built(), calculate the tick that construction will complete. Add the entity to the global.final_tick table at the tick index when it should finish.
3. In on_tick(), check global.final_tick for any entities to be finished this tick. Replace the constructing entity with the finished entity. Remember to set global.final_tick[event.tick] to nil at the end (garbage collection).

MrFactorio
Inserter
Inserter
Posts: 30
Joined: Tue Nov 13, 2018 4:50 pm
Contact:

Re: How can I increase construction times for all buildings?

Post by MrFactorio »

:( I am noob at lua programming. Can you give me some more hints? Maybe with an example? That would be very much appreciated :)

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How can I increase construction times for all buildings?

Post by darkfrei »

I've made a mod where you need to repair buildings before they can work:
https://mods.factorio.com/mod/RepairToStart

The repairing needs some time, so you cannot just spam with turrets.

MrFactorio
Inserter
Inserter
Posts: 30
Joined: Tue Nov 13, 2018 4:50 pm
Contact:

Re: How can I increase construction times for all buildings?

Post by MrFactorio »

darkfrei wrote:
Sat Aug 17, 2019 8:00 pm
I've made a mod where you need to repair buildings before they can work:
https://mods.factorio.com/mod/RepairToStart

The repairing needs some time, so you cannot just spam with turrets.
That is great! I just tried it out and it would work perfectly. But the start until you have drones is very tough... any tips how I can make the start a bit easier? Especially repairing each belt manually would be a game breaker :(.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2904
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: How can I increase construction times for all buildings?

Post by darkfrei »

MrFactorio wrote:
Sat Aug 17, 2019 8:34 pm
That is great! I just tried it out and it would work perfectly. But the start until you have drones is very tough... any tips how I can make the start a bit easier? Especially repairing each belt manually would be a game breaker :(.
After belts optimization in versions 0.16-0.17 all belts cannot be disabled anymore, they must be excepted from the disabling. But only 1 hp is nice to have for all types of entities.

Also https://mods.factorio.com/mod/ConstructionCar - the car has drones and you can repair all stuff near of it.

MrFactorio
Inserter
Inserter
Posts: 30
Joined: Tue Nov 13, 2018 4:50 pm
Contact:

Re: How can I increase construction times for all buildings?

Post by MrFactorio »

Thank you. I didnt knew that the belts still work with 1 hp. I also found out, that you can give some starting items which you can chose in PvP mode. So I can give each one a roboport at start :).

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: How can I increase construction times for all buildings?

Post by Impatient »

MrFactorio wrote:
Sat Aug 17, 2019 8:34 pm
... any tips how I can make the start a bit easier? ...
Sure. Spawn yourself some gear.

Easy Start Equipment

User avatar
mat1k
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat Dec 22, 2018 8:48 am
Contact:

Re: How can I increase construction times for all buildings?

Post by mat1k »

This one gives a good starting supply and helps with the repair issue.

Starter Bots

Post Reply

Return to “Modding help”