Jump to content
1212PDMCDMPPM

changing the picture of the map

Recommended Posts

Hello,

for some missions, I'd really like to remove(hide) the default map picture, displaying all buildings with great details, and replace it by a more "conventional" map like these ones:

 

9b428998-ce5b-44de-812d-fa8bc382e697.jpg

 

0c0552df-4cfe-4d7a-bbd6-1732f9c025a9.jpg

 

 

What can I do to achieve that ?

 

Thx for you help !

 

 

EDIT: wrong forum section, sorry. reporting to move to the proper area

EDIT2: thx to the moderator !

  • Like 2

Share this post


Link to post
Share on other sites

That would be awesome to see such mod in Arma 3

Wysłane z iPhone za pomocą Tapatalk

Share this post


Link to post
Share on other sites

The only hint on this I have so far is to create an "icon" for the map, icon that would used the whole new map picture and declare it as automatically resizable (to keep its size whatever the zoom level).

Not sure it would work at all...

Share this post


Link to post
Share on other sites

You want to replace the ingame map when you press "M"?

 

Hook the M-key, return false and create your own dialog with a RscPicture of the "simple" map insteadt of the RscMap-Control.

Share this post


Link to post
Share on other sites

You want to replace the ingame map when you press "M"?

 

Hook the M-key, return false and create your own dialog with a RscPicture of the "simple" map insteadt of the RscMap-Control.

 

Yes, I'm talking about replacing the ingame map or hiding it.

 

If I understand your solution correctly, that means that all the usual ingame map features (double-clicking to add markers or compass display for example) will be disabled, right ?

Sorry, I'm totally noob in arma UI scripting...

Share this post


Link to post
Share on other sites

If I understand your solution correctly, that means that all the usual ingame map features (double-clicking to add markers or compass display for example) will be disabled, right ?

Sorry, I'm totally noob in arma UI scripting...

 

It is definitly not the easiest task. And yesm when you use RscPicture insteatd of RscMap all normal map features will be disabled.

 

You should probably start here and read about creation a dialog with controls: https://community.bistudio.com/wiki/Dialog_Control

You should create the dialog with your picture of a map (name it RscMyPictureMap for example) standalone in a mission and preview it. Just make sure the picture looks like you want it to be.

 

When the dialog works, you can add an displayeventhandler to intercept keypresses: https://community.bistudio.com/wiki/displayAddEventHandler

This could look like this:

myMapHandler = (findDisplay 46) displayAddEventHandler ["KeyDown", "_this call mytag_fnc_interceptM;"];

You than need a function mytag_fnc_interceptM to process the event. This could look like this:

mytag_fnc_interceptM = {
   params["_dialog","_key"];
   private _return = false; //Return variable if key was processed
   if(_key == 50) then { //50 is the M-Key
       myMap = createdialog "RscMyPictureMap";  //RscMyPictureMap is your picture dialog
       _return = true; //We don't want A3 to process the keypress any further
   };
   _return;
};

Of course you also have to add another check, if the dialog is already open (people will expect the map to close, if M is pressed when the dialog is open). 

But this is the general outline of how to archieve what you want. The Biki-articles should guide you ;)

 

This will obviously not work, if somebody has the Map not mapped on the "M"-key. For this you can check the actual keymapping, but it is more complicated.

Another approach would be checking of the map is open: https://community.bistudio.com/wiki/visibleMap and when you see the default map open, you close it with https://community.bistudio.com/wiki/openMap and open your custom dialog. But this is obviously not as elegant as my first approach. You could also combine both ideas: Listen for EVERY keypress and check if the map is open afterwards.

  • Like 1

Share this post


Link to post
Share on other sites

I took a different approach, trying to cover the map with a huge marker. :)

 

I first created a custom marker with a 3 MB jpg file, added the marker in the middle of the map then used KZK code to scale the marker.

KZK code can be found here:

http://killzonekid.com/arma-scripting-tutorials-automatic-marker-resizing/

 

I have yet to find the proper way to calculate the right scale factor based on worldsize.

 

 

Result: 

https://youtu.be/_3AW8HEBeLw

 

 

You can see that the player marker is not properly placed on the new "map". That's because the arma map and the jpg map are different. They don't overlap perfectly. The farther you got east, the bigger the difference.

  • Like 2

Share this post


Link to post
Share on other sites

Here's a version based on drawIcon:

https://www.dropbox.com/s/l77lhsuc6x4ugaj/test_map_icon.Stratis.zip?dl=0

(yes, I know there's an issue with the picture, the blank on the top and right should not be there)

 

The code is coming from  KillzoneKid (thx to Hardballer for pointing me in this direction).

 

One thing I can't understand: if I remove the line creating the car, no icon are drawn on the map. Could someone help me there please ?

 

Thx !

Share this post


Link to post
Share on other sites

Adding info so that you d'ont have to open the file to see the code:

 

description.ext:

__EXEC (MISSION_ROOT = __FILE__ select [0, count __FILE__ - 15])

init.sqf


wz_carte = "";
_root = parsingNamespace getVariable "MISSION_ROOT";
wz_carte = _root + "stratis5.jpg";

car = "C_Offroad_01_F" createVehicle position player;
// ((findDisplay 12) displayCtrl 51) mapCenterOnCamera true;  // auto center
_eh = ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", '
    (_this select 0) drawIcon [
        wz_carte,
        [1,1,1,1],
        [worldSize/2, worldSize/2,0],
        640/ctrlMapScale (_this select 0),
        640/ctrlMapScale (_this select 0),
        360
    ];
'];

if I comment out the "car = ...blablabla, nothing is displayed on the map. Icon is not drawn.

  • Like 1

Share this post


Link to post
Share on other sites
Guest

Very cool man.

Thanks for sharing.

Is there any flickering problems, position problem ?

Share this post


Link to post
Share on other sites

Very cool man.

Thanks for sharing.

Is there any flickering problems, position problem ?

 

Thanks.

 

No flickering problem (or my eyes are poor enough to have not noticed ;) ).

 

You'll have position problem in the marker addon version if the picture you're using for the map is not perfectly aligned with the real Arma map. Except if you don't care (possible if you dont use positioning system/marker and in a difficulty where ennemies and yourself are not displayed on the map), I would advise using topography export or 10T maps as base of your picture.

 

In the drawIcon version, it's not really an issue as the drawIcon seems to be always on top of everything, so you can't use marker, ACE gesture or anything on the map... I don't think it something Arma can handle at the moment (ordering layers between markers and drawing stuff). It could be a useful feature request when the tracker will be back online.

 

To summarize, the icon version is addon free but you have the map picture and that's all, not other functionnality. The addon version (I need to refine it, the zoom ratio is not good enough) seems to be fully functionnal but you need to add an addon (potential issue in some communities).

Share this post


Link to post
Share on other sites

Your picture of Stratis is off-centered. It has size of 4608x4608, whereas Stratis map area of 8192x8192 meters occupies 4506x4506 in the left bottom corner (good it is sqaure, so same proportions apply to both x and y).

4608 pixels make 8192*(4608/4506) = 8377.438082557 meters, so your icon center is located on Stratis coordinates [8377.438082557 / 2, 8377.438082557/2, 0] or (applying scale factor): [(4608/4506)*worldSize/2, (4608/4506)*worldSize/2,0].

Now to map overall scaling.

Open map and scroll out until you see the entire map. Check what ctrlMapScale returns. If it's 1 then you see map size unscaled. In my case ~794 pixels (I guess should be same for you). To get more precise number zoom in while you still can see map borders, measure map size (e.g. on screenshot), then multiply by ctrlMapScale number. So I have 1839*0.431711=793.916529 pixels.

Remember you have bigger picture than original Stratis, so width and height for youricon will be (4608/4506)*793.916529/(ctrlMapScale (_this select 0)).

 

PS. You can fill white fields with black color in any graphical software to make them less irritating (it will merge with black background of arma3 map display)

PS2. Or even better solution: crop the picture to the 4506x4506 square from the left bottom corner and fill the left white space. This area will 1:1 correspond to the Stratis world coordinates, so only scaling will be needed: no change to positioning from your variant, and  793.916529/(ctrlMapScale (_this select 0)) for icon dimensions.

Share this post


Link to post
Share on other sites

Your picture of Stratis is off-centered.

 

Yes, I had the unpleasant surprise to notice that this map from 10T is not square... I haven't checked the others yet.

I asked a friend to modify it so that it fits with the real Stratis.

 

So far, the drawIcon version has too many limitations (impossible to use markers) and too unreliable (why don't I see anything when I don't spawn the car, this is ridiculous).

The addon version is working far better, except when invoking the map mode while in camera mode, something I'm ready to sacrifice :)

Share this post


Link to post
Share on other sites

Good day, 

 

Sorry for being a necro, but this is the only place I could find concrete information on this.

On 2/25/2016 at 5:04 PM, 1212PDMCDMPPM said:

 

So far, the drawIcon version has too many limitations (impossible to use markers) and too unreliable (why don't I see anything when I don't spawn the car, this is ridiculous).

The addon version is working far better, except when invoking the map mode while in camera mode, something I'm ready to sacrifice :)

How did you end up making the addon to swap the map out? 

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

×