Page 1 of 1

Need lua to refresh oil resource

Posted: Sat Jun 21, 2014 2:17 pm
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 :)

Re: Need lua to refresh oil resource

Posted: Sat Jun 21, 2014 2:57 pm
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.

Re: Need lua to refresh oil resource

Posted: Sat Jun 21, 2014 3:07 pm
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

Re: Need lua to refresh oil resource

Posted: Sat Jun 21, 2014 3:19 pm
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)...

Re: Need lua to refresh oil resource

Posted: Sat Jun 21, 2014 4:00 pm
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