Jump to content

f2k sel

Member
  • Content Count

    4450
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by f2k sel

  1. I found it simpler to just force a group out when needed by placing this in the WP on Act null= this SPAWN { sleep 2;GrpA leaveVehicle vehicle _this};// change GrpA to the group you want to leave all waypoints can be move you place two WP's close together for the vehicle and sync it to a move waypoint for the group getting out so the truck waits until they are out.
  2. f2k sel

    AI Discussion (dev branch)

    I issue a domove between waypoints foreach unit and set speed to full (script) so they can run in careless, better if all the AI stuff is disabled as well however there is still a bug where every now and again the AI just stop for a second or two for no obvious reason. They will continue after the freeze. It would be interesting to know why they stop it's as if there is a timing issue.
  3. I find with vehicles you usually have to have a back up plan as you can't rely an AI doing what they should. What I tried to do with FindBody.sqf was run it once just for one member of the crew, that works. It needs a delay to allow it to hit the ground, that bit's not so simple they get stuck on things. Then as I think you said it spawns crows (only once now) but they don't end. That's because units are in the vehicle and can't be deleted (not strictly true) you can setpos them out then delete but not always. That's the sketchy bit. Even if the game removes them such as in some heli crashes they don't seem to be deleted and you can't force them to become deleted that's why crows keeps running. What I found was after a set period of time they stop being objects and become something else. I struggled to find an answer but eventually I found a work around, if you use hint str (name _deadguy);// to get the default name of the unit that still works as it should but after 20-30 seconds it changes to error:no unit (at least in the Grad with 2 crew) I found I could trap the error and use that to end crows and the main while loop, name _deadguy == "error:no unit";// add that to while loop check line and crows waituntil it seemes to work and they get deleted After all that a Finder is rarely sent to the chopper the Grad is a little better, which makes sense they are harder to see and may not even exist although you can see them still there in the case of the Grad (one of them) So like I said probably not worth the trouble.
  4. Well if you can live with that's great, I did mess about for a while but results were sketchy.
  5. BIS use vehicle in a odd way it returns what vehicle the unit is in or the unit if it's on foot. so _deadguy in a chopper named heli would look like this hint str (vehicle _deadguy ) ;// would return heli name you can also use if (vehicle _deadguy == _deadguy) then {hint "deadguy not in vehicle}; or if (vehicle _deadguy != _deadguy) then {hint "deadguy is in a vehicle} or if (Vehicle _deadguy isKindOf "Air" or Vehicle _deadguy isKindOf "LandVehicle" ) exitWith {};  I did miss read you post a little, _deadguy isKindOf "Air" ect are not needed .
  6. OK I don't have a perfect fix yet but I think I see the issue, the bodies are still in the vehicle and due to the game engine you can't delete units while they are inside a vehicle. You could add a check at start of findbody.sqf, this will just exit the whole script. if (Vehicle _deadguy isKindOf "Air") exitWith {}; However I suspect this will happen with all vehicle types so a better solution is needed.
  7. I found the issue with LOS _return = [_x,_deadguy ] call i_see;// returns true if finder _x can see deadguy change above to this in findbody _return = [_deadguy,_x] call i_see;// returns true if finder _x can see deadguy and in los function change _a back to _b make it like this _eyeDV = eyeDirection _b;// WAS SET TO _b It seems to fix the blind spot and unit will go into buildings easier.
  8. Try his later version of the los function It seems to work better for me now, I also had to change eyedirection from _b to _a _a = unit looking _b = target according to wiki Returns the direction object is watching (eyes, or a vehicle primary observer). I can't see why you need to know the direction the targets eyes are pointing so I swapped them
  9. I think I see an issue, it seems that if a body falls in a certain direct relative to _finder it can't be seen even though it's only a few meters away. It's as if there's a blind spot. Well it looks like we may be able to adjust the sensitivity of the function I just need to go back to school and study maths.
  10. Something really odd at my end, all the units close to deadguy suddenly can't see the body only those far away can. Both my old and new code, I even replaced the function with a fresh copy and still fails. Oddly though just before script died the odd finder was moving in to a house to body without any code change.
  11. No problem, sometimes I just get interested in a script and like the problem solving side of the game. As it happens I just found a code that seems to show when a unit is in a building the problem is deciding when to send a unit to investigate as LOS won't cut it. Basically is skips the LOS and moves the unit directly to body even if it can't see it. I could make it a random thing where it may or may not look for the body. I notice your still using this line if (!isnull(_finder) && {!alive _finder} ) then {_finder setunitpos "UP";_finder enableAI "MOVE";}; How can it stand up if it's not alive?
  12. Buildings a re a whole new problem,. The AI don't know they're in a building unless they happen to be using buildingpos for their location. LOS won't work even if both units are in the building.
  13. I suspect the trigger is not adding the EVH to units in vehicles, you may need to add the EVH to the crew Also need to see if nearestobjects can find units in the vehicle or again we need to find the vehicles and find their crew. I can't test anything right now I may have some time later.
  14. Excellent I'll take a look later.
  15. If "ANIMAL" works all well and good, I didn't look at that as they are also being found as "MAN" , it may just be an issue with nesarestobjects that allows it show as "MAN" Also you will need to check if dog still works.
  16. Short answer no but this should work (!isnull _this) I knew they were some sort of animal you may be able to filter them out using typeof like We do for "pastor" somehow. It may be better to search the string for the letters AGENT I did it in the past but I'd rather not as it's quite slow. Just thought aren't they Civillian? Names are not correct just an example of what may work it will need correct filetypes. if (typeof _deadguy in ["sheep","hen","cow","goat","ect"]) exitwith {hint "dead animals"};
  17. Maybe I need to test using that, right now I'm just forcing the script to run as it's quicker than having to shoot the units.
  18. Strange as I don't get that error, the only difference seems to be you dropped setvariable down a line,you also had this error //EDIT: I got this randomly while testing other stuff and killing units in the process: I don't get that either. _finder_free has to be objnull or _deadguy I din't know how your adding the eventhandler I don't have that bit of script. There's another odd line in dogpatrol that makes no sense. {if ((side _perro)getFriend (side _x) <0.6) then {_HumanosVivos = _HumanosVivos + [_x];_perro knowsabout _x; _unidad knowsabout _x;}}forEach _HumanosCerca; Unless I'm missing something they should be reveals as it's should be revealing the human threats to the dog, I need to check that.
  19. I added an extra line so that it will display correctly and an _ to make it a little clearer No it won't find the dog but that's because the Line of sight seems to ignore Dogs for some reason, I also checked Knowsabout and that shows 0 for dogs so that won't work either. You can try adding your eventhandler to the dog just after _perro setVehicleVarName _NombrePerro; _perror addeventhandler ect, and then in findbody between the old script add the bold lines, it will simply send any close unit to the dog, there are no line of sight checks or knowsabout it's just forcing a unit to move to it. _finder_free = _x getvariable ["free",objnull];// check if assigned 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 if (_return and (isnull _finder_free) and (typeof _x != "pastor")) exitWith {
  20. The dog is a little tricky to deal with, you can't really control him as the other script keeps taking over. I can exclude him by using typeof so he doesn't get assigned to _deadguy The dog owner can find the body as is but if you don't want that just add his name to the exclusion array like you did for sleeper_1 I don't seem to get any of the other errors in my testing but I don't have all the other scripts messing things up. I did change detected to _detected as that would be picked up over multiple scripts. if (_return and (isnull _finder_free) and (typeof _x != "pastor")) exitWith { that is were I added the exclusion for the dog, if you use other dog types then you will need to adjust that line. It shouldn't be sending message but it will show in arrays with that funny number, I don't think his naming of the dog is working correctly it should be K9 with a random number .
  21. I can try both maybe have it as an option but a bit pressed for time today. You better post your current findbody script and I'll try and work from that otherwise we'll keep having to convert from mine to yours and run the risk of more errors creeping back in.
  22. How do you want them to function in the code, as _finder or excluded from it. I've not messed with dogs a long time so I need to look at that.
  23. I can only guess about dogs, they won't be picked up by nearestobjects as it using "MAN" they are "ANIMAL" Not sure about the error, if you can find out when it happens, no units or dogs around ect. It's odd because it was defined a line or two before.
  24. Not at PC so nothing tested. _shout1 spawn {sleep 1; terminate _this}; group _finder setVariable ["endscript",true]; To be honest I can't remember why it's being spawned or uses a sleep so try it and see which works best. So when A dies B becomes _finder for A but gets killed when moving and next living unit won't move to either? Is that's correct ?, if so it's probably due to _finder setvariable ["free",objnull];// reset as unassigned not being reset as it depends on _finder being alive. try moving it to just after the sleep 4; if (!isnull _deadguy and alive _finder) then { _finder setunitpos "middle"; _finder disableAI "MOVE"; _finder reveal [player, 1]; //NEW WIP // _finder setvariable ["free",objnull];// reset as unassigned _preAlarm = true; };// changes stance if body found sleep 4; _finder setvariable ["free",objnull];// reset as unassigned or leave as is (don't remove previous setvariable ["free") and just add an alive check Sleep 4; if (!alive _finder) then {_finder setvariable ["free",objnull]};// reset as unassigned That may be better as it won't create unnecessary variables .
  25. Ok looks like I sorted the multiple script problem and it seem to work quite well in my script which lacking a lot of your extras. I've also made this version detect only things the unit can really see although it should be easy to switch that back to knowsabout. This is using cut down version and uses short time delays for testing, also not using agents so no reference in script. Test on blank map or rename if you want to try it, there is a second script (function) that does the line of sight check. make sure you mod the init.sqf by adding i_see = compile preprocessFile "FNC_line.sqf"; save as fnc_line.sqf Tested with vehicles and the script does ignore them and only units that can see a body will be sent to it. If one unit sees two bodies close together it may get sent to both because there are no other units available which looks quite realistic to me. Also changed how the array is built using set is about 10x faster than +[] also moving -[eagle1,eagle2] to the nearesobjects is more efficient.
×