Jump to content
Sign in to follow this  
monotone

Pointing a place on 3D world

Recommended Posts

It would be nice that player leader can tell his root plan to subordinate people by directly point his idea on world like Augmented Reality.

To make this feature,I searched SecOp Module file because it uses world pointing to call arty mission but I couldn't find module itself.

Clicking map is easy to implement but I'd like to know how clicking world.

Share this post


Link to post
Share on other sites

I haven't used real World co-ordinates for waypoints but I did use it to call in an Artillery Strike.

place in leaders init.

player addaction ["CAll ARTY","position.sqf",[5,400,12,60] ,0,true,true,"","_target == leader player"]

save script as "Position.sqf"

//player addaction ["CAll ARTY","position.sqf",[5,400,12,60] ,0,true,true,"","_target == leader player"]
//null=[5,400,25,80] execvm "bombs.sqf"
if (!isServer) exitWith {};

 private "_ammo";

_vars= _this select 3;

_ammotype = _vars select 0; // type of ammo
_height   = _vars select 1; // height of drop
_rounds   = _vars select 2; // how many
_spread   = _vars select 3; // area

If !(player getvariable "Progress") exitwith {player sidechat "Artillery Committed Please Wait"}; 

player setvariable ["Progress",false,false];

Player sidechat "Location confirmed";
sleep 1;
player sidechat "Artillery Inbound";


_pos  = screenToWorld [0.5,0.5];// land position 
if (!isnull cursortarget) then { _pos = getpos cursortarget};// building / object position

switch (_ammotype) do {
case 0:{_ammo = "R_57mm_HE"};
     case 1:{_ammo = "Sh_105_HE"};
     case 2:{_ammo = "Bo_GBU12_LGB"};
     case 3:{_ammo = "M_Stinger_AA"};
     case 4:{_ammo = "R_80mm_HE"};
     case 5:{_ammo = "ARTY_Sh_122_HE"};
     case 6:{_ammo = "Sh_85_AP"};
     case 7:{_ammo = "Bo_FAB_250"};
     case 8:{_ammo = "Grenade"};
           };


for "_x" from 1 to _rounds do {
 sleep random 0.8;
  _bomb = _ammo createVehicle [( _pos select 0)+(random _spread)-_spread/2, (_pos select 1)+(random _spread)-_spread/2,_height];

_bomb setVectorUp [0, 9, 0.1];
};
sleep 20;
Player sidechat "Artillery Available";

player setvariable ["Progress",true,true];

The main part is this

_pos  = screenToWorld [0.5,0.5];// land position 
if (!isnull cursortarget) then { _pos = getpos cursortarget};// building / object position

If converts the the cursor position to actual co-ordinates.

You would have to replace the bomb section with a waypoint and remove the limits so you can create several.

Is it really worth the effort as you can move your group to a position anyway.

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  

×