Jump to content

Recommended Posts

Good day armates. I search for some kind of intel to be filled with text depending on mission conditions on the field. If there is a mod or script structure or any kind of way to do this nice and clean, please refer to it. To be precise about what I need, I will put a situation: 

there are randomly placed, underwater mines in a depth range of -5  to  -100 meters and in random horizontal area placement of 600 m2. They are used in exercises for underwater orientation, not as part of operation strategy. So the goal is only to provide recruits with enough info to find and disarm them in specific aquatorium using these commands: 

systemChat format ["АЗИМУТ: %1", (player getDir nm1)]; //azimuth

systemChat format ["ДУБИНА: %1", ((getPosASL nm1) select 2)+45]; //depth

systemChat format ["ДИСТАНЦА: %1", (player distance nm1)]; //dist

where nm1, nm2... are names for mines of course, so a compass and depth gauge will be enough to complete the task. My question: Is there a way to place this information in intel so that looks more realistic than just providing them using systemChat . Maybe some addon with picture intel with empty fields ready to be filled with a script? It will be easy to use in normal ways but the info package is always changing and it is random for every new exercise so I need to solve that using systemChat every time a new course begins. Of course, I was searching Steam for an addon like that but every one I found was "static" intel - not changeable depending on the mission conditions. Every idea is welcome, it doesn't have to be an add-on, just to be more realistic than hints or system chats. Thanks in advance

 

edited/added: the whole script for placing mine (if needed):

.sqf

//CENTAR-1
cntr1 = createVehicle ["Land_WoodenLog_F", [0,0,1000], [], 0, "CAN_COLLIDE"];
cntr1 allowDamage false;
cntr1 setPos getMarkerPos "mrk_1";
cntr1 hideObject true; sleep .5; 

 

//HORIZONT POS
nm1 = createMine ["UnderwaterMine", getMarkerPos "mrk_1", [], 0]; sleep .5;

//POZ-1 DEFINICIJA
_poz1 = [cntr1, 5, 600, 10, 2, 1, 0] call BIS_fnc_findSafePos; sleep .5;
nm1 setPos _poz1; 

 

//VERTICAL POS
_depth = selectRandom [40,35,30,25,20,15,10,5,0,-5,-10,-15,-20,-25,-30,-35,-40,-45,-50,-55]; sleep .5;
nm1 setPos [getPos nm1 select 0, getPos nm1 select 1, (getPos nm1 select 2) +_depth];

Share this post


Link to post
Share on other sites

You could add a little display, compass like.  Here is an example of what I did for my modules, but you can script that, no need for an addon.

You can point at the nearest mine's direction, add distance and depth as figures.

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Custom HUD is my old wish, this one from the video looks fantastic, but in this case, it will make exercise easier - the opposite of what are we trying to do. Thanks anyway, bro!

Share this post


Link to post
Share on other sites
1 hour ago, Nemanjic said:

Custom HUD is my old wish, this one from the video looks fantastic, but in this case, it will make exercise easier - the opposite of what are we trying to do. Thanks anyway, bro!

Do you need an "intel" like a diary record (when opening map?

So you can place a "create Diary Record" module (vanilla intel module);

synchronize the module to player(s)

Subject: Mine training   (or else)

Title:Nearest mine (example)

In description field :

 

 The nearest mine is located  <execute expression=" hint  formatText ['bearing %1%4distance %2%4depth %3', round (player getdir (nearestMines [player, ['MineBase'], 50] select 0)), round (player distance (nearestMines [player, ['MineBase'], 50] select 0)), - round ((getPosASL  (nearestMines [player, ['MineBase'], 50] select 0)) select 2), lineBreak]">"click here"</execute>

 

This way, when player opens map, goes to "mine training" subject .."Nearest mine", he can read an intel:

The nearest mine is located "click here" (in orange underlined) .

When he clicks, there is a hint with bearing , distance, depth of the nearest mine..

 

You see the principle, you can call a stringed code in execute expression.

I hope that help.

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

@pierremgi I think this is bingo! I just to run tests now and present a little modification right away before I start testing otherwise it will be the next question anyway:

 

a small modification of the question:

I need mines to be located and disarmed accordingly to their numeric so first nm1, next nm2, ...etc, and not by the nearest mine first. This way dive time is much longer, and therefore air usage rate is much bigger (V.Q.I. F.R.O.G.S) so recruits need to be especially careful with air left in the tank. If the nearest mine is used, then the complete path needed for observing all mines is much shorter and easy to complete when reserves of air are about. The code I use, always tells the player the distance, azimuth, and depth of NEXT mine. Just to pack this code to intel on the way you mention and it will be bingo. Testing now..

 

EDITED after testing:

The code you provide is working well if remove one error (red underlined minus symbol):

The nearest mine is located <execute expression=" hint formatText ['bearing %1%4distance %2%4depth %3', round (player getdir (nearestMines [player, ['MineBase'], 50] select 0)), round (player distance (nearestMines [player, ['MineBase'], 50] select 0)), - round ((getPosASL (nearestMines [player, ['MineBase'], 50] select 0)) select 2), lineBreak]">"click here"</execute>

but only for the nearest mines of type "mineBase" and not for specific mine, so I tried to modify the code to:

Mine located 1  <execute expression="hint formatText ['АЗИМУТ %1%4ДИСТАНЦА %2%4ДУБИНА %3', (player getdir nm1), (player distance nm1), ((getPosASL nm1) select 2)+45, lineBreak]">"click here"</execute>

and it working great. Thank you!

 

Now I need a way to do exactly the same thing but via script command, not using a module. I am trying for almost 3 hours without success. Tried my old way of creating a diary record:

unit createDiaryRecord ["Diary",  
    ["TASKS",  
"hint formatText ['АЗИМУТ %1%4ДИСТАНЦА %2%4ДУБИНА %3', (player getdir nm1), (player distance nm1), ((getPosASL nm1) select 2)+45, lineBreak]">"click here"</execute>
"]  
];

but not even near to succeeding. I need this scripted way because the next step is easy to implement all these steps to be executed when the recruit takes and reads an intel document (training card).

 

EDITED: Solved finally! This execute expression is a magic command, the ocean of opportunities is now opened! 

9zn0Pau.jpg

  • Like 1
  • Thanks 1

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

×