Jump to content

Home

Is it possible tp spawn a npc at a waypoint?


Seamhainn

Recommended Posts

Posted

void main()
{

object oPC = GetPCSpeaker();

object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("waypoint_tag_here");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "creature_resref_here", lTarget);

}

 

I think that's how you do it anyway...

Posted
void main()
{

object oPC = GetPCSpeaker();

object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("waypoint_tag_here");

lTarget = GetLocation(oTarget);

oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "creature_resref_here", lTarget);

}

 

I think that's how you do it anyway...

 

Thanks, I'll try it out!

Posted

I think that's how you do it anyway...

 

Pretty much. Waypoints are normal objects and you can get an object reference for them, and from that their location, like most other world objects.

 

(You can write the same thing with a bit less variable bloat though, even though either way should work. :)

void main() {
   location lTarget = GetLocation(GetObjectByTag("waypoint_tag_here"));
   CreateObject(OBJECT_TYPE_CREATURE, "creature_resref_here", lTarget);
}

)

Posted
You can write the same thing with a bit less variable bloat though
Got to go all the way.

void main() {
 CreateObject(OBJECT_TYPE_CREATURE, "creature_resref_here", GetLocation(GetObjectByTag("waypoint_tag_here")));
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...