Ludeon Forums

RimWorld => Mods => Help => Topic started by: Elfblood on March 02, 2015, 04:11:27 AM

Title: Unforbid every Item at Mapstart
Post by: Elfblood on March 02, 2015, 04:11:27 AM
Hi Guys.
Every new Colony I start, I have to scroll aroudn the Map. (usual playing the biggest size) and unforbid every item. I like to start with one hauler to get all the stuff together. It takes lots of time to find everything. Now I want a little mod that does this for me ^^

I would write it myself, but have no clue how to get all items on a map, and execute it once a new map is generated.

Any advice from the modders out there ?
Title: Re: Unforbid every Item at Mapstart
Post by: Gaesatae on March 02, 2015, 06:33:10 AM
1) Create a MapComponent and make a condition to only run the code at game start. https://ludeon.com/forums/index.php?topic=11069.msg110117#msg110117
2) Get all haulable items from ListerHaulables.Haulables()
3) Filter out the stone and metal chunks.
4) Use GenForbid.SetForbidden on the remaining items.

It should be easy to do.