-
Content Count
12 -
Joined
-
Last visited
-
Medals
-
[help]Remove enemy units from an array of units
deadactionman replied to Doggifast's topic in ARMA 3 - MISSION EDITING & SCRIPTING
pushback just adds _x to another array. _men = all the nearby men, then forEach goes through each one (_x each time), checks to see if it matches the criteria and then adds THAT unit to the new array. -
[help]Remove enemy units from an array of units
deadactionman replied to Doggifast's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Something like this might help... private ["_radius", "_men","_opfor_men", "_blufor_men", "_ind_men"]; _radius = 25; _opfor_men = []; _blufor_men = []; _ind_men = []; _men = (ASLToAGL getPos player) nearEntities [["Man"], _radius]; { if (side _x == opfor) then {_opfor_men pushBack _x;}; if (side _x == blufor) then {_blufor_men pushBack _x;}; if (side _x == independent) then {_ind_men pushBack _x;}; } forEach _men; hint format["OPFOR List=%1\nBLUFOR List=%2\nIND List=%3", _opfor_men, _blufor_men, _ind_men]; In the above example, I made myself a captive which turned me into a CIVILIAN. private ["_radius", "_nearbyPlayers"]; _radius = 25; _nearbyPlayers = []; { if (side _x == blufor && _x distance player < _radius) then {_nearbyPlayers pushBack _x;}; } forEach AllPlayers; hint format["Nearby Players=%1",_nearbyPlayers]; The above version only returns nearby players within _radius using the AllPlayers (see switchableUnits too) -
Map and Shift+Left Click
deadactionman replied to deadactionman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Looks like I'll have to do something else instead then. Maybe a text overlay/resource with distance and bearing to target? Not as good as an on screen marker but it'll have to do... for now. I always seem to use typeOf and isKindOf in the wrong place... thanks for noticing :) -
Map and Shift+Left Click
deadactionman replied to deadactionman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks XxAnimusxX. I've got the code to do it, but the problem is when you Shift+Left Click you're not actually placing a WP, it's something else. This code is work in progress, but you can see what I'm trying to do. I'm calling DAM_GPS_coPilot with onMapSingleClick "[_pos, _shift, _alt] call DAM_GPS_coPilot;"; DAM_GPS_coPilot = { private ["_vehicle", "_inVehicle", "_pilot", "_isPilot","_pos", "_shift", "_alt", "_wp", "_mesage", "_nearestLocation", "_nearestLocationName", "_group"]; _pos = _this select 0; _shift = _this select 1; _alt = _this select 2; _nearestLocation = (nearestLocations [_pos,["NameCityCapital","NameCity","NameVillage"],5000]) select 0; _nearestLocationName = text _nearestLocation; _coPilot = player; // Whoever is calling the script _vehicle = vehicle _coPilot; // What vehicle? _inVehicle = typeOf _vehicle == "Air"; // Is it an air unit? _pilot = driver _vehicle; // Get the pilot _isPilot = _coPilot == _pilot; // Is the coPilot the driver? _group = group _pilot; if (_shift && _alt && _inVehicle && !_isPilot) then { // Delete existing waypoint(s) // deleteWaypoint [_group, all]; // dunno if this works while {(count (waypoints _group)) > 0} do { deleteWaypoint ((waypoints _group) select 0); }; _wp = _group addWaypoint [[_pos select 0, _pos select 1], 0]; // add a waypoint _wp setWaypointType "MOVE"; _message = format["A new waypoint has been set near %1 by %2", _nearestLocationName, _coPilot]; { //[nil_or_caller, nil_or_target_object,"loc", script_to_execute, par0, par1...] call RE; [nil, _x, rTITLETEXT, _message, "PLAIN DOWN", 0] call RE; } forEach crew _vehicle; }; }; Still playing around with the RE bit, but this was supposed to run in veteran mode so WPs wouldn't show anyway. The above creates Waypoints, but what's really confusing me is that the Shift+Left Click thing doesn't appear to be an actual Waypoint. -
Arma 2 - Flag texture mod
deadactionman replied to redoper's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
Place a "Flagpole" object in the editor and in its init field, add the command this setFlagTexture "yourpicture.jpg" You should use the TextView2 tool from BIS and save as a PAA file, but JPGs work ok -
Map and Shift+Left Click
deadactionman posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello, I was hoping to write a script that would allow the occupants of a vehicle to set a marker/WP on the map, (using the Shift+Left Click) and have it set a Waypoint on the map for the pilot/driver as well. What I've found is that when you Shift+Left click on the map, although it appears as an on-screen WP-type-thing, it's not actually a waypoint. I tested this with a loop that counts the number of WPs for a given unit and when you place a Shift+Left click "thing", it doesn't change the WP count... in short, it's not a WP. To test, place a unit with no waypoints and put this in the init... null = [] spawn {while {alive player} do {hint format["Waypoint Count=%1",(count waypoints (group player))];sleep 1;};} Shift+Left click and a marker appears (green for me) but the WP count doesn't move. Then go back to the editor and give the unit a few waypoints and try again. The above loop is counting the WPs, but again, the Shift+Left Click thing doesn't alter the count. Is there anyway to set a Shift+Left click marker/WP thing from a script? It's not a WP and it's not a marker, so what else is there? Any help would be appreciated. Cheers, DAM -
Ambient Combat Module
deadactionman replied to mechastalin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I use the -showScriptErrors option and no errors where reported. It just didn't want to spawn any units. I'll try changing the order of the functions and adjust the wait time to try and find out the point at which it stops working. At least I've got a good starting point now :) Thanks again for your help. -
Ambient Combat Module
deadactionman replied to mechastalin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Thanks BlackAlpha! Apart from the order each function is executed, our scripts are almost identical. Adding the "sleep 5" at the top may have helped too? Very happy now :bounce3: -
Ambient Combat Module
deadactionman replied to mechastalin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Got the module working fiine, but as soon as I try to define groups using BIS_ACM_addGroupClassesFunc, I get nothing! The syntax is correct, but no units ever show up. However, as an experiment, I setup a radio trigger to display the names of all units on the map. When the mission starts, there's just me, the ACM and a Game Logic (which seems to get spawned as part of the ACM). After a few seconds of running around, more GLs start turning up. Still no sign of any actual units, just a map filled with invisible GLs. I assume the GLs are used as spawn locations for the soon to appear units? If I comment out BIS_ACM_addGroupClassesFunc, everything works fine, but every class turns up... not quite what I'm after. Has anyone cracked this yet? The idea of only being able to use custom groups renders the module rather inflexible in my opinion. -
I’ve seen a few threads on the validity of the “Hide Body†action and although the implementation never made any sense to me, I always enjoyed the idea of hiding enemy units that I’d silently dispatched while sneaking into a base. Years ago, I spent ages trying to perfect a “dead body detector†script in OPF for AI units and recently managed to get it working in ARMA2… kinda. For some reason, 9 out of 10 times when I hide a body, the corpse becomes perfectly horizontal (regardless of the slope he was lying on) and continually bounces up and down like he’s humpin’ the floor! I’m guessing this is a bug? Since the body doesn’t get hidden, my script doesn’t really do much anymore :confused: Do you guys recon the “Hide Body†idea is worth pursuing or will BIS remove it in favour of the more realistic “Drag†option being bounced about?
-
Alt Tabbing Crashes the PC.
deadactionman replied to Leving's topic in ARMA 2 & OA - TROUBLESHOOTING
I have the exact same problem (sometimes), so now when I'm mission editing, I run the game with -window option. This leaves the taskbar visible so no more Alt-Tabbing. It's not a fix, but a really good workaround. -
Empty enemy vehicles still enemy.
deadactionman replied to tophe's topic in ARMA 2 & OA - TROUBLESHOOTING
While we're on the subject of enemy vehicles... If I steal one, why is it every enemy unit on the map knows that the occupants of said vehicle are hostile? Surely they wouldn't know that hostile forces are behind the wheel until they can positively ID the occupants? Would it not make more sense for the OPFOR AI to assume that the UAZ driving toward them is friendly until I leap out and start gunning them down? Is it possible to have the vehicle act as a kind of camouflage?