Jump to content
Sign in to follow this  
RoryRothon

Get objectID of players Map (MP)

Recommended Posts

Is it at all possible to get the objectID of a players map from their inventory?
We are wanting to save array of markers to the map object so that each map has a different set of markers that are user created.
Any help or a point in the right direction would be greatly appreciated...

Kind regards
Rory

Share this post


Link to post
Share on other sites

Just to expand a little:

 

Scenario:

Player 1 marks their map

Markers are saved to that map only.

User then places map on the ground and player 2 picks map up.

Player 2 now sees the markers saved to player one's map.

Player 1 picks up player two's map and only see'e markers created by player two.

 

Rather than saving markers locally, we would like to be able to save markers to individual maps.
You can only see markers created by another player by picking up their map....

Share this post


Link to post
Share on other sites

This is over in the more advanced scripting arena. I don't believe there is any such object id for the map item. Simply put you just have a generic map item in your inventory, no id, all maps are the same. So one basic approach would be to: whenever a player drops a map,

 

1. Store all marker info on the dropped container (even if you drop something on the ground a new "container" is made)

2. Remove all markers from the players "map screen"

 

Then when someone takes from the container, you check if they take a map, if so:

 

1. Add all the markers to the takers "map screen"

2. Remove the data from the previous container

 

Even then, this is not foolproof. Now the latter player have two maps. What happens when he drops one of them? Then the second one? Which is his real map? Because, AFAIK the lack of object ids this gets you into trouble. But the approach can work decently, it is the basic outline for how ACE detonators are implemented.

 

First you should familiarize with the map commands, particularly, allMapMarkers and deleteMarkerLocal. Then you might want to check how ACE does it: https://github.com/acemod/ACE3/blob/master/addons/explosives/functions/fnc_onInventoryChanged.sqf

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  

×