jagatai
Member
|
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 |
|
Esenthel
Administrator
|
RE: Game.World.findWaypoint
|
|
05-24-2013 12:32 PM |
|
jagatai
Member
|
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 |
|
Rubeus
Member
|
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 |
|
Esenthel
Administrator
|
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 |
|