About Store Forum Documentation Contact



Post Reply 
Game.World.findWaypoint
Author Message
jagatai Offline
Member

Post: #1
Game.World.findWaypoint
Has anyone else had problems using Game.World.findWaypoint() as Str vice UID?

I can use Game.World.findWaypoint if i use UID, however if i try to pass the Str of the waypoint name from editor as opposed to UID it will not work :(

anyone else have this problem?

ES 2.0

-J
05-24-2013 03:47 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Game.World.findWaypoint
Hello!

Point 3 in this thread http://www.esenthel.com/community/showth...t=waypoint will answer your question.
05-24-2013 12:32 PM
Find all posts by this user Quote this message in a reply
jagatai Offline
Member

Post: #3
RE: Game.World.findWaypoint
Thanks Esenthel, however that's not what I was looking for as im basically using Waypoints as NPC spawn spots (Server side).

My current work around consists of a UID [] array where ive had to hard copy each UID from the WP's which I then iterate to spawn the NPC's, would have been easier if I was able to do so via the "name" value of the WP something along the lines of:

Example:
Code:
REP(Num_of_WP)
   {
      Str myWP = S+"Waypoint "+i
      Game.Waypoint *waypoint = world.findWaypoint(myWP);
      if(waypoint != null)
      {
            Vec spawnPos = waypoint.points[0].pos+Vec(RandomF(0, 20), 1.0f, RandomF(0, 20));
            .... Create NPC at spawnPos below ....
      }
   }

Im using MMO, so this is being handled via an NPCManager server side.
Thanks,
-J
05-24-2013 03:55 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #4
RE: Game.World.findWaypoint
Have you thought about doing something similar to Scarlet Thread's trigger system? Instead of triggers, just make them for spawning your NPCs. Or you could even put the NPC spawning code in their update function.
05-24-2013 07:05 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Game.World.findWaypoint
@jagatai: oh I understand, sorry that's currently not available. Copying the waypoint ID's is the right solution though.
05-24-2013 07:10 PM
Find all posts by this user Quote this message in a reply
Post Reply