Jump to content

Home

Is it possible tp spawn a npc at a waypoint?


Seamhainn

Recommended Posts

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...

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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);
}

)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...