banky 4 Posted July 19, 2013 [group,position,distance,area blacklist] call BIS_fnc_taskPatrol Parameters:group- the group to which to assign the waypoints (Group) position - the position on which to base the patrol (Array) distance - the maximum distance between waypoints (Number) area blacklist - (optional) blacklist of areas (Array) It seems it's the distance the waypoints are spawned apart. So unless it's a huge space I want them to wander around in, they always end up leaving the area I want them to cover, even if just for a few minutes. I wonder exactly what the blacklist part does? Share this post Link to post Share on other sites
froggyluv 2136 Posted July 19, 2013 Anyone been able to fix all the Variable Error messages yet ? This really sucks. Every mission that I've built/play has massive amounts of scripts tied in and would be a major pain to unravel out. This is the longest Ive gone without just playing Arma period -5 days :D Share this post Link to post Share on other sites
jgaz-uk 132 Posted July 25, 2013 After ArmA3 Beta regular update 7.4 The UPSMON addon showing errors all the time I opded out of [DEV] as I was fed up of the continual name changes & error bugs spent hours fixing broken missions & now its back to square 1 yet again. Think its back to ArmA 2 for me... Share this post Link to post Share on other sites
1para{god-father} 105 Posted July 25, 2013 (edited) Hmmmm i have 1 error throwing up Evey 10 sec it is below marked with >>>>>THIS LINE>>>>>>>>> undefined Variable in "_x" ( line 337 in INIT_UPSMON.sqf line is if (!isnull _x && alive _x && !captive _x ) then { Tried adding it to the PRIVATE declared but still no joy anyone out there can thrown any light how to Declare it ?! MON_MAIN_server = { private["_x","_obj","_trg","_l","_pos","_countWestSur","_countEastSur","_countResSur","_WestSur","_EastSur","_ResSur","_target","_targets","_targets0","_targets1","_targets2","_npc","_cycle" ,"_arti","_side","_range","_rounds","_area","_maxcadence","_mincadence","_bullet","_fire","_knownpos","_sharedenemy","_enemyside","_timeout"]; _cycle = 10; //Time to do a call to commander _arti = objnull; _side = ""; _range = 0; _rounds = 0; _area = 0; _maxcadence = 0; _mincadence = 0; _bullet = ""; _fire = false; _target = objnull; _knownpos =[0,0,0]; _enemyside = []; _WestSur = KRON_UPS_WEST_SURRENDED; _EastSur = KRON_UPS_EAST_SURRENDED; _ResSur = KRON_UPS_GUER_SURRENDED; //Main loop while {true} do { _countWestSur = round ( KRON_UPS_West_Total * KRON_UPS_WEST_SURRENDER / 100); _countEastSur = round ( KRON_UPS_East_Total * KRON_UPS_EAST_SURRENDER / 100); _countResSur = round ( KRON_UPS_Guer_Total * KRON_UPS_GUER_SURRENDER / 100); //Checks for WEST surrender if (KRON_UPS_WEST_SURRENDER > 0 && !KRON_UPS_WEST_SURRENDED ) then { { if (!alive _x || !canmove _x) then {KRON_AllWest = KRON_AllWest-[_x]}; }foreach KRON_AllWest; if ( count KRON_AllWest <= _countWestSur ) then { KRON_UPS_WEST_SURRENDED = true; publicvariable "KRON_AllWest"; publicvariable "KRON_UPS_WEST_SURRENDED"; }; }; //Checks for EAST surrender if (KRON_UPS_EAST_SURRENDER > 0 && !KRON_UPS_EAST_SURRENDED ) then { { if (!alive _x || !canmove _x) then {KRON_AllEast = KRON_AllEast-[_x]}; }foreach KRON_AllEast; if ( count KRON_AllEast <= _countEastSur ) then { KRON_UPS_EAST_SURRENDED = true; publicvariable "KRON_AllEast"; publicvariable "KRON_UPS_EAST_SURRENDED"; }; }; //Checks for RESISTANCE surrender if (KRON_UPS_GUER_SURRENDER > 0 && !KRON_UPS_GUER_SURRENDED ) then { { if (!alive _x || !canmove _x) then {KRON_AllRes = KRON_AllRes-[_x]}; }foreach KRON_AllRes; if ( count KRON_AllRes <= _countResSur ) then { KRON_UPS_GUER_SURRENDED = true; publicvariable "KRON_AllRes"; publicvariable "KRON_UPS_GUER_SURRENDED"; }; }; //Exec surrended script if (KRON_UPS_WEST_SURRENDED && !_WestSur ) then { _WestSur = true; [west] spawn UPSMON_surrended; }; if (KRON_UPS_EAST_SURRENDED && !_EastSur ) then { _EastSur = true; [east] spawn UPSMON_surrended; }; if (KRON_UPS_GUER_SURRENDED && !_ResSur ) then { _ResSur = true; [Resistance] spawn UPSMON_surrended; }; sleep 0.5; _sharedenemy = 0; _targets0 = []; _targets1 = []; _targets2 = []; { [b][size=3]>>>>>THIS LINE>>>>>>>>>[/size][/b] if (!isnull _x && alive _x && !captive _x ) then { _npc = _x; _targets = []; switch (side _npc) do { //West targets case west: { _sharedenemy = 0; _enemyside = [east]; }; //East targets case east: { _sharedenemy = 1; _enemyside = [west]; }; //Resistance targets case resistance: { _sharedenemy = 2; _enemyside = KRON_UPS_Res_enemy; }; }; if (side _npc in KRON_UPS_Res_enemy) then { _enemyside = _enemyside + [resistance]; }; //Gets known targets on each leader for comunicating enemy position //Has better performance with targetsquery //_targets = _npc nearTargets KRON_UPS_sharedist; _targets = _npc targetsQuery ["","","","",""]; { //_target = _x select 4; //Neartargets _target = _x select 1; //Targetsquery if ( side _target in _enemyside ) then { // if (KRON_UPS_Debug>0) then {player globalchat format["%1: knows about %2, enemies=%3",_npc getVariable ("UPSMON_grpid"),_npc knowsabout _target, _npc countEnemy _targets ]}; if (!isnull _target && alive _target && canmove _target && !captive _target && _npc knowsabout _target > R_knowsAboutEnemy && ( _target iskindof "Land" || _target iskindof "Air" || _target iskindof "Ship" ) && !( _target iskindof "Animal") && ( _target emptyPositions "Gunner" == 0 && _target emptyPositions "Driver" == 0 || (!isnull (gunner _target) && canmove (gunner _target)) || (!isnull (driver _target) && canmove (driver _target))) ) then { //Saves last known position //_knownpos = _x select 0; //Neartargets _knownpos = _x select 4;//Targetsquery _target setvariable ["UPSMON_lastknownpos", _knownpos, false]; // _npc setVariable ["R_knowsAboutTarget", true, false]; // !R call (compile format ["_targets%1 = _targets%1 - [_target]",_sharedenemy]); call (compile format ["_targets%1 = _targets%1 + [_target]",_sharedenemy]); }; }; sleep 0.01; } foreach _targets; }; sleep 0.01; }foreach KRON_NPCs; //Share targets KRON_targets0 = _targets0; KRON_targets1 = _targets1; KRON_targets2 = _targets2; //Target debug console if (KRON_UPS_Debug>0) then {hintsilent parseText format["%1<br/>--------------------------<br/><t color='#33CC00'>West(A=%2 C=%3 T=%4)</t><br/><t color='#FF0000'>East(A=%5 C=%6 T=%7)</t><br/><t color='#00CCFF'>Res(A=%8 C=%9 T=%10)</t><br/>" ,UPSMON_Version ,KRON_UPS_West_Total, count KRON_AllWest, count KRON_targets0 ,KRON_UPS_East_Total, count KRON_AllEast, count KRON_targets1 ,KRON_UPS_Guer_Total, count KRON_AllRes, count KRON_targets2 ]}; sleep 0.5; //Artillery module control { _arti = _x select 0; _rounds = _x select 1; _range = _x select 2; _area = _x select 3; _maxcadence = _x select 4; _mincadence = _x select 5; _bullet = _x select 6; _salvobreak = _x select 7; if (isnil{_arti getVariable ("timeout")}) then { _arti setVariable ["timeout", time, false]; sleep 0.1; }; _timeout = _arti getVariable ("timeout"); if (!isnull (gunner _arti) && canmove (gunner _arti) && (time >= _timeout)) then { _side = side gunner _arti; _fire = call (compile format ["KRON_UPS_ARTILLERY_%1_FIRE",_side]); //If fire enabled gets a known target pos for doing fire if no friendly squads near. if (_fire) then { _target = call (compile format ["KRON_UPS_ARTILLERY_%1_TARGET",_side]); if (isnil "_target" ) then {_target = objnull;}; switch (_side) do { //West targets case west: { _targets = KRON_targets0; }; //East targets case east: { _targets = KRON_targets1; }; //Resistance targets case resistance: { _targets = KRON_targets2; }; }; //Check if has a target if (!(_target in _targets ) || isnull _target || !alive _target) then { _target = objnull; { _auxtarget = _x; _targetPos = _auxtarget getvariable ("UPSMON_lastknownpos"); if (!isnil "_targetPos") then { //If target in range check no friendly squad near if (alive _auxtarget && !(_auxtarget iskindof "Air") && (round([position _arti,_targetPos] call KRON_distancePosSqr)) <= _range) then { _target = _auxtarget; //Must check if no friendly squad near fire position { if (!isnull _x && _side == side _x) then { if ((round([position _x,_targetPos] call KRON_distancePosSqr)) < (KRON_UPS_safedist * 0.7)) exitwith {_target = objnull;}; }; } foreach KRON_NPCs; }; }; //If target found exit if (!isnull _target) exitwith {}; } foreach _targets; }; //If target fires artillery if (!isnull _target) then { //Fix current target call (compile format ["KRON_UPS_ARTILLERY_%1_TARGET = _target",_side]); _targetPos = _target getvariable ("UPSMON_lastknownpos"); if (!isnil "_targetPos") then { _arti removeAllEventHandlers "fired"; sleep 0.01; // chatch the bullet in the air and delete it _arti addeventhandler["fired", {deletevehicle (nearestobject[_this select 0, _this select 4])}]; [_arti,_targetPos,_rounds,_area,_maxcadence,_mincadence,_bullet,_salvobreak] spawn MON_artillery_dofire; }; }; }; }; sleep 0.5; } foreach KRON_UPS_ARTILLERY_UNITS; // if (KRON_UPS_Debug>0) then {player globalchat format["Init_upsmon artillery=%1",count KRON_UPS_ARTILLERY_UNITS]}; sleep _cycle; }; }; }; Edited July 25, 2013 by 1PARA{God-Father} Share this post Link to post Share on other sites
SavageCDN 231 Posted July 25, 2013 After ArmA3 Beta regular update 7.4 The UPSMON addon showing errors all the time I opded out of [DEV] as I was fed up of the continual name changes & error bugs spent hours fixing broken missions & now its back to square 1 yet again. Think its back to ArmA 2 for me... Yeah I did the same back to stable. I understand why they've enabled show errors by default but really there should be a way to turn it off. Share this post Link to post Share on other sites
galzohar 31 Posted July 25, 2013 The new patch made a lot of previously hidden errors visible. This is actually a good thing, as we can now actually fix those errors instead of having mysterious bugs that we'll never find. I've already fixed some bugs in my missions that I previously had no chance of pinpointing due to the new error reporting. Basically, if you see an error, it is indeed an error and thus a potential bug in functionality. Share this post Link to post Share on other sites
holo89 10 Posted July 25, 2013 (edited) Hmmmm i have 1 error throwing up Evey 10 sec it is below marked with >>>>>THIS LINE>>>>>>>>> undefined Variable in "_x" ( line 337 in INIT_UPSMON.sqfline is if (!isnull _x && alive _x && !captive _x ) then { Tried adding it to the PRIVATE declared but still no joy anyone out there can thrown any light how to Declare it ?! try the lazy compare if (!isnull _x && {alive _x && !captive _x }) then { which will not evaluate the rest if it is nil. otherwise it will evaluate everything. not like in some other programming language... Edited July 25, 2013 by holo89 Share this post Link to post Share on other sites
jgaz-uk 132 Posted July 25, 2013 (edited) Yeah I did the same back to stable. I understand why they've enabled show errors by default but really there should be a way to turn it off. Yes I can see it can be needed in [DEV] BUT for when people just want to play ArmA3 why on earth put it in Stable, it's a real turn-off. Any chance of an update taking it out again or at least the option to disable it please... Galzohar missions that were playing perfectly, smooth as silk on a Dedicated server are now (after 7.4 )update unplayable & that's progress??! ArmA3 is excellent! I would just like to be able to spend an evening playing it now & then. Edited July 25, 2013 by jgaz-uk dyslexia Share this post Link to post Share on other sites
clydefrog 3 Posted July 25, 2013 Yes I can see it can be needed in [DEV] BUT for when people just want to play ArmA3 why on earth put in in Stable, it's a real turn-off. Any chance of an update taking it out again ot at least the option to disable it please... That's something I (and BIS too probably) didn't even think of. The whole Arma 3 userbase aren't mission editors. Some people just like to play the game and I doubt they want to be spammed by black boxes full of unintelligible text that means nothing to them and just ruins their enjoyment of the game. Forcing this on people who have no interest in the editing side of the game just seems stupid. Share this post Link to post Share on other sites
r.flagg 11 Posted July 26, 2013 That's something I (and BIS too probably) didn't even think of. The whole Arma 3 userbase aren't mission editors. Some people just like to play the game and I doubt they want to be spammed by black boxes full of unintelligible text that means nothing to them and just ruins their enjoyment of the game. Forcing this on people who have no interest in the editing side of the game just seems stupid. Amen. Share this post Link to post Share on other sites
jgaz-uk 132 Posted July 26, 2013 Re UPSMON FOR ARMA3; Its one of the best tools there has been for ArmA2 & ArmA3 mission making, it takes the game up another level, giving the AI almost human levels of tactics, inteligence, & more importantly unpredictability. Without it the AI tend to behave in almost the same way each time you play a mission, becoming too predictable. Which reduces the shelf life of missions considerably. I wonder if Monsada or Kronzky (anyone!) could fix the UPSMON for ArmA3......listening out.. Share this post Link to post Share on other sites
gvse 10 Posted July 26, 2013 Ups by Kronzky actually works without any errors (look for it in the custom missions section of this forum). Upsmon has more bells and whistles so I hope someone knowledgeable can get it to work again. Share this post Link to post Share on other sites
dale0404 5 Posted July 26, 2013 http://forums.bistudio.com/showthread.php?147904-Urban-Patrol-Script/page7 Share this post Link to post Share on other sites
jgaz-uk 132 Posted July 26, 2013 (edited) Ups by Kronzky actually works without any errors (look for it in the custom missions section of this forum). Upsmon has more bells and whistles so I hope someone knowledgeable can get it to work again. Thanks for that, think I'll hang fire for a bit see if there is a fix, its the bells & whistles that I like PS BIS just need to remove the "show script errors" from A3 regular (thay aint doing themselves or players any favours including it) as all the UPSMON stuff still works fine. Edited July 26, 2013 by jgaz-uk Share this post Link to post Share on other sites
jgaz-uk 132 Posted July 27, 2013 Ups by Kronzky actually works without any errors (look for it in the custom missions section of this forum). Upsmon has more bells and whistles so I hope someone knowledgeable can get it to work again. Decided to take your advice & use standard UPS with a new mission, had to change a small amount of script as in that linked posted. Runs with no UPS errors showing but they seem stuck in combat mode. listening out for a UPSMon fix before I edit any previous A3 missions. Share this post Link to post Share on other sites
gvse 10 Posted July 27, 2013 you are right. this is perhaps something that should be reported to Kronzky in his thread. Try and use the "noslow" parameter and it might help a bit. I also recommend using: 1. the native command fnc_taskPatrol it really works and is even easier to set up cause you dont even designate the area with a marker. 2. sites module to populate bases and set up checkpoints super fast. In my experience these two give you a quick and easy way to populate the game world. With upsmon I would often use a detect trigger to set up reinforcements but you can do that with trigger and a seek and destroy waypoint. Share this post Link to post Share on other sites
banky 4 Posted July 27, 2013 I've actually begun using the CBA functions in place of UPSMON and it works pretty well. You can specify a certain patrol area, speed, behavior, and so on with cba_fnc_taskpatrol and they will take positions inside buildings with cba_fnc_taskdefend (which was the main feature of UPSMON that I was missing). Share this post Link to post Share on other sites
jgaz-uk 132 Posted July 28, 2013 I've actually begun using the CBA functions in place of UPSMON and it works pretty well. You can specify a certain patrol area, speed, behavior, and so on with cba_fnc_taskpatrol and they will take positions inside buildings with cba_fnc_taskdefend (which was the main feature of UPSMON that I was missing). How do you use the CBA functions not see that??? ------------------------------------------------------- It's weird in the UPS test mission supplied with the addon they walk around on patrol normally, put ups in a mission & they are as twitchy as anything & combat mode all the time. Re the "[group this, getPos this, number] call BIS_fnc_taskPatrol;" works fine but how do you get them to stay in an area? Share this post Link to post Share on other sites
gvse 10 Posted July 29, 2013 1. CBA explained here 2. ups: yes, they go immediately to combat mode. I guess the script needs an update. 3. bis_fnc: it is my understanding that if you put an actual number in the "number" part you should limit their range in relation to the place where you put them in the editor (which is recognized via "getPos this"). Try "[group this, getPos this, 40] call BIS_fnc_taskPatrol;" and they should not stray too far. Share this post Link to post Share on other sites
jgaz-uk 132 Posted July 29, 2013 1. CBA explained here2. ups: yes, they go immediately to combat mode. I guess the script needs an update. 3. bis_fnc: it is my understanding that if you put an actual number in the "number" part you should limit their range in relation to the place where you put them in the editor (which is recognized via "getPos this"). Try "[group this, getPos this, 40] call BIS_fnc_taskPatrol;" and they should not stray too far. Decided to use the default Bis patrol scripts & waypoints until there is a UPS fix. Also; Used a group way point with the UPS activation in it, with a trigger condition, that way they stand around looking at their feet & picking their noses until the trigger activates, then its UPS combat mode. Ironic that the UPSMON works fine but is unusable because of the "show script errors" Bis put in.:( PS Am finding the CBA patrol scripting a bit of a struggle :o would there be an example mission to unpbo? Share this post Link to post Share on other sites
gvse 10 Posted July 29, 2013 Example of working CBA patrol script (placed in a unit's init): [this, this, 100, 4, "MOVE", "SAFE"] call CBA_fnc_taskPatrol; and defend [this, this, 50, 2, true] call CBA_fnc_taskDefend;. Check that site I linked to for explanations of what each parameter defines. Share this post Link to post Share on other sites
jgaz-uk 132 Posted July 29, 2013 Thanks for that sir :bounce3: I used the example provided in the site link & it threw up errors? Will give yours a try.... Gaz out. Share this post Link to post Share on other sites
gvse 10 Posted July 29, 2013 Yeah, happened to me too, and so I had to eliminate the part throwing errors. I especially recommend theCBA taskdefend command as this will get the AI to patrol inside houses. Sadly lots of houses are bugged and you will see AI falling though walls of some buildings. Try and mix this with tpw LOS addon for greater AI responsiveness. Good luck! Share this post Link to post Share on other sites
daskunk 1 Posted July 30, 2013 A good place to start fixing it would be to maybe ask BIS how they broke it ? Share this post Link to post Share on other sites
clydefrog 3 Posted July 30, 2013 (edited) BIS_fnc_taskPatrol has always had that problem for me, they walk off for miles, even into the sea sometimes, it's useless. Also BIS_fnc_taskDefend always gives an error message when it's called from that actual BI script containing the function, not the script where it's executed. CBA Task Patrol is great, it works well and it has a lot of options you can set, but it means running an addon just for a few patrols. Here is a simple script for spawning a group with CBA TaskPatrol for anybody having trouble with it (these are 3rd party arma 2 units though, you'll need to change them to arma 3): // 0 = ["spawnmarker"] execVM "spawnUnitspatrol.sqf" if (!isServer) exitWith {}; _spawnPos = markerPos (_this select 0); _group1 = createGroup EAST; _unit1 = _group1 createUnit ["RW_MVD_Soldier_TL", [_spawnPos select 0,_spawnPos select 1,1], [], 1, "FORM"]; sleep 0.2; _unit2 = _group1 createUnit ["RW_MVD_Soldier", [_spawnPos select 0,_spawnPos select 1,1], [], 1, "FORM"]; sleep 0.2; _unit3 = _group1 createUnit ["RW_MVD_Soldier_Marksman", [_spawnPos select 0,_spawnPos select 1,1], [], 1, "FORM"]; sleep 0.2; _unit4 = _group1 createUnit ["RW_MVD_Soldier", [_spawnPos select 0,_spawnPos select 1,1], [], 1, "FORM"]; sleep 0.2; _unit5 = _group1 createUnit ["RW_MVD_Soldier", [_spawnPos select 0,_spawnPos select 1,1], [], 1, "FORM"]; sleep 0.2; _unit6 = _group1 createUnit ["RW_MVD_Soldier", [_spawnPos select 0,_spawnPos select 1,1], [], 1, "FORM"]; sleep 0.2; [_group1, _spawnPos, 150, 7, "MOVE", "AWARE", "YELLOW", "LIMITED", "WEDGE", "", [3,6,9]] call CBA_fnc_taskPatrol; Edited July 30, 2013 by clydefrog Share this post Link to post Share on other sites