Deep drilling

Started by michal3588, September 25, 2016, 06:20:13 AM

Previous topic - Next topic

michal3588

How do I change range of deep drill? All I could find is "specialDisplayRadius" but if I am correct it will only change its display and not actual range of mining?

Kilroy232

I assume by range you mean the radius by which the drill looks for resources. If that is the case those values are contained in the C# of the DeepDrillComp unfortunately.

This bit of code tells the game to search 9 cells around the building in a radial pattern


public bool TryGetNextResource(out ThingDef resDef, out int countPresent, out IntVec3 cell)
{
for (int i = 0; i < 9; i++)
{
IntVec3 intVec = this.parent.Position + GenRadial.RadialPattern[i];
if (intVec.InBounds())
{
ThingDef thingDef = Find.DeepResourceGrid.ThingDefAt(intVec);
if (thingDef != null)
{
resDef = thingDef;
countPresent = Find.DeepResourceGrid.CountAt(intVec);
cell = intVec;
return true;
}
}
}
resDef = null;
countPresent = 0;
cell = IntVec3.Invalid;
return false;
}