Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

Everything posted by clock_x

  1. Hey, one of my scripts troubles me alot with a handful of script errors. I did it a while ago and I only remember that it was a hustle to get it to working with my limited expertise. I bet that it's not really that optimised, I think someone already helped me clean it up a little but I am not sure! It's called via an killed EH set up to all EAST units within a trigger area (pretty much whole AO). {_x addEventHandler ["killed",{_this execVM "scripts\alarm\FindBody.sqf";}]} forEach EHlist; Here is the script (errors already highlighted): Small fix attempts often kill the whole thing for me.... The main problem seems to be 'finder'. It returns one guy as it should, because that's the guy finding the body and making the call, but I get array errors from it. So I guess the game expects more than one guy, altough I only want one guy! So it basically works correctly but spams a whole lot. If I get this done I can play the mission with -showScriptErrors enabled without having the box on the screen all the time, since I already got all the other spammers fixed! Help would be much appreciated. I really want to release this damn mission already, in development for the 5th year now .. 🤔 Here are all the errors listed: Error in expression <};if ((!isNull _deadguy) AND (finder distance _deadguy < 10)) then { find> Error position: <distance _deadguy < 10)) then { find> Error 0 elements provided, 3 expected File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e0%2e5%20Final.Takistan\scripts\alarm\FindBody.sqf, line 91 Error in expression <m = true;sleep 5;_shout1 = [leader (group finder), _killer] execVM "scripts\> Error position: <group finder), _killer] execVM "scripts\> Error group: Type Array, expected Object File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e0%2e5%20Final.Takistan\scripts\alarm\FindBody.sqf, line 98 Error in expression < AI detected body";};};};};if (!isNull finder && alive finder) then {fin> Error position: <isNull finder && alive finder) then {fin> Error isnull: Type Array, expected Object,Group,Display (dialog),Control,Task,Location File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e0%2e5%20Final.Takistan\scripts\alarm\FindBody.sqf, line 127 Error in expression <e {sleep 140;};} else {if (finder in (list AllOpfor)) then {detected = true; d> Error position: <list AllOpfor)) then {detected = true; d> Error list: Type Array, expected Object File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e0%2e4%20Final.Takistan\scripts\alarm\FindBody.sqf, line 151 Hope somebody has an Idea. Cheers
  2. I found the problem I had with the disappearing chopper/crew. I have a debug trigger because UPSMON sometimes bugged out and just sent the chopper in a random direction getting stuck(pretty rare after my fixes) to delete the chopper and his crew: !(chopper in thislist) -> whole AO { deleteVehicle _x } forEach (crew chopper ); deleteVehicle chopper; So this triggers if the choppers damage is 1. Gonna try to find a workaround or just delete the debug triggers. I added && alive chopper and it stopped doing it now.
  3. Alright, I changed it. Here is an update:
  4. Mhh .. what I forgot to mention is that the helicopter vanished too. So basically I could change this line: if (_deadguy isKindOf "LandVehicle" OR _deadguy isKindOf "Air") exitWith {}; to this: if (vehicle _deadguy isKindOf "Air" OR _deadguy isKindOf "LandVehicle" OR _deadguy isKindOf "Air") exitWith {}; Is '_deadguy isKindOf "Air"' still needed in this case?
  5. Soo I had this happening: I blew up a chopper with reinforcements since I gotta test all sorts of stuff. Most of the corpses dissapeared into thin air and still a bunch of flies and crows spawned at the same spot and the findBody script was running for everyone. Dunno if explosions gets rid of corpses or if they just spawned under the ground or something. I checked if I get the hidebody action for any invisible guys but I did not. I waited for them to get deleted so that the flies/crows get deleted too but none of it happened! Whats interesting too is that the debug lines return the same corpse 2 times in the same second, which should mean that the script is running for the same guy twice? //EDIT: After reverting the game it actually realized all of them were gone and deleted all the vultures and stopped running the script. The script running for the same guy twice is actually happening more often, I had the suspicion for a bit longer but now I'm pretty sure. Just now I had a test were a single dead guy got detected 2 times by the same unit a few seconds apart. The time difference could be the random sleeps, dunno.
  6. Mhh sounds strange. I've had really strange things happening with other stuff too, like magic lightsources suddenly appearing at the same spot without any reason. Reloading the game fixed that for me at least. Sometimes arma feels a bit haunted. 😀 I think the AI sometimes went into houses too on my end, but very rarely and most of the time AI which was placed in the house, left it and then entered it again.
  7. That would be fine, the units coming to the houses are reinforcements most of the time anyway, which only come after first contact. The random chance would make it a bit more balanced. Damn I thought I fixed that. Sometimes I fix files in old mission versions by accident. That's a pain! Updated version:
  8. Well let's just ignore houses then. 😀 I'm pretty happy about how it works now anyway. Thanks again for all your help, really improved that part of my mission by a huge deal.
  9. I changed the on act. of the trigger: {_x addEventHandler ["killed",{_this execVM "scripts\alarm\FindBody.sqf";}]} forEach EHlist; {{_x addEventHandler ["killed",{_this execVM "scripts\alarm\FindBody.sqf";}]} forEach (crew _x);} forEach EHlist; It works now. And nearestobjects finds the dead guys inside vehicles just fine, the AI can see them too. I think it's almost perfect. The last thing, which I don't know if it's possible, is if the AI can enter/search houses to find dead guys. The doMove line doesn't work with houses. The Ai stays in front of the houses and looks in the direction of the dead guys inside but can't see them, which is fine. But the _finders won't enter the house. (I have created houses in the AO, dunno if that makes a difference, didn't test it with not spawned houses.)
  10. I had a small issue. The script was adding the vultures to a static weapon and deleting it after that. I added this at the beginning: if (_deadguy isKindOf "StaticWeapon") exitWith {}; //EDIT: Need to fix a bit more than that, it's adding to cars too, I guess all vehicles. if (_deadguy isKindOf "LandVehicle" OR _deadguy isKindOf "Air") exitWith {}; This should do the trick. Another thing I've noticed is, units who die/spawn inside vehicles are not triggering the script. Changed the trigger On Act.: {_x addEventHandler ["killed",{_this execVM "scripts\alarm\FindBody.sqf";}]} forEach EHlist; {{_x addEventHandler ["killed",{_this execVM "scripts\alarm\FindBody.sqf";}]} forEach (crew _x);} forEach EHlist; Now it works. Is that ok or is it a bad way of doing it?
  11. Yes I checked it, dogs are not in _finders anymore but do appear as _deadguy and the script does everything it's supposed to do. {// foreach nearobjects if (alive _x and canstand _x and !(_x isKindOf "ANIMAL")) then {_finders set [count _finders,_x]};// build array of alive units excluding busy unit } foreach ( nearestObjects [_deadguypos, ["Man"], 100]-[eagle1,eagle2,_agnt,sleeper_1]);// look through units and remove unwanted elements Here is the script up to date: Haven't gotten the undefined error for a while, maybe it was connected to the animal agents?
  12. Could be but I'm using a few civs grouped with militia as OPFOR, I think the class still returns civ. Is !(_x isKindOf "ANIMAL") for nearestObjects not a good way to do it? It got rid of them in my tests. With typeof it would be all those I think: if (typeof _deadguy in ["Cow01","Cow02","Cow03","Cow04","Goat","Hen","Cock","Pastor","Rabbit","Sheep","WildBoar"]) exitwith {hint "dead animals"};
  13. Can I put !isNull in the spawn like this: _deadguy spawn { sleep 120; if (!isnull _deadguy) then { _Body_Vultures = [_this] execVM "scripts\crows\BodyVultures.sqf";};sleep 400;hidebody _this;sleep 4;deletevehicle _this };// default effect Because I always get <NULL> from the deadguy/victim in BodyVultures.sqf after I hid/deleted the deadguy from this debug line: player globalChat format ["BodyVultures.sqf - victim:%1 - spawning vultures", _victim]; One other thing, I think I figured out who the agents who are displayed are, definitely not flies/crows as far as I can see. Because i get the agents before crows/flies are spawned. I've been chasing a bunny away from the dead guys in one situation where I reverted a few times and the agent disappeared. Sneaky bunnies! I do use the ambient animals module. //EDIT: Now it was 2 sheeps, which I killed and the two agents were gone. ANIMAL seem to be a subcategory of MAN: AllVehicles->Land->Man->Animal->CAAnimalBase->Cow/Hen/Sheep/Rabbit etc. I think I removed them for good😀: {// foreach nearobjects if (alive _x and canstand _x and !(_x isKindOf "ANIMAL")) then {_finders set [count _finders,_x]};// build array of alive units excluding busy unit } foreach ( nearestObjects [_deadguypos, ["Man"], 100]-[eagle1,eagle2,_agnt,sleeper_1]);// look through units and remove unwanted elements The dog is removed from _finders too. Is and (typeof _x != "pastor") obsolete now?
  14. It's just a trigger. OPFOR present (all untis are inside trigger area) this EHlist = thislist;{_x addEventHandler ["killed",{_this execVM "scripts\alarm\FindBody.sqf";}]} forEach EHlist;
  15. The killedEH? I think the dog already has it because everytime I kill the dog he is instantly recognized as _deadguy. I'm getting an error and I don't understand why, the code seems totally fine. if (typeof _deadguy == "Pastor" and (isnull _finder_free) and (typeof _x != "pastor")) exitwith {_x setvariable ["free",_deadguy];// assigned to deadguy _x domove _deadguypos;// _deadguypos; _finder = _x; };//exitwith ends loop Error in expression <d (isnull _finder_free) and (typeof _x ! = "pastor")) exitwith {_x setvariabl> Error position: <! = "pastor")) exitwith {_x setvariabl> Error Missing ) FindBody.sqf, line 57 //EDIT: I just changed the layout and now it works 🙄 if (typeof _deadguy == "Pastor" and (isnull _finder_free) and (typeof _x != "pastor")) exitwith { _x setvariable ["free",_deadguy];// assigned to deadguy _x domove _deadguypos;// _deadguypos; _finder = _x; };//exitwith ends loop
  16. Nice, thanks I will test it tomorrow. That's supposed to be like that, if detected=true and the target is close to the AO the mission fails. All the alarm scripts are pretty much for that purpose..and for reinforcements. I only got it like two times, I'm gonna try to figure out why. I was wondering what this.. _NombrePerro = format ["k9%1",round (random 1000)]; is about. 😀 Can the dog owner find the dog, even though the dog is excluded with typeof?
  17. Here it is: The dog should definitely be excluded from _finders, don't want him making radio calls. 😀 Just did a test and killed everything around the dog, he was in _finders but didn't trigger anything else. But it would be nice if he can be a functioning _deadguy who gets detected. Here is the dog script wthout the CBA lines:
  18. Well if it's too much hustle I'm fine with them beeing excluded. That's how it worked originally.
  19. I'm not sure they count as animals, since they do appear in the _finders array. I'm gonna do some more tests later and see if I get it again.
  20. I changed it and it definitely works better now. Sometimes it fails with this line though: if (!isnull _finder or !alive _finder) then {waituntil{;sleep 1;!alive _finder or _finder distance _deadguypos <4 or isnull _deadguy};};// checks finder status The _finder just doesn't get in range after detecting the dead unit. And I got another problem with my dog patrols. In my old scripts the dogs weren't getting detected by the script, which wasn't very realistic. Now they are but it gets stuck at the _finders loop. What is strange is that they change name in the process, at first something like O 3-1-L:1 and then the name of the object: The killedEH is added via trigger w/o sleep, I always thought the dogs are not added because they are spawned, I guess that's not the case. Maybe they aren't east but the killedEH is only added for OPFOR units. Dogpat script: It needs CBA but I think only because it uses call CBA_fnc_globalSay3d; instead of say3d. //EDIT: I got this randomly while testing other stuff and killing units in the process: Error in expression <ree",objnull];if (_return and (isnull _finder_free)) exitWith {_x setvariable> Error position: <_finder_free)) exitWith {_x setvariable> Error Undefined variable in expression: _finder_free File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e1%2e3%20Final.Takistan\scripts\alarm\FindBody.sqf, line 57
  21. I set everything up but I get: Error in expression <0};sleep 0.1;_return = [_x,_deadguy] call i_see;_finder_free = _x getvariab> Error position: <call i_see;_finder_free = _x getvariab> Error call: Type Script, expected code File D:\Eigene Dateien\Documents\ArmA 2\missions\OP%20GECKOHUNT%20v3%2e1%2e3%20Final.Takistan\scripts\alarm\FindBody.sqf, line 53 //EDIT: Nevermind I forgot ; after i_see = compile preprocessFile "FNC_line.sqf"; And about this part: _shout1 spawn {sleep 1; terminate _this}; group _finder setVariable ["endscript",true]; Do I need to change the sleep? And shouldn't be setVariable inside the spawn? Looks like it terminates it after one second even though it should run for a while. At the end of findBody I've had this to terminate it: if (!isNil "_shout1") then {terminate _shout1;group _finder setVariable ["endscript",true];}; Which was working good because it terminates it after the player got detected or not detected and not after x time. //EDIT: I removed the shout lines and it works like before. In my first tests the new version seems to work very good. But I think there is something wrong when I kill more than one. The AI detects the corpse, shout starts but then nothing more happens. Here is what happens: Unit A dies. Unit B detects unit A and triggers shout. Unit B dies. Unit C detects unit A. Script only continues with unit B and unit C is in _finders for B instead of beeing the _finder for A and finishing it. After that the unit runs away most of the time, out of range and I get _finders=[]. One time a different pat finished the script and not unit C which was 100m far away watching the area still shouting.
  22. Sadly not - I have pretty much all units given a name in the editor. I think the name returned would be the one set in 'setIdentity' in the description.ext. I never checked that because, thank god, I don't have any units in vehicles, except UPSMON reinforcement choppers. I had the suspicion that it makes the choppers stuck in rare occasions, but I think that was an UPSMON error, which I fixed. It's awesome, you can set it up to work with sqf's and arma stuff. That could in fact be the problem I am having with nothing happening in some situations.
  23. Nah I'm just gonna leave it as it is. Yeah....but I prefer getting the names from the editor than Khairullah Noori, for debugging reasons. And I never get an agent from _deadguy or _finder, just from _finders but it's allright they don't seem to do any harm. Man I love Notepad++, two clicks and it's changed in all files. 😀 Update: I added the unit which has move disabled to the remove array, it's sleeper_1. Since that was the camp I did most of the tests, it works much better around there now.