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:
%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

  • I think a client can only have one active task waypoint at a time.

    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.
  • I worked up a simple workaround in my own case, which is for showing markers on disabled equipment for the team the equipment belongs to, by using an item with a HUD marker and selectively ghosting it to the entire team.
    Sounds like no one quite got that method to work on mission markers themselves. Not quite sure what he means by "an item with a HUD marker" either.
  • edited August 2009
    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.
    Hiding a WayPointMarker object keeps it from showing up even if you try to scope it to a client. I've already tried this.

    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.
  • Oh, that's messy. I think what Krash is suggesting is creating 2 team sensor groups for each player. One they are a member of, the paired group is set to never be visible to sensor groups other than the one the player is a member of (presumably you would put whatever waypointed objects in this group). As to how that would help make a visible waypoint object... I'm not sure.

    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.
  • edited August 2009
    Let me clarify Krash's suggestion. I have a bunch of flags laying around, and one idea was to get rid of the global icons on all but 2 of them for each player: his current target which is the current waypoint code, and the next target which lets him know how he'll have to approach the next target. I'm not sure if it'd work quite the right way.

    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.
    %client.setTargetId(%nextFlag.target);
       commandToClient(%client, 'TaskInfo', %client, -1, false, "[Next Flag]");
       %client.sendTargetTo(%client, false);
    

    After a bit of research, I can remove that waypoint early with removeClientTargetType(%client, "PotentialTask");.
  • %mine.waypoint = createClientTarget(-1, %mine.position); 
     %mine.waypoint.createWaypoint("Mine");
    
    Usefull?
Sign In or Register to comment.