Ludeon Forums

RimWorld => General Discussion => Topic started by: porcupine on December 14, 2014, 11:34:21 PM

Title: How do visitors determine where to hang out?
Post by: porcupine on December 14, 2014, 11:34:21 PM
Anybody figured this out?  I have a problem, my base has multiple entrances, two sides of a mountain.  On one side, I have a crashed ship, setting out maximum drone, and nowhere near the ability to take it (without loosing the colony of course).

On the other side, well, all my defenses.

I tried removing everything from my home region, and setting home just outside the side of the base in which I need help (and calling reinforcements) to no avail.  They congregate at my main defenses.

So how do visitors figure out where your home is?  Is it stockpiles?  Is it "claimed/owned" equipment?  It doesn't seem to be your home region..
Title: Re: How do visitors determine where to hang out?
Post by: Tynan on December 15, 2014, 12:08:29 AM
:D


public static IntVec3 RandomChillNearColonySpot(IntVec3 originCell)
{
System.Predicate<IntVec3> validator = c=>
{
if( !c.Standable() )
return false;

if( Find.RoofGrid.Roofed(c) )
return false;

if( !c.CanReachColony() )
return false;

if( !originCell.CanReach( c, PathMode.OnCell, TraverseMode.PassDoors, Danger.None ) )
return false;

return true;
};

for( int i=0; i<400; i++ )
{
Thing rootThing;

Building b;
Find.ListerBuildings.allBuildingsColonistCombatTargets.TryRandomElement(out b);
rootThing = b;

if( rootThing == null && Find.ListerBuildings.allBuildingsColonist.Count > 0 )
rootThing = Find.ListerBuildings.allBuildingsColonist.RandomElement();

if( rootThing == null && Find.ListerPawns.FreeColonistsCount > 0 )
rootThing = Find.ListerPawns.FreeColonists.RandomElement();

if( rootThing == null )
rootThing = Find.ListerPawns.ColonistsAndPrisoners.RandomElement();

IntVec3 c;
if( GenCellFinder.TryFindRandomMapCellNearWith( rootThing.Position, 12, validator, out c ) )
return c;
}

return GenCellFinder.RandomCellWith( validator );
}
Title: Re: How do visitors determine where to hang out?
Post by: porcupine on December 15, 2014, 01:33:45 AM
So I need to create a roof over the crashed ship, and have my boys hang out at it for awhile? :D

Seems a bit cheatey heh
Title: Re: How do visitors determine where to hang out?
Post by: Lost Cause on December 15, 2014, 08:18:04 AM
I like to build little stone temples around mine and keep them around forever!
Title: Re: How do visitors determine where to hang out?
Post by: Meridias on December 15, 2014, 10:48:16 PM
You might want to add in a check for "If where I'm standing is in the fire arcs of multiple turrets, this might not be a safe place to be." :)
Title: Re: How do visitors determine where to hang out?
Post by: Tynan on December 15, 2014, 10:51:49 PM
Quote from: Meridias on December 15, 2014, 10:48:16 PM
You might want to add in a check for "If where I'm standing is in the fire arcs of multiple turrets, this might not be a safe place to be." :)

Maybe not safe, but it's probably a FUN place to be!
Title: Re: How do visitors determine where to hang out?
Post by: StorymasterQ on December 16, 2014, 12:10:58 AM
Quote from: Tynan on December 15, 2014, 10:51:49 PM
Quote from: Meridias on December 15, 2014, 10:48:16 PM
You might want to add in a check for "If where I'm standing is in the fire arcs of multiple turrets, this might not be a safe place to be." :)

Maybe not safe, but it's probably a FUN place to be!

Because LOSING IS FUN!
Title: Re: How do visitors determine where to hang out?
Post by: Cimanyd on December 16, 2014, 12:16:06 AM
Quote from: StorymasterQ on December 16, 2014, 12:10:58 AM
Quote from: Tynan on December 15, 2014, 10:51:49 PM
Quote from: Meridias on December 15, 2014, 10:48:16 PM
You might want to add in a check for "If where I'm standing is in the fire arcs of multiple turrets, this might not be a safe place to be." :)

Maybe not safe, but it's probably a FUN place to be!

Because LOSING IS FUN!

The pirates and tribals certainly agree.