Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

clock_x

Member
  • Content Count

    88
  • Joined

  • Last visited

  • Medals

Everything posted by clock_x

  1. It doesn't work, I tested it with a few triggers in a clean mission file. Maybe I'm just gonna remove this unit from the array, since it's the only one and the clipping really looks ugly. I didn't think about injured units, good idea! I updated the script in I will test soon. One other thing ... I do use agnt = []; //test agnt = agnt + [agent _x] } foreach agents; //test in two of my other scripts where I use nearestobjects too: WestFiredEH - triggers for close units to detect fired shoots (silenced and non silenced). bDetect_alarm - bullet hit detection. Can that be a problem since agnt is a global variable? //EDIT: I get this for the name thing: Error in expression < corpse:%1 _finders:%2", name _deadguy, name _finders]; };{if (random 15 > 1> Error position: <name _finders]; };{if (random 15 > 1> Error name: Type Array, expected Object,Location File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e1%2e2%20Final.Takistan\scripts\alarm\FindBody.sqf, line 41 And to get names like Khairullah Noori is not really good for debugging. 😀
  2. I'm pretty sure I the agent from _finders, but it doesn't really matter, it was a 1 in 50 time. The only thing that bothers me right now is if the AI doesn't execute the whole thing around a campfire. Doesn't look very realistic! If knowsabout fails in this situation I thought about doing something with my trigger areas. !alive unit x AND x in campfire list AND campfire inflamed then reveal x 0.5 Or something like that. Don't really know what to do if the distance check fails. Going to do more tests on this to see what is happening though. //EDIT: I've got one situation where a AI is sleeping - then waking up with disableAI "MOVE" because if he moves he clips through the chopper wreck he slept in. And if it triggers for him as finder nothing happens, because he can't move. About the agents in finder: Can I add name to an array like _finders too? In this situation only dead units were around.
  3. I rarely get agents now. I think I only got one since I changed it. I added this. I did some more test runs. Most of the time the AI do detect/know about the dead AI at some point, sometimes from 50-100m range. But then very often nothing else happens because they don't manage to come in range. I need to pay more attention to this, never saw it happening. I guess it's not a big issue if the dead guys are next to each other, rather if they are on max range. In my tests I kill AI next to each other most of the time, need to do some tests with more spacing. My script up to date:
  4. if (random 15 > 10) then {_x lookat _deadguy;hint "looking";sleep 3;_x lookat objnull;_x setformdir random 360};// adjust random to look more or less often I tested this, it definitely seems to help the AI finding them. I was wondering if I can move { agnt = agnt + [agent _x] } foreach agents; //test inside the loop, since the agents who do appear in the array seem to be added after the script started.
  5. Yes I think there was a different reason why I got detected. I did a few more test runs and this time it really worked very good. I just need to test more and then decide what I'm gonna use. Still getting an agent from time to time though. 😀 Something else happening is, pretty often the _deadguy returns null for a while and even gets added vultures, atleast thge debug line tells me that, didn't actually see a null unit get vultures.
  6. So I should implement lookAt or doWatch. I think I need to use unit doWatch objNull; after too? I encountered another problem with: if (!isnull _finder or !alive _finder) then {waituntil{sleep 1;!alive _finder or _finder distance _deadguypos <4}};// checks _finder status I hid(deleted) a corpse and .. if (mein_debug>0) then {player globalChat format ["FindBody.sqf - _finder:%1 close to _deadguy", _finder]; }; returned <null-object> and I still got detected with only dead and null units around.
  7. Oh right, forEach is it's own scope. The error was that I didn't change preAlarm to _preAlarm. I did a few tests with various situations and it seems to work fine. There was a few tests where the AI didn't show much interest in it's dead squadmate. I think this is happening because UPSMON gives them orders too. (AI is scouting the area running back and forth or running away, fleeing) Since _x domove _deadguypos; isn't spammed anymore in the loop but rather the loop exits with it, this could be happening more often I guess? If I don't understand anything wrong again. It happens quiet often(6 out of 10 times), it seems the script only triggers if the deadguy dies right next to his mate or if the unit walks by accident next to him. I could be wrong though, it happened in the old version too but not as often. About the agents ... since they don't seem to do any harm, maybe we just let them be. 😀 I did implement the code to remove the agents, didn't get any errors so far, I will see what happens. Here is the updated full script:
  8. I tried the cleaned up version. There is one part that is confusing me. if (_x knowsAbout vehicle _deadguy > 0.4) exitWith { _x domove _deadguypos; _finder = _x; if (mein_debug>0) then {player globalChat "FindBody.sqf - AI detected body";}; _shout1 = [leader (group _finder), _killer] execVM "scripts\ShoutSound.sqf"; };//exitwith ends loop when finds first guy that knows >0.4 This happens always pretty fast. But as I understand it, exitWith exits the while loop and the next important part inside the loop doesn't even happen which is: if (!isnull _finder or !alive _finder) then {waituntil{sleep 1;!alive _finder or _finder distance _deadguypos <4}};// checks _finder status if (!isnull _deadguy and alive _finder) then { // examine body _finder setunitpos "middle"; _finder disableAI "MOVE"; _finder reveal [player, 1]; _preAlarm = true };// changes stance if body found So pretty much nothing happens after that. Yes of course! Basically i need to add group _finder setVariable ["endscript",true]; to the terminate part inside findBody. Seems to work fine. And about the agents... if (!isnull(_x) && {!alive _x} && {_deadguyside != side _x} ) then { _remove = _remove + [_x] }; I tried this and Eagle1+Eagle2 are returned as finders. But they shouldn't because they are not the same side as the dead guy. So I guess _deadguyside != side _x is simply not working.
  9. I added _shout1 = nil; to the beginning of findbody and it worked! I always forget that there are different scopes inside a single script..
  10. Yea I know, I just thought the whole script would still end if I use terminate from another script. The 120 distance thing is working just fine, it's the hearable range defined for the sounds too so that's why I got this. I want to terminate it to avoid too many units/groups talking at the same time and to signal the player that the process of him getting detected is over. The thing is _loop is local and I want to end it from another script (e.g. findbody). I could work around it with !detected like this: while { ({alive _x} count units (_unit_group) > 0) && !detected and ((leader (_unit_group) distance _target < 120) OR (leader (_unit_group) distance player < 120)) } But that's not really the best solution since the alarm scripts can trigger if the player is already detected, for reinforcement positions for example.
  11. Maybe UPSMON or could be ACE. I don't have any AI addons activated right now like Zeus. I'll have a look into UPSMON. I do have a lot of triggers and logics everywhere, some dead animals too. But it's not like I sided them with EAST or something. I guess the highest possibilty is that ACE creates invisible EAST stuff. I remember Zeus creating targets for the AI to shoot, maybe ACE is doing something in a similar matter. I have some plants and bushes around from MAP EU which is part of ACE too. Since I don't get many errors and bugs anymore it won't be long until I start testing the vanilla version, maybe that will shine some light. You don't really need ACE for the shout script. _shouter call ace_sys_wounds_fnc_isUncon - this is just to check if they are unconsious, can simply be removed I guess. I extracted soundfiles from arma2:oa for the shouts, just random takistani AI files. The part you rewrote looks promising, but it's gonna be some work to switch it out, I'm gonna give it a try. One thing that could be missing are more side queries, if units kill themselves by not knowing how to use a parachute or if they die by an explosion the _killer side is civ. Everything else looks solid with first look.
  12. I added hidebody, looks better! I sometimes still get agents... { if (!isnull(_x) && {!alive _x} && {_deadguyside != side _x} ) then { _remove = _remove + [_x, Eagle1, Eagle2] }; } foreach ( nearestObjects [_deadguypos, ["Man"], 60]);//this is the array were looking through (_finders) _finders = nearestObjects [_deadguypos, ["Man"], 60] - _remove; player globalChat format ["Findbody.sqf - deadguy:%1 finders:%2" ,_deadguy, _finders]; That means some of the agents are units which are east?! Don't know what else I can do about it. One other thing that never really worked in all my alarm scripts is that the shoutsound.sqf doesn't get terminated. It's called _shout1 = [leader (group finder), _killer] execVM "scripts\ShoutSound.sqf"; _shout2 = [leader (group finder), _killer] execVM "scripts\ShoutSound.sqf"; _shout3 = [leader (group finder), _killer] execVM "scripts\ShoutSound.sqf"; _shout4 = [leader (group finder), _killer] execVM "scripts\ShoutSound.sqf"; in the different scripts. And at the end of each script I got: if (!isNil "_shout1") then {terminate _shout1;}; But when for example the findbody script ends after the everything triggered the unit still continues to shout. Here is my shoutsound.sqf:
  13. Hey, I'm almost finished with my first and last mission for ArmA 2: OA. I started making it in 2013, if I remember correctly. So it's about time! It features custom voice acting, sounds and music and a lot of scripts to make it as atmospheric and immersive as possible. I also put a lot of effort in making the AI behave correctly in a nighttime environment. It's an ACE2 sniper assassination stealth mission with two switchable player units. (sniper/spotter) But I will add a vanilla version too. Operation 'Geckohunt' SEAL Team THREE Sniper Team, call sign 'Eagle', is on its way to 'Feruz Abad', where Colonel Aziz (call sign 'Gecko') of the Army of Takistan is heading to. 'Eagle' must assassinate 'Gecko'. I made a trailer for the upcoming release this summer. - AAN NEWS I hope you enjoy. Cheers clockx Edit: The quality of the video suffered quiet a bit from the upload. I'll try to fix it with a reupload but I don't know what I can do about it. I always get these pixelated parts with fast moving pictures and youtube makes it a whole lot worse.
  14. Yeah..I think I'm gonna leave it as it is. If I'm not wrong I tested this at one point already. I would need to check for TK_INS_Soldier, TK_Soldier and TK_Special_Forces then. I have some civilians grouped with OFPOR too, so TK_CIV needs to be there too. { if (!isnull(_x) && {!alive _x}) then { _remove = _remove + [_x, Eagle1, Eagle2] }; } foreach ( nearestObjects [_deadguypos, ["TK_INS_Soldier", "TK_Soldier", "TK_Special_Forces", "TK_CIV"], 70]); _finders = nearestObjects [_deadguypos, ["TK_INS_Soldier", "TK_Soldier", "TK_Special_Forces", "TK_CIV"], 70] - _remove; So that would mean I could delete the (_deadguyside == side _x) too, if it works. Edit: Removed: && {_deadguyside != side _x}. Edit2: Just tested it and I get finders:[]. Maybe I did something wrong?
  15. Gonna try this but I think I need to up the range to 200 or something to make sure there are enough around, that could be a problem, because if too many are around, it get's too crowded. Something else that could happen is pats from outside the range walk in and right over the deadguy and nothing happens, which would look really strange. I removed the !alive _deadguy condition and changed the distance thing to _deadguypos. I'm thinking how I can change this line(141) too: if ((_x != vehicle _deadguy) AND (alive _x) AND (_deadguyside == side _x) AND (side _x == EAST)) then Or if I even need to change it. Like what happens if _deadguy is null and it asks if the finder is not the deadguy. I guess it should be true? Maybe I don't need to change it then. On the other hand finder comes from _finders which got all non alive units removed, thus the _deadguy too, in that case I could just delete it.
  16. Soo the position thing was a very good idea. Replaced all the getpos _deadguy lines with _deadguypos. Works good! I had a few other problems. If there were more than one _finders it got kinda stuck until one specific unit went to the position. If there were alot it went on for a while or went completely stuck. I added another distance query: _x move _deadguypos; if (_x distance _deadguypos < 4) then { finder = _x; }; Seems to work alot better now, only tested once tho, need some sleep. 😀 Another thing was, agents got into _finders and _spotters. I added this: if (!isnull(_x) && {!alive _x} && {_deadguyside != side _x} ) then { _remove = _remove + [_x, Eagle1, Eagle2] }; And a few other minor changes like adding !isNull and fixing a bug: _deadguyside != side _x changed to-> _deadguyside == side _x, dunno how I got this wrong. Here is the full script up to date:
  17. _deadguypos = getPosATL _deadguy; { if (!isnull(_x) && {!alive _x} ) then { _remove = _remove + [_x, Eagle1, Eagle2] }; } foreach ( nearestObjects [_deadguypos , ["Man"], 50]); _spotters = nearestObjects [_deadguypos , ["Man"], 50] - _remove; Like this?
  18. Ah I see, makes sense. There is a good chance I got this error after I hid(deleted) a body. Going to try this then: { if (!isnull(_x) && {!alive _x} ) then { _remove = _remove + [_x, Eagle1, Eagle2] }; } foreach ( nearestObjects [vehicle _deadguy, ["Man"], 100]); _finders = nearestObjects [vehicle _deadguy, ["Man"], 100] - _remove; Edit: Doing this made the same error appear later on in: { if (!isnull(_x) && {!alive _x} ) then { _remove = _remove + [_x, Eagle1, Eagle2] }; } foreach ( nearestObjects [vehicle _deadguy, ["Man"], 50]); _spotters = nearestObjects [vehicle _deadguy, ["Man"], 50] - _remove; Changed it to: { if (!isnull(_x) && {!alive _x} ) then { _remove = _remove + [_x, Eagle1, Eagle2] }; } foreach ( nearestObjects [vehicle finder, ["Man"], 50]); _spotters = nearestObjects [vehicle finder, ["Man"], 50] - _remove; Haven't gotten the error since.
  19. In OPF I only bothered to build fancy bunkers and let AI fight each other and then bomb everything with a simple airstrike or artillery script. 😀 Managed to get this one again: Error in expression <+ [_x, Eagle1, Eagle2] };} foreach ( nearestObjects [vehicle _deadguy, ["Man"> Error position: <nearestObjects [vehicle _deadguy, ["Man"> Error 0 elements provided, 3 expected File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e0%2e9%20Final.Takistan\scripts\alarm\FindBody.sqf, line 50 For this part: if (!alive _x) then { _remove = _remove + [_x, Eagle1, Eagle2] }; } foreach ( nearestObjects [vehicle _deadguy, ["Man"], 100]);// ERROR HERE / LINE 50 _finders = nearestObjects [vehicle _deadguy, ["Man"], 100] - _remove; player globalChat format ["Findbody.sqf - deadguy:%1 finders:%2" ,_deadguy, _finders];
  20. Hey there, I have a few script errors which bother me for a while in the UPSMON-Urban Patrol Script by Monsada & Rafalski. I have no Idea how to fix them, since UPSMON is way over my scripting capabilities. One in particular is pretty annoying, it starts spamming at mission start: Error in expression < }; if (_inheli) then { _landing = _heli getVariable "UPSMON_landing"; if (> Error position: <_heli getVariable "UPSMON_landing"; if (> Error Undefined variable in expression: _heli File D:\x\x\ArmA 2\missions\OP%20GECKOHUNT%20v2%2e2%2e9%20Final.Takistan\scripts\upsmon.sqf, line 1473 I feel like this one is bugging out the helicopter AI landing from time to time and makes the chopper stuck. Here is the script: Link to the scripts: http://www.armaholic.com/page.php?id=9213 And here is my full rpt file for a few more UPSMON errors, saved ~30sec after mission start. Something is happening with the markers, something with the stuck control and something inside the functions script file. I hope someone already got experience with those errors since it is the latest UPSMON version. Cheers
  21. I just spent an hour to look for the reason why UPSMON artillery is not firing anymore. It was my 'fix' in Init_UPSMON: Error in expression <ts1 = [];_targets2 = [];{if (!isnull _x && alive _x && !captive _x ) then { > Error position: <_x && alive _x && !captive _x ) then { > Error Undefined variable in expression: _x File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e0%2e8%20Final.Takistan\scripts\Init_UPSMON.sqf, line 333 LINE 336 - added if (!isNil {KRON_NPCs select 0}) then { }; Removing the !isNil made the artillery fire again. Gonna have to look for a different fix. Using: player sideChat format ["UPS - %1", KRON_NPCs]; Always returns a few <NULL> in the array which vanish while it is initializing, but there is always one <NULL> left as the first string: [<NULL>,PAT1,PAT2,PAT3] Doesn't matter how many patrols I got, if I only have one there is still a <NULL> in front of it, I guess that's the problem. I tried to remove it but it messed up the script. This is basically what's happening except there is this one <NULL> left. I tried this code here too, but still the same error. Edit: Using this code seems to work, artillery still firing: (!isnil('_x') && {alive _x} && {!captive _x} ) Implemented this format for all other old undefined errors too. Found here: Some more errors in MON_fuctions.sqf: MON_GetPos2D //Function that returns a position in 2D from another, an address and a distance //param1: position //param2: direction //param3: distance (<-error) //Returns 2D position vector [0,0] Error in expression <_sinT = abs sin(_dir);_relTX = _sinT * _dist * _cosU; _relTY = _cosT * _dist > Error position: <_dist * _cosU; _relTY = _cosT * _dist > Error Undefined variable in expression: _dist File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e0%2e8%20Final.Takistan\scripts\UPSMON\common\MON_functions.sqf, line 123 Error in expression <{};_targetPos = [position _npc,_dir1, _dist] call MON_GetPos2D;if (surface> Error position: <_dist] call MON_GetPos2D;if (surface> Error Undefined variable in expression: _dist File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e0%2e8%20Final.Takistan\scripts\UPSMON\common\MON_functions.sqf, line 1410
  22. Totally didn't see that: Yes it's a real pain, I got so many stuff going on to simulate the AI reacting to the player, but I think I did a nice job so far. That forget feature sounds awesome. Can't wait to dig into arma3, but I want to finish this map first. I checked again since when I'm working on it, started it in 2012. 😑 Did have a lot of breaks though.
  23. Hey, I got a quick question about bDetect. I just want to pass more strings from the fired EH to my callback function. At the moment I can only get this from bdetect.sqf: _unit = _this select 0; // unit being under fire _shooter = _this select 1; // shooter _bullet = _this select 2; // bullet object _bpos = _this select 3; // bullet position _pos = _this select 4; // starting position of bullet _time = _this select 5; // starting time of bullet _proximity = _pos distance _unit; // distance between _bullet and _unit _enemybulletcount = _unit getvariable ["detect_enemybulletcount", 0]; //enemy bullet count I want the fired weapon and maybe the ammo too. I tried adding _weapon = this select 6; at different positions like my callback function and the prototype callback function in bdetect.sqf but nothing works. The fired EH array is defined in bDetect.sqf line 235+: // Fired EH payload bdetect_fnc_fired = { private ["_unit", "_weapon", "_muzzle", "_magazine", "_bullet", "_speed", "_msg", "_time", "_dt"]; if( bdetect_enable ) then { _unit = _this select 0; _weapon = _this select 1; _muzzle = _this select 2; _mode = _this select 3; _ammo = _this select 4; _magazine = _this select 5; _bullet = _this select 6; _speed = speed _bullet; _time = time; //diag_tickTime _dt = _time - ( _unit getVariable ["bdetect_fired_time", 0] ); [...] Here is a link to bdetect.sqf: https://github.com/fabrizioT/bDetect The reason I want _weapon is to give a different reveal value for unsilenced sniper rifles, I could try to use the bullets instead but I feel it's not that reliable. Also I was asking myself the question if I can find a way that, for example, in a situation were multiple units get incoming shots only one of them executes the code and not all of them, to avoid executing the code like 5x at the same time. But I'm pretty puzzled about it. But I may just keep discarding the subsonic ammo and basically only use it for sniper rifle detection, that way it isn't much of a problem. Cheers //EDIT: Nevermind found a work around.
  24. Strange, everything works for me. Here is my vulture script: //nul = [_victim] execVM "scripts\crows\DeleteVultures.sqf"; _victim = _this select 0; _bis_flies_victim = []; _bis_crows_victim = []; if (mein_debug>0) then { player globalChat format ["BodyVultures.sqf - victim:%1 - spawning vultures", _victim]; }; if (!alarm) then { _bis_crows_victim = [_victim,15,1,(20 + (random 20))] CALL FUNKTIO_CROW; }; _bis_flies_victim = [position _victim,0.05,0.2] call bis_fnc_flies; waitUntil {sleep 30; isNull _victim}; if (mein_debug>0) then {player globalChat format ["BodyVultures.sqf - deleting vultures %1 and %2", _bis_flies_victim, _bis_crows_victim];}; //RETURNS FLIES {if (!isNull _x) then { deletevehicle _x; }; } foreach _bis_flies_victim; {if (!isNull _x) then { deletevehicle _x; }; } foreach _bis_crows_victim;
×