Need lua to refresh oil resource

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
MaZy
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sat Jun 21, 2014 2:10 pm
Contact:

Need lua to refresh oil resource

Post by MaZy »

Hello.

I am right now playing the scenario "freeplay". There is no option about difficulty which is good for me but only one thing is annoying me there. I have sooooooo less oil. And all of my pumpstations have now 0.1/s. It is too less. I so I want to ask for little lua code for the console to refresh these resources. That would be great and big help. I know how lua is working but I didn't found or more even do not get how to find the resource (when mouse is over).

Thank you :)

Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

Re: Need lua to refresh oil resource

Post by Rahjital »

Try typing this in the console:

Code: Select all

game.regenerateentity("crude-oil")
Not sure if it will work, it is typically used when a map is lacking the resource entirely, not when it is depleted. Even if it works, you should make sure to save under a different filename just in case something gets broken by it.

MaZy
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sat Jun 21, 2014 2:10 pm
Contact:

Re: Need lua to refresh oil resource

Post by MaZy »

Hey thank you for your help but that freezed my game for few seconds and after that the pump still shows 0.1/s.

But I see now that made few new oil places near the pumps

User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: Need lua to refresh oil resource

Post by FreeER »

regenerateentity to my understanding simply redoes the process of generating that entity (so you got new ones).

It's intended that you find new oil deposits, not to survive off of a few (which is why they drop to a mere .1/s), but if you wanted to actually 'refill' the oil deposits you can use the command 'game.player.selected.amount=7500' (assuming that your cursor is over an oil deposit, and by that I mean the deposit itself, not the pumpjack). 7500 is "normal" amount (meaning 100%) if you use a larger number you'll get more than 100% (and less will be less than 100% of course)...

MaZy
Burner Inserter
Burner Inserter
Posts: 13
Joined: Sat Jun 21, 2014 2:10 pm
Contact:

Re: Need lua to refresh oil resource

Post by MaZy »

Oh thanks that helped. I tried it before but on pumpjack. Didn't think about it to remove first.
It's intended that you find new oil deposits, not to survive off of a few
Yea I know. Unfortunally I tried to make huge system were I forget to focus the protection. I already making huge area of aliens aggressive. They are also next to me. So I have the choice. Restart and new map or do it with a small "trick" to get the current place with new oil :)

But anyway. Thank you for the help

Post Reply

Return to “Gameplay Help”