Jump to content
Sign in to follow this  
delta99

Center player map on first use

Recommended Posts

Hi all,

Is there anyway to recenter the players map on initial use? What I am trying to do is have the map NOT center on the players current position when they first open it. Right now, no matter if you are on Veteran/Expert the map is centered on your current location when it is first opened. I would prefer to have it centered on the exact center of the map or worse case scenario at 0,0 or something like that. Anything that would prevent revealing where the player is at start.

This is for orienteering missions where the player is randomly placed at mission start anywhere on the map.

I've tried a few things like:

  1. Removing the map from the player and adding it to their inventory again. Doesn't work, still centered on their location on first use.
  2. Removing the map from the player at start and having them get one from an ammobox. Doesn't work. No matter what the map centers on their location the first time it is opened.
  3. Messed around trying to figure out some of the mapAnimation calls but can't seem to get any of those to fire at all.

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Maybe this or something similar? Might also check out the ACR functions. There's a handful of new map functions in that DLC.

Share this post


Link to post
Share on other sites
Maybe this or something similar? Might also check out the ACR functions. There's a handful of new map functions in that DLC.

That just converts coordinates from say where you click on the map to the actual world coordinate position but has nothing to do with moving the map or setting the position of the map itself.

I will check out the ACR commands again but going through them I don't recall seeing anything that looked like it might be useful.

I am pretty sure it is in the map animations commands if only I could find an example of how to get them to work. I am sure everyone has seen this type of thing in operation when you click on a clickable text word in a task description or something and the map zooms to that location on the map. I just need to do this once by script at mission start.

Share this post


Link to post
Share on other sites
Maybe this or something similar? Might also check out the ACR functions. There's a handful of new map functions in that DLC.

kylania, I did find a function in the ACR functions in modules_ACR\Functions\GUI\fn_centerMap.sqf

However, the script kept failing on a finddisplay call which I think is trying to determine the map display. The error in the RPT file is:

Error in expression <#define MAP	((finddisplay 37) displayCtr>
 Error position: <#define MAP	((finddisplay 37) displayCtr>
 Error Invalid number in expression

Actual code from their code:

#define MAP	((finddisplay 37) displayCtrl 51)

I decided to change the code to look like this just to make sure it wasn't something odd with a #define:

_MAP = ((finddisplay 37) displayCtrl 51);

Outputing the value of _MAP in the RPT it shows that _MAP has a value off "no control" or that it is not set to a control value or something.

This leads me to believe that the hardcoded values for display 37 or 51 are incorrect.

Anyway, I think I have abandoned trying to get any of that to work and instead am going to have a method to randomly spawn a player when they select an action to start the mission or something. Even if I randomly spawn them via script in init.sql the map on first use will show their location.

Share this post


Link to post
Share on other sites

Im not being funny but with orienteering you know where you start. Your objective is to find your way to the next flag from your current location the fastest way

Share this post


Link to post
Share on other sites
Check (the source of) this: http://www.armaholic.com/page.php?id=12854

Thanks PvPScene, I will take a look at that.

---------- Post added at 13:16 ---------- Previous post was at 13:13 ----------

Im not being funny but with orienteering you know where you start. Your objective is to find your way to the next flag from your current location the fastest way

Yes, that is how I was doing it in my first proof of concept however I thought it would be more interesting to also attempt to determine your starting location. Adds just that little bit more of uncertainty.

Plus, I think for a military type exercise and more in the realm of land navigation one doesn't necessarily know their starting position.

Share this post


Link to post
Share on other sites

I finally figured it out.

 

description.ext:

showMap = 0;

initPlayerLocal.sqf:

waitUntil {time > 0.01};
showMap true;
openMap [true, true];
mapAnimAdd [0, 1, [0, 0]];
mapAnimCommit;
sleep 0.1;
openMap [false, false];

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  

×