Hello, quick question here.
Does Alive work with the sector control modules? As in, even when the units are virtual.
Thanks!
Hello, quick question here.
Does Alive work with the sector control modules? As in, even when the units are virtual.
Thanks!
No, it would require manual scripting and triggers to bridge the two functionalities.
Alright, thanks for the reply! Im decent with scripting so I will investigate and see if I manage to get it to work.
Apparently it was harder than I first thought =P Alive have some nice snippets on the wiki for detecting the virtual AI but I cant find a way to alter the Sectors by script.
So Instead I thought that I could use a regular marker and simply change it's color, is it possible to get the position, "owner" and possibly size (as in medium, small, tiny, etc) of all the MilObj and CivObj created? or is this info that is unavailable for scripts?
Didn't find anything regarding this among the snippets, is there another place to look?
ALiVE_fnc_getDominantFaction (or something similar to that)
cheers! Managed to find the function and it seems like it will fit perfectly.
Is there any documentation of all the ALiVE_fnc_X methods anywhere? apart from the in game function viewer?
Not really
My mission is now pretty much done, however I have noticed a minor issue with the capturing of sectors.
I use the following code in a trigger condition field:
[getpos tsk2trigger, 100] call ALiVE_fnc_getDominantFaction == "rhs_faction_usarmy_d"
to detect when the players faction has control over the area.
and this in the activate field (with a 30 sec timeout):
"tsk2marker" setMarkerColor "colorBLUFOR"; ["t2", "SUCCEEDED"] call BIS_fnc_taskSetState;
Seems to work fine, but only when there are actual AI units in the area, it wont trigger if the player group enters an area by themselves and clears it out. It seems like ALiVE_fnc_getDominantFaction don't care for players so is there a way to also take eventual players in the area into account?
Try looking into the function definition in the function viewer, I think it was an optional bool for counting real units as well.
I actually had a look since it seemed logical that there would be, but that did not seem to be the case unfortunately. Or am I missing something?
#include <\x\alive\addons\x_lib\script_component.hpp> SCRIPT(getDominantFaction); /* ---------------------------------------------------------------------------- Function: ALiVE_fnc_getDominantFaction Description: Returns the dominant faction within given radius, Takes into account profiles Parameters: Array - Position measuring from Number - Distance being measured (optional) Returns: Number - Faction ConfigName ("BLU_F","OPF_F",etc.) Examples: (begin example) [getposATL player, 500] call ALiVE_fnc_getDominantFaction (end) Author: Highhead ---------------------------------------------------------------------------- */ private ["_pos","_radius","_fac","_facs","_profiles","_result","_noCiv"]; PARAMS_1(_pos); DEFAULT_PARAM(1,_radius,500); DEFAULT_PARAM(2,_noCiv,false); //Virtual Profiles activated? if !(isnil "ALIVE_profileHandler") then { _profiles = [ALIVE_profileHandler, "profiles"] call ALIVE_fnc_hashGet; } else { _profiles = [[],[],[]]; }; _facs = []; { if (((_x select 2 select 5) == "entity") && {!(_x select 2 select 1)} && {!(_x select 2 select 30)} && {(_x select 2 select 2) distance _pos < _radius}) then { _facs pushback (_x select 2 select 29); }; } foreach (_profiles select 2); { if ((_pos distance (getposATL (leader _x)) < _radius) && {{isPlayer _x} count (units _x) < 1}) then { _facs pushback (faction(leader _x)); }; } foreach allgroups; _result = []; { private ["_fac","_cnt"]; if (count _facs == 0) exitwith {}; _fac = _x; _cnt = {_fac == _x} count _facs; if (_cnt > 0) then { _result pushback [_fac,_cnt]; _facs = _facs - [_fac]; }; } foreach _facs; _result = [_result,[],{_x select 1},"DESCEND",{if (_noCiv) then {!(((_x select 0) call ALiVE_fnc_factionSide) == CIVILIAN)} else {true}}] call ALiVE_fnc_SortBy; if ((count _result > 0) && {(_result select 0 select 1) > 0}) then { (_result select 0) select 0; } else {nil};
@Imbazil could you elaborate on your trigger marker system? I've been trying to emulate your results and failing! I'm having a hard time with getting [getpos Trig_1, 100] call ALiVE_fnc_getDominantFaction == "OPF_F"
in a trigger condition to activate it.
Thanks!
I don't see any issue with the actual condition, maybe it's what you have in the activation box that isn't working?
Try to just add a hint in the on activation field and place a trigger far off with only a opfor unit in it. does it fire then? It also seem like it has to be an actual AI unit so you can't try with the player character.
That was weird out of pure frustration i deleted the trigger and made a copy from scratch ... NOW its working...lol typical thanks for the response though!
glad to hear you solved it! =)