Author Topic: Creating NPC statues above ground level  (Read 314 times)

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Creating NPC statues above ground level
« on: December 09, 2011, 06:57:50 am »


               I have an area where it spawns harpy (which have EffectPetrify() applied to them after they are created) statues at random waypoint locations.  Some of the waypoints are at ground level, and others are elevated off the ground at various heights on the mountain slopes.

When I enter the area, all the harpy statues are at ground level, not at the height of the waypoints' locations.  I am guessing this occurs because the mountain slope where some of the waypoints are located is not a valid location for an npc, so it drops them down to the closest valid location.

Is there a way to make the monster statues spawn on the mountain sides?

For reference, here's the code snippet I run when the player enters the area:

string s;
object oWP = GetFirstObjectInArea(oPC);
while( GetIsObjectValid(oWP) )
{
    if( GetTag(oWP) == "SENTINELWP" )
    {
         if( Random(100) < 20 )
         {
            s = "rl_sentinelharp"+IntToString(d4());
            CreateObject(OBJECT_TYPE_CREATURE,s,GetLocation(oWP));
        }
    }
    oWP = GetNextObjectInArea(oPC);
}
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
Creating NPC statues above ground level
« Reply #1 on: December 09, 2011, 03:34:01 pm »


               You can't have NPC's in invalid locations. It will spawn it to the closest valid location. As far as I know nothing can be done about this...

Now that im thinking about it... What happens if you spawn a creature into an area with no valid locations at all? What happens if you move a player to such an area? Gotta test this when I get home...