-
Notifications
You must be signed in to change notification settings - Fork 1
Mark Buildings
This page will explain the usage of the Mark Buildings function.
/*
* Author: Mike
* Creates map markers for building outlines with an optional filter for only objects that inherit from buildings.
* Function should not be ran at any point after mission start.
* This is mainly designed around houses and custom structures being marked on the map, if using a layer ensure only buildings or walls are inside it.
*
* Call from initServer.sqf on mission start.
*
* Arguments:
* 0: Objects <ARRAY>
* 1: Filter to only buildings <BOOL> (default: true)
*
* Return Value:
* None
*
* Examples:
* [[MyObject, MyObject2]] call MFUNC(markBuildings);
* [(getMissionLayerEntities "Test Layer" select 0)] call MFUNC(markBuildings);
*/
The mark buildings function will create a map marker that cannot be edited exactly on the position and direction of any buildings you run it for, for all intents and purposes most people will see it as a map object.
The function does have its limits, i.e curved objects will still show as blocks, hence why it's better to only run this function on buildings and walls.
This function should only ever be called from the server.
It is significantly easier to run this using layers. (see alternate example, replace the "Test Layer" with whatever you named your layer.), when creating this layer try and ensure only buildings and walls are inside of it, even if using the filter argument it will not filter out many objects as most things inherit from Building
(including things like fire barrels)
If at any point the markers created would need to be deleted, you can run this on the server to do so. (Note, this is a nuclear option, it will delete ALL markers created by this function.)
{
private _string = _x select [0, 12];
if ((toLower _string) isEqualTo "tac_mission_") then {
deleteMarker _x;
};
} forEach allMapMarkers;
Example:
[[MyObject, MyObject2]] call MFUNC(markBuildings);
Alternate Example:
[(getMissionLayerEntities "Test Layer" select 0)] call MFUNC(markBuildings);
Pages
- Home
- Your First Mission
- Creating A Mission
- Contract Missions
- Difficulty Guidelines
-
Functions Library
- Base Spectator
- Bomber
- Car Alarm
- Chemical Detector
- Collect Intel
- Connect Battery To Defusable
- Contamination Gas
- Count Alive
- Dialogue
- Disable AI
- Download Intel
- Earthquake
- Enable AI
- Force Shooting
- Ground Fog
- Hunt
- Lock Doors
- Mark Buildings
- Monitor Units
- Mortar Strike
- Ping
- Players
- Reaction
- Reinforcements
- Reinforcement Waves
- Respirator Effects
- Set Sleeping
- Sound Source
- Surrender
- Switch Action
- Teleport
- Toggle Lights
- Trigger Area
- Helicopters
- Resources
- Quality Checklist
- Useful Commands
- ArmaQDL