Jump to content
Sign in to follow this  
ryguy

Creating a radar

Recommended Posts

I'd like to find out how I can get a player to have a dot on the map follow it around followed by it's altitude... I was thinking I would somehow incorporate "GetPosASL" in a trigger and it would display like a radar whenever they were in that trigger, and when they were out of range they would be invisible again. In case you've ever played CL:R it would be very similar to this. Problem is I don't know how I could set it up so that a marker is attached to a player and refreshes it's altitude and position every second or so... any help?

Thanks

Share this post


Link to post
Share on other sites

For displaying the ASL = "nameofmarker" setMarkerText format ["%1", GetPosASL this select 2]

this will result in 67.098

If you want the hight with out the .000's use this

"nameofmarker" setMarkerText format ["%1", round (GetPosASL this select 2)]

result is 67

oh and it needs to be looped to update the text

Edited by Junker

Share this post


Link to post
Share on other sites

I use the following for debugging purposes:

while {true} do {
if (!isNull uUAV) then {
	"mUAV" setMarkerPos getPos uUAV;
	"mUAV" setMarkerText format ["%1%2|F:%3%4", round ((getPosASL uUAV select 2) / 0.30480), toString[39], 10 * floor (10 * fuel uUAV), toString[37]];
sleep 1.234;
};
};

Whether you preplace the marker on the map or create it on the fly is up to you.

while {true} do { ...

could be replaced by

while {player in list tSomeTrigger} do { ...

Edit: Beaten again :)

Btw, I have som aviation background, so I prefer altitude as feet. Hope that is not too confusing.

Share this post


Link to post
Share on other sites

Not sure but if I remember correctly using ASL is not a good idea in a terrain with lots of mountains using ATL is better there. However it will give wrong results on water so I'd suggest something like this.

watertest = surfaceIsWater[(getPos Player select 0), (getPos Player select 1)];

if(watertest)

then

{

height = floor ((getPosASL player) select 2);

}

else

{

height = floor ((getPosATL player) select 2);

};

Share this post


Link to post
Share on other sites
For displaying the ASL = "nameofmarker" setMarkerText format ["%1", GetPosASL this select 2]

this will result in 67.098

If you want the hight with out the .000's use this

"nameofmarker" setMarkerText format ["%1", round (GetPosASL this select 2)]

result is 67

oh and it needs to be looped to update the text

Awesome, would I just put a #loop at the beginning of this string to loop it? Also, how quickly would it refresh?

---------- Post added at 01:58 AM ---------- Previous post was at 12:26 AM ----------

Alright, so I put this code into a trigger's "on act." near a marker labeled "radar":

"radar" setMarkerText format ["%1", GetPosASL radar select 2]

Now when I look at it in-game the marker is in the same place except it's labeled "any" next to it.

Share this post


Link to post
Share on other sites

Its needs to be scripted - this part only gives you the icon the rest im not really clear about because you need to detect air units within the radar/trigger using Thislist and relaying that to the script itself..

the loop should be something like (Sorry SQS oldie)

#loop
"radar" setMarkerText format ["%1", GetPosASL radar select 2]
~1
goto "loop"

Share this post


Link to post
Share on other sites

So I should make a file with this in it and put it in the mission folder? Or add it to the mission.sqm?

Share this post


Link to post
Share on other sites

MARTA has some "radar stuff", have you checked there for useful hints?

ArmA 2\AddOns\modules\Marta\data\scripts

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  

×