Jump to content
HazJ

ctrlMapAnimAdd offset issues

Recommended Posts

When I use this, there seems to be a huge offset resulting in the map not even showing the player. I am using a custom map control created with ctrlCreate. When I set the zoom to 0, it works fine but it's zoomed all the way in. Do I need to use ctrlMapScale some how?

_map ctrlMapAnimAdd [0, 0.4, getPosATL player];
ctrlMapAnimCommit _map;

Share this post


Link to post
Share on other sites

Bump. I've seen this work in a Takistan mission, even with the code pretty much the same I still get this issue. The only thing different is, I use the ctrlCreate command to create the map control. I remember I have done this before but on Altis, using ctrlCreate, I looked at that code I did but doesn't work. I am starting to think it's an issue because of the size of the control? I am using safeZone in both codes but the size is only thing different. Does anyone know a fix or work around for this?

 

EDIT: SOLVED! I just resolved the issue. I decided to look at the code in working mission and I guess I overlooked a command. I fixed this by using getPosWorld rather than getPos, position or getMarkerPos. It sucks a little as I'd rather use a marker but this will do. Working mission was Domination by Xeno, so thanks to him! :)

Edited by HazJ
SOLVED

Share this post


Link to post
Share on other sites

Back to square one... I am trying to use this command again but with Altis but having the same issue, weird map zoom bug... Any ideas? Last solution no longer works either.

_mapCtrl ctrlMapAnimAdd [1, 0.10, (getPosWorld spawnLogic)];
ctrlMapAnimCommit _mapCtrl;
waitUntil {(ctrlMapAnimDone _mapCtrl)};
_mapCtrl ctrlMapAnimAdd [1, 0.10, (getMarkerPos _spawn)];
ctrlMapAnimCommit _mapCtrl;
waitUntil {(ctrlMapAnimDone _mapCtrl)};

The variable _spawn is a marker.

None of these work! It moves the map but the zoom is really weird and messed up, massive offest.

Share this post


Link to post
Share on other sites

Bump! Here's a example mission if anyone needs it:

https://ufile.io/mfaxy

Start the mission and put this in debug:

[] execVM "test.sqf";

 

Share this post


Link to post
Share on other sites

Have you solved the problem? Cuz i have the same problem :x

 

@HazJ

Share this post


Link to post
Share on other sites

Not that I remember. It appears to be only with certain custom terrains, CUP Takistan is one of them that was causing it I believe.

Share this post


Link to post
Share on other sites

Ah wait, I think I used getPosWorld, try that. If not, I'll dig up the code I used. Vanilla maps worked fine for me.

Share this post


Link to post
Share on other sites

What are you using? Markers, object position or what? This is a working example from one of my projects:

(_display displayCtrl idc_spawnSelection_spawns) ctrlAddEventHandler ["LBSelChanged",
{
	_display = uiNamespace getVariable "disp_spawnSelection";
	_map = _display displayCtrl idc_spawnSelection_map;
	_spawn = lbText [idc_spawnSelection_spawns, (lbCurSel idc_spawnSelection_spawns)];
	_town = lbData [idc_spawnSelection_spawns, (lbCurSel idc_spawnSelection_spawns)];
	ctrlMapAnimClear _map;
	if (lbCurSel idc_spawnSelection_spawns isEqualTo 0) then
	{
		_map ctrlMapAnimAdd [1, 0.18, getMarkerPos (selectRandom townMarkers)];
	} else
	{
		_map ctrlMapAnimAdd [1, 0.18, getMarkerPos _town];
	};
	ctrlMapAnimCommit _map;
	_getTownStatus = [_town, _spawn] call client_fnc_getTownStatus;
	if (lbCurSel idc_spawnSelection_spawns isEqualTo 0) exitWith
	{
		(_display displayCtrl idc_spawnSelection_spawnStatus) ctrlSetText localize "STR_spawnSelection_randomTownDescription";
	};
	(_display displayCtrl idc_spawnSelection_spawnStatus) ctrlSetText _getTownStatus;
	if (_getTownStatus isEqualTo (localize "STR_spawnSelection_status_blocked")) then
	{
		(_display displayCtrl idc_spawnSelection_spawn) ctrlEnable false;
	} else
	{
		(_display displayCtrl idc_spawnSelection_spawn) ctrlEnable true;
	};
}];

What are you using for your UI coords? safeZone, pixelGrid or???

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

×