Jump to content
Sign in to follow this  
soundblaster

Minimap UI display

Recommended Posts

Hello I am trying to make a minimap on my missions UI. I saw a few posts but they are out-dated. Is there a way to make a dialog that has the information of the gps??? I am new to this hopefully someone can help me out.

Share this post


Link to post
Share on other sites

I can do createdialog "rscminimap"; but you can't move then because you have a dialog open. When I try to do this with cutRsc ["RscMiniMap","PLAIN"]; it gives me an error that RscMiniMap doesn't exist...

Share this post


Link to post
Share on other sites

Okey I got this so far I got three separate files 1 where the dialog is at, 1 where the map layout is at and 1 where (it doesn't work) it should find the player location.

The map is being displayed just fine and when you spawn it shows your first position but it doesn't update it. I got this so far:

fn_gpsPosition.sqf

http://prntscr.com/70fp0t

common.hpp (there is more but too much to show it functions as it should)

http://prntscr.com/70fpap

ui.hpp

http://prntscr.com/70fpoc

As you can see it updated it where I spawned but isn't live. When you move it doesn't follow (As you can see the player isn't on the middle.)

http://prntscr.com/6zy6ev

Hopefully someone can help me with this. This is really bothering me for days now.

Edited by soundblaster

Share this post


Link to post
Share on other sites

init.sqf

fnc_updateMiniMap = {
_map = _this select 0;
_map ctrlMapAnimAdd [0, 0.05, player];
ctrlMapAnimCommit _map;
};

waitUntil { time > 0 };

//Show MiniMap
( [ "myMiniMap" ] call BIS_fnc_rscLayer ) cutRsc [ "myMap", "PLAIN", 1, false ];

description.ext

#include "basedefines.hpp"

class RscTitles {
#include "minimap.hpp"
};

basedefines.hpp

///////////////////////////////////////////////////////////////////////////
/// Styles
///////////////////////////////////////////////////////////////////////////

// Control types

#define CT_MAP_MAIN       101

#define ST_PICTURE        48


///////////////////////////////////////////////////////////////////////////
/// Base Classes
///////////////////////////////////////////////////////////////////////////


class RscMapControl
{
moveOnEdges = 0;
shadow = 0;
ptsPerSquareSea = 5;
ptsPerSquareTxt = 20;
ptsPerSquareCLn = 10;
ptsPerSquareExp = 10;
ptsPerSquareCost = 10;
ptsPerSquareFor = 9;
ptsPerSquareForEdge = 9;
ptsPerSquareRoad = 6;
ptsPerSquareObj = 9;
showCountourInterval = 0;
scaleMin = 0.001;
scaleMax = 1.0;
scaleDefault = 0.16;
maxSatelliteAlpha = 0.85;
alphaFadeStartScale = 2;
alphaFadeEndScale = 2;
colorBackground[] = {0.969,0.957,0.949,1.0};
colorText[] = {0,0,0,0};
colorSea[] = {0.467,0.631,0.851,0.5};
colorForest[] = {0.624,0.78,0.388,0.5};
colorForestBorder[] = {0.0,0.0,0.0,0.0};
colorRocks[] = {0.0,0.0,0.0,0.3};
colorRocksBorder[] = {0.0,0.0,0.0,0.0};
colorLevels[] = {0.286,0.177,0.094,0.5};
colorMainCountlines[] = {0.572,0.354,0.188,0.5};
colorCountlines[] = {0.572,0.354,0.188,0.25};
colorMainCountlinesWater[] = {0.491,0.577,0.702,0.6};
colorCountlinesWater[] = {0.491,0.577,0.702,0.3};
colorPowerLines[] = {0.1,0.1,0.1,1.0};
colorRailWay[] = {0.8,0.2,0.0,1.0};
colorNames[] = {0.1,0.1,0.1,0.9};
colorInactive[] = {1.0,1.0,1.0,0.5};
colorOutside[] = {0.0,0.0,0.0,1.0};
colorTracks[] = {0.84,0.76,0.65,0.15};
colorTracksFill[] = {0.84,0.76,0.65,1.0};
colorRoads[] = {0.7,0.7,0.7,1.0};
colorRoadsFill[] = {1.0,1.0,1.0,1.0};
colorMainRoads[] = {0.9,0.5,0.3,1.0};
colorMainRoadsFill[] = {1.0,0.6,0.4,1.0};
colorGrid[] = {0.1,0.1,0.1,0.6};
colorGridMap[] = {0.1,0.1,0.1,0.6};
font = "TahomaB";
sizeEx = 0.040000;
fontLabel = "PuristaMedium";
sizeExLabel = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
fontGrid = "TahomaB";
sizeExGrid = 0.02;
fontUnits = "TahomaB";
sizeExUnits = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
fontNames = "EtelkaNarrowMediumPro";
sizeExNames = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2";
fontInfo = "PuristaMedium";
sizeExInfo = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
fontLevel = "TahomaB";
sizeExLevel = 0.02;
text = "#(argb,8,8,3)color(1,1,1,1)";
class Legend
{
	x = "SafeZoneX + 					(			((safezoneW / safezoneH) min 1.2) / 40)";
	y = "SafeZoneY + safezoneH - 4.5 * 					(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
	w = "10 * 					(			((safezoneW / safezoneH) min 1.2) / 40)";
	h = "3.5 * 					(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
	font = "PuristaMedium";
	sizeEx = "(			(			(			((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
	colorBackground[] = {1,1,1,0.5};
	color[] = {0,0,0,1};
};
class Task
{
	icon = "\A3\ui_f\data\map\mapcontrol\taskIcon_CA.paa";
	iconCreated = "\A3\ui_f\data\map\mapcontrol\taskIconCreated_CA.paa";
	iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa";
	iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa";
	iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa";
	color[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])"};
	colorCreated[] = {1,1,1,1};
	colorCanceled[] = {0.7,0.7,0.7,1};
	colorDone[] = {0.7,1,0.3,1};
	colorFailed[] = {1,0.3,0.2,1};
	size = 27;
	importance = 1;
	coefMin = 1;
	coefMax = 1;
};
class Waypoint {
	icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa";
	color[] = {0.00, 0.00, 0.00, 1.00};
	size = 24;
	importance = 1.00;
	coefMin = 1.00;
	coefMax = 1.00;
};
class WaypointCompleted {
	icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa";
	color[] = {0.00, 0.00, 0.00, 1.00};
	size = 24;
	importance = 1.00;
	coefMin = 1.00;
	coefMax = 1.00;
};
class ActiveMarker {
	color[] = {0.30, 0.10, 0.90, 1.00};
	size = 50;
};
class CustomMark
{
	icon = "\A3\ui_f\data\map\mapcontrol\custommark_ca.paa";
	size = 24;
	importance = 1;
	coefMin = 1;
	coefMax = 1;
	color[] = {0,0,0,1};
};
class Command
{
	icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa";
	size = 18;
	importance = 1;
	coefMin = 1;
	coefMax = 1;
	color[] = {1,1,1,1};
};
class Bush
{
	icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa";
	color[] = {0.45,0.64,0.33,0.4};
	size = "14/2";
	importance = "0.2 * 14 * 0.05 * 0.05";
	coefMin = 0.25;
	coefMax = 4;
};
class Rock
{
	icon = "\A3\ui_f\data\map\mapcontrol\rock_ca.paa";
	color[] = {0.1,0.1,0.1,0.8};
	size = 12;
	importance = "0.5 * 12 * 0.05";
	coefMin = 0.25;
	coefMax = 4;
};
class SmallTree
{
	icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa";
	color[] = {0.45,0.64,0.33,0.4};
	size = 12;
	importance = "0.6 * 12 * 0.05";
	coefMin = 0.25;
	coefMax = 4;
};
class Tree
{
	icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa";
	color[] = {0.45,0.64,0.33,0.4};
	size = 12;
	importance = "0.9 * 16 * 0.05";
	coefMin = 0.25;
	coefMax = 4;
};
class busstop
{
	icon = "\A3\ui_f\data\map\mapcontrol\busstop_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class fuelstation
{
	icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class hospital
{
	icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class church
{
	icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class lighthouse
{
	icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class power
{
	icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class powersolar
{
	icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class powerwave
{
	icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class powerwind
{
	icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class quay
{
	icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class transmitter
{
	icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class watertower
{
	icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {1,1,1,1};
};
class Cross
{
	icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {0,0,0,1};
};
class Chapel
{
	icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {0,0,0,1};
};
class Shipwreck
{
	icon = "\A3\ui_f\data\map\mapcontrol\Shipwreck_CA.paa";
	size = 24;
	importance = 1;
	coefMin = 0.85;
	coefMax = 1.0;
	color[] = {0,0,0,1};
};
class Bunker
{
	icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa";
	size = 14;
	importance = "1.5 * 14 * 0.05";
	coefMin = 0.25;
	coefMax = 4;
	color[] = {0,0,0,1};
};
class Fortress
{
	icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa";
	size = 16;
	importance = "2 * 16 * 0.05";
	coefMin = 0.25;
	coefMax = 4;
	color[] = {0,0,0,1};
};
class Fountain
{
	icon = "\A3\ui_f\data\map\mapcontrol\fountain_ca.paa";
	size = 11;
	importance = "1 * 12 * 0.05";
	coefMin = 0.25;
	coefMax = 4;
	color[] = {0,0,0,1};
};
class Ruin
{
	icon = "\A3\ui_f\data\map\mapcontrol\ruin_ca.paa";
	size = 16;
	importance = "1.2 * 16 * 0.05";
	coefMin = 1;
	coefMax = 4;
	color[] = {0,0,0,1};
};
class Stack
{
	icon = "\A3\ui_f\data\map\mapcontrol\stack_ca.paa";
	size = 20;
	importance = "2 * 16 * 0.05";
	coefMin = 0.9;
	coefMax = 4;
	color[] = {0,0,0,1};
};
class Tourism
{
	icon = "\A3\ui_f\data\map\mapcontrol\tourism_ca.paa";
	size = 16;
	importance = "1 * 16 * 0.05";
	coefMin = 0.7;
	coefMax = 4;
	color[] = {0,0,0,1};
};
class ViewTower
{
	icon = "\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa";
	size = 16;
	importance = "2.5 * 16 * 0.05";
	coefMin = 0.5;
	coefMax = 4;
	color[] = {0,0,0,1};
};
};

minimap.hpp

class myMap
{

idd = 20000;
duration = 1e10;
fadein = 0;
fadeout = 0;

class controlsBackground
{

	class theMiniMap : RscMapControl
	{

		idc = 38555;
		type = 101;
		style = 48;
		moveOnEdges = 0;
		x = 0.2 * safeZoneX;
		y = 0.2 * safeZoneY;
		w = 0.6 * safeZoneW;
		h = 0.6 * safeZoneH;

		onDraw = "_this call fnc_updateMiniMap";
	};

};
};

TEST MISSION

Share this post


Link to post
Share on other sites

I've been working on basically the same thing but just using scripts and not resource files. I can create the map fine and still move my player without issues. But centering on my player isn't working. It is updating and moving as I move, just not with the center as my player.

[] spawn {
disableSerialization;
_mmap = findDisplay 46 ctrlCreate ["RscMapControl", -420];
_mmap ctrlSetPosition [-0.6, 0.4, 0.4, 0.4];
_mmap ctrlCommit 0;
while {true} do {
	_mmap ctrlMapAnimAdd [0, 0.05, player];
	ctrlMapAnimCommit _mmap;
};
};

Share this post


Link to post
Share on other sites

It seems to be treating the center as if it were still in the middle of the screen and the map were still full sized.

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  

×