Get Hidden Map Area
-
Is there a way to get the hidden area information on maps that have areas blacked out? I'd like to prevent certain units from spawning where players cannot reach on maps with hidden areas.
-
@Rama
Hey Rama,
It is possible to get the Information of the Hidden Area outside the Map
Uveso has Show me an Way how to do that.
I primary use it for several Spawn Mechanics of callable Reinforcements and the Airstrikes which are included in my Commander Survival Kit.
So maybe it could help you for what you want.
But you will probably need to modify the Code for your purposes.GetPlayableArea:
This Function checks for the existence of an playable rectangle (area) on the map.
If one exists it returns the playable rectangle (area)
If not it simple returns the size of the mapGetNearestPlayablePoint
This Function checks whether the given unit position is outside the playable rechtangle (area)..
If the Unit is located outside the Map it returns a new generated Vector inside the Playable Area
If Not it doesn't return anything.
The included Check for ScenarioInfo.type == 'skirmish' is optional
So If you want to use the Code for specific Game Modes only you can use the Check.
For example: Campaign, Skirmish or anything else.If you have any additional Questions related to this.
I still have Contact with Uveso on Discord to pass them on to him.GetPlayableArea = function() if ScenarioInfo.MapData.PlayableRect then return ScenarioInfo.MapData.PlayableRect end return {0, 0, ScenarioInfo.size[1], ScenarioInfo.size[2]} end, GetNearestPlayablePoint = function(self,position) local px, _, pz = unpack(position) if ScenarioInfo.type == 'skirmish' then local playableArea = self.GetPlayableArea() -- keep track whether the point is actually outside the map local isOutside = false if px < playableArea[1] then isOutside = true px = playableArea[1] + 1 elseif px > playableArea[3] then isOutside = true px = playableArea[3] - 1 end if pz < playableArea[2] then isOutside = true pz = playableArea[2] + 1 elseif pz > playableArea[4] then isOutside = true pz = playableArea[4] - 1 end -- if it really is outside the map then we allocate a new vector if isOutside then return { px, GetTerrainHeight(px, pz), pz } end end end,
Best regards
CDRMV