Jump to content
Sign in to follow this  
abdecken

Display player names (Training Aid)

Recommended Posts

I want to create a spectating script to use as a training aid for our squad when practicing on our server.

I have a unit named cameraman and a repeating trigger on radio channel alpha:

condition: this && player == cameraman

on act: nul = [] execvm "icons.sqf"; nul = [] execvm "camera.sqs"

in the icon.sqf I use some code to show all player unit names:

onEachFrame {
{
if(side _x != side player) then {drawIcon3D ["", [1,0,0,0.7], position _x, 1, 1, 45, (format ["%2:%1m",player distance _x, name _x]), 1, 0.03, "default"]} else
{drawIcon3D ["", [0,1,0.5,0.4], position _x, 1, 1, 45, (format ["%2:%1m",player distance _x, name _x]), 1, 0.03, "default"]};
} foreach allunits;}

but it seems the drawIcon3D does not show up while using the camera.sqs :(

Share this post


Link to post
Share on other sites

if(isNil "myIcons") then {
 myIcons = addMissionEventHandler["draw3d",{
     {
       if(side _x != side player) then {
         drawIcon3D ["", [1,0,0,0.7], visibleposition _x, 1, 1, 45, (format ["%2:%1m",player distance _x, name _x]), 1, 0.03, "default"];
       } else {
         drawIcon3D ["", [0,1,0.5,0.4], visibleposition _x, 1, 1, 45, (format ["%2:%1m",player distance _x, name _x]), 1, 0.03, "default"];
       };
     } foreach allunits;
   }
 ];
};

Maybe that would work? I am not sure. Worth a shot!

I also replaced position _x with visibleposition, learned that from KK, and it gives it a lot smoother updating.

Eh, made a mistake. fix'd it!

Edited by Tuliq

Share this post


Link to post
Share on other sites

after some more trial and error it seems all images displayed by the drawIcon3D command are not visible to camera objects :(

is there another way to achieve what I want?

Share this post


Link to post
Share on other sites

That seems strange... BIS's own splendid cam displays icons, so I guess there must be a way to do it.

Share this post


Link to post
Share on other sites

I seem to remember the main menu has a birds eye view with nato icons overlaid. I am just not sure how it is done, but is it possible to open a pbo file somewhere and look at the mission?

Share this post


Link to post
Share on other sites

You need to enable effect for the camera first with:

cameraEffectEnableHUD true;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×