Making two personal waypoints that can only be seen by a specific player
I was using some code from RabbitGame.cs to put a personal waypoint on an object for one player's eyes only. Unfortunately, I need two personal waypoints and I can't seem to find a way to do it.
The code I'm using for the first waypoint is this:
This appears to only work with one objective at a time.
The code I'm using for the first waypoint is this:
%client.setTargetId(%flag.target); commandToClient(%client, 'TaskInfo', %client, -1, false, "Grab the Flag!"); %client.sendTargetTo(%client, true);
This appears to only work with one objective at a time.
Comments
You could try scoping mission waypoints to individual clients (as was discussed in the distance limited mine waypoint topic, but use mission markers, rather than beacons), but you would need to move those around with a loop to keep them "attached" to objects.
Krash suggested "creating an additional sensorgroup for each player's waypoints and setting a nevervis mask for ~team" on IRC. How would I go about setting this up? Tribes 2 seems to be needlessly obtuse when it comes to this kind of code. The gametype already uses DM coding to throw everyone on their own team.
I have another thought. I know that when certain commands are issued by players (like escorting players who have just grabbed the flag), a temporary task waypoint shows up, which doesn't disrupt any persistent task waypoints that the client has selected. You might be able to use the same method (probably a messageClient or clientCmd) of creating transient waypoints on a schedule to implement your 2+ client waypoints.
Anyway, the code for setting objectives eventually seems to call %client.sendTargetTo the same way, but it puts false instead of true. This seems to give it that "temporary" feel and running a schedule every 2 seconds seems to make it work the way I intended (with the minor problem of the waypoint sticking around when the waypoints need to be changed). So yeah, it works for now.
After a bit of research, I can remove that waypoint early with removeClientTargetType(%client, "PotentialTask");.