Page MenuHomeFeedback Tracker

Have the engine create a location or marker at the center of the map [feature request]
Closed, ResolvedPublic

Description

Certain missions require that a center point of the map is defined and use this to randomly place or select locations from this point. This is especially the case with missions with dynamic content like for example Insurgency or Domination. But other scenarios with dynamic contenct may have its uses.

The advantage of this approach is that the scenario will always know where the center of the map is and can go on from there. However, this does require intervention of the mission editor on their part to reposition the center with every new map they wish to use for their dynamic missions.

If you take for example Dynamic Zombie Sandbox (DZS) for A2, this works on every map that has sufficient Locations. But this isn't the case on all the maps, for example Stratis doesn't have the Locations you would see in Chernarus, Takistan or Utes. How DZS does this is simply by having a script generate the objectives, place the players and populate the towns. And this can be done on every map just by simply renaming the island name of the pbo to a new island (for example: dzs.chernarus.pbo -> dzs.utes.pbo). I would like to do this with my dynamic missions so I have lots of re-playability without having to do tons of stuff over and over.

So next to my request to add lots of Locations in future maps. I would like to request a marker or a Location with the center of the map generated by the engine instead of requiring the mission editor/scripter to manually guestimate and place it.

Details

Legacy ID
1559744611
Severity
None
Resolution
Not A Bug
Reproducibility
Have Not Tried
Category
Scripting
Steps To Reproduce

not applicable

Additional Information

not applicable

Event Timeline

Ligthert edited Steps To Reproduce. (Show Details)Jun 5 2013, 2:30 PM
Ligthert edited Additional Information. (Show Details)
Ligthert set Category to Scripting.
Ligthert set Reproducibility to Have Not Tried.
Ligthert set Severity to None.
Ligthert set Resolution to Not A Bug.
Ligthert set Legacy ID to 1559744611.May 7 2016, 2:25 PM

There's a config entry for every world called "centerPosition" that can be used to determine the center of the map, e.g.:

hint getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");

_arr = getArray (configFile >> "CfgWorlds" >> worldName >> "centerPosition");
player setPosASLW [(_arr select 0), (_arr select 1), 0];

This gives the position far from the center of the world (stratis).

configfile >> "CfgWorlds" >> worldName >> "mapSize" seems to be a private variable. :-(

you mean

getNumber (configfile >> "CfgWorlds" >> worldName >> "mapSize")

I just closed of ArmA 3. I'll give it a shot tomorrow. :)

_half = getNumber (configfile >> "CfgWorlds" >> worldName >> "mapSize") / 2;
_centerPos = [_half, _half, 0];
player setPosATL _centerPos;

puts player exactly in the middle of the map (not middle of island this is why you have editor)

Thanks! This worked for me! :-)

But (configFile >> "CfgWorlds" >> worldName >> "centerPosition") should still be fixed iyam. :)

An update from the Skype map maker channel:

[5:32:32 AM] [BISim UK] Paul Pelosi: just checked the vbs2 knowledgethingy...
"centerposition" is definitely the editor startup focus position in vbs -
guessing it's the same with Arma

Obviously there is a way how to find the center of the map. Resolved as no change required.

Mass-closing resolved issues not updated in 10 days.