• 0
stefan.kueneth

Enable AI markers on map for debug

Question

6 answers to this question

Advertisement
  • 0

Yes, you can, when it spawns a unit, there are coordinates present.  Use those and create marker.  However, this will ONLY place a marker where they were spawned and will NOT 'move with the unit' and will NOT remove it on the 'death' of the unit.  InfiSTAR's will.

As this is not an ARMA scripting forum,  I would advise you to look for 'how to' on those forums which are designed for such.

I will give you a 'push in the right direction' with a script that I use for my SP plays.

Spoiler

private["_markers","_members"];
_markers = [];
_members = [];

while {true} do {
    sleep 0.5;
    if(visibleMap) then {
        _members = units (group player);
        //Create markers
        {
            _marker = createMarkerLocal [format["%1_marker",_x],visiblePosition _x];
            _marker setMarkerColorLocal "ColorBlue";
            _marker setMarkerTypeLocal "hd_arrow";
            _marker setMarkerTextLocal format["%1", _x getVariable["realname",name _x]];
            _marker setMarkerDirLocal (direction _x);
        
            _markers pushBack [_marker,_x];
            
        } foreach _members;
            
        while {visibleMap} do {
            {
                private["_marker","_unit"];
                _marker = _x select 0;
                _unit = _x select 1;
                if(!isNil "_unit") then {
                    if(!isNull _unit) then {
                        _marker setMarkerPosLocal (visiblePosition _unit);
                    };
                };
            } foreach _markers;
            if(!visibleMap) exitWith {};
            sleep 0.02;
        };

        {deleteMarkerLocal (_x select 0);} foreach _markers;
        _markers = [];
        _members = [];
    };
};

 

The above will NOT work 'as is' for Exile.  It CAN be 'modified' for it though.  You're on your own!

 

:)

Edited by Z80CPU

Share this post


Link to post
Share on other sites
  • 0

Found following script somewhere  here

add eye.sqf into your mission

Quote

/*
EYE 1.0
Author: Zapat
Shows all units on map in a relatively system friendly way.

Dot: infantry
Rectangle: ground vehicles
Triangle: air vehicles

Blue: west
Red: east
Green: Independent
Black: civilian OR damaged in movement thus left vehicle

Orange: player
Yellow: player's team

*/

//you can turn on and off the EYE by the following Global Variable 
EYE_run = true;
player sideChat "EYE is running";
EYE_targets_obj = [];
EYE_markers_str = [];

//data handler
[] spawn 
{
    while {EYE_run} do
    {
        sleep 2;
        EYE_targets_obj = position player nearEntities [["LandVehicle","Air","CAManBase"], 20000];
        EYE_targets_str = [];
        {
            EYE_targets_str set [count EYE_targets_str, format["%1",_x]];
        }foreach EYE_targets_obj;
        _deleted = EYE_markers_str - EYE_targets_str;
        {
            deleteMarker _x;
            EYE_markers_str = EYE_markers_str - [_x];
        }foreach _deleted;
    };
    player sideChat "EYE thread 1 finished" ;
};

//visualiser
[] spawn
{
    while {EYE_run} do
    {
        sleep 0.5;
        {
            if (!isNull _x) then
            {
                _marker = format["%1",_x];
                //create marker
                if (getMarkerType _marker == "") then
                {
                    _m = createMarkerLocal[_marker,position _x];
                    _m setMarkerShape "ICON";
                    if (_x isKindof "CAManBase") then {_m setMarkerTypeLocal "hd_dot";};
                    if (_x isKindof "LandVehicle") then {_m setMarkerTypeLocal "mil_box";};                    
                    if (_x isKindof "Air") then {_m setMarkerTypeLocal "mil_triangle";};
                    if (side _x == east) then {_m setMarkerColor "ColorOPFOR";};
                    if (side _x == west) then {_m setMarkerColor "ColorBLUFOR";};
                    if (side _x == Independent) then {_m setMarkerColor "ColorIndependent";};
           //if (side _x == Civilian) then {_m setMarkerColor "ColorCivilian";};
                    if (_x in units group player) then {_m setMarkerColor "ColorYellow";};
                    if (_x == player) then {_m setMarkerColor "ColorOrange";};
                    EYE_markers_str set [count EYE_markers_str, _marker];
                }
                //update marker
                else
                {
                    _marker setMarkerPosLocal position _x;
                    if (getMarkerColor _marker != "ColorBlack" && (!alive _x || !canMove _x) ) then {_marker setMarkerColor "ColorBlack"};
                };
            };
        }foreach EYE_targets_obj;
    };


    {
        deleteMarkerLocal _x;
    }foreach EYE_markers_str;
    player sideChat "EYE thread 2 finished" ;
};
 

Call file from initPlayerLocal.sql : add following at the end of the file. 

Quote

execVM "eye.sqf";

 

Edited by hasable

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.