Jump to content

f2k sel

Member
  • Content Count

    4462
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by f2k sel


  1. the helipad probably isn't getting deleted as the code goes to the sleep command before it lands (touching ground) so the if is never true it needs a wait until ect.

    The problem with using the sleep command is that if the chopper gets delayed for longer than the sleep the the next waypoint becomes active.

     

     

    • Like 3

  2. If memory serves me right the "LAND" command only puts the vehicle on the ground which it does it then throttles up again and takes off  waiting for the next move command.

     

    Try placing a move waypoint right next to the first one, I think because it's so close to the first waypoint it won't bother trying to take off.

     

     

     

     

    • Like 2

  3. I've taken a look using mechanized group  and it's  really hit and miss for me so there is an issue.

    Sometimes works fine,  another time it stops at the next waypoint and won't move.

    I've seen it complete all the waypoints and stop at the cycle wp.

    I've also had it load the units after the battle but not move, I then issued the join command for each unit and it started to move again.

    But if they get too far away they seem to get removed from the group and rejoin won't work, it seems to fail quite often when that happens.

     

    I must admit I haven't a clue how to see waypoints in Zeus.

    It's hard to test when things are constantly changing you don't know what works and what doesn't.

     

     

     

     


  4.  

    I'm sure the intrigger function works in A2/OA, you would just run a check and if it's not in the trigger send the group  to trigger location.

     

    you just need to change the triggername and mygroup names to match the names your using in your mission

    null=[] spawn {
    {
    if !([triggername, _x] call BIS_fnc_inTrigger) then {_x domove getpos triggername };
    sleep 1;
    } foreach units mygroup;
    };

    Place the code  in a game logic init box, or  the trigger on Act box or if you know what your doing make it into  a script.

    I can't test so it may have errors or simply not work.

     

    It did have an error I missed the ! out of the if command, tested in A3 and it works.


  5. 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.
     

    • Thanks 1

  6. On 7/31/2019 at 9:05 PM, mickeymen said:

     

    No it will not work, at least stable! I tried it, AI will not constantly run under fire. Even if player will disable FSM (via editor module), ai-run under fire will not be stable.

    It would be great to have careless behavior at maximum movement speed, with any stance, for any vehicles, and so on.

     

    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.

     


  7. 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.

     

     

     


  8.  

    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 .

     

     

     


  9. 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.


  10. 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.

     

     

     


  11. Try his later version of the los function


     

    Spoiler

    private ["_a","_b","_dirTo","_eyeD","_eyePb","_eyePa","_eyeDV","_abs","_boolean","_range"];

    //who to see or not
    _a = _this select 0;

    //AI to see or not
    _b = _this select 1;

    _eyeDV = eyeDirection _a;// WAS SET TO _b
    _eyeD = ((_eyeDV select 0) atan2 (_eyeDV select 1));
    if (_eyeD < 0) then {_eyeD = 360 + _eyeD};
    _dirTo = [_b, vehicle _a] call BIS_fnc_dirTo;
    _eyePb = eyePos _b;
    _eyePa = if (vehicle _a == _a) then {eyePos _a} else {[getposATL _a select 0,getposATL _a select 1,2]};
    _abs = abs(_dirTo - _eyeD);
    _range = if (vehicle _a distance _b < 20) then {_abs >= 90 && _abs <= 270} else {_abs >= 60 && _abs <= 240};
    if (_range || (lineIntersects [_eyePb, _eyePa]) || (terrainIntersectASL [_eyePb, _eyePa])) then {

    _boolean = false;//hintsilent "NOT IN SIGHT";
    } else {
    _boolean = true;//hintsilent "IN SIGHT";
    };
    _boolean

     

    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

     


  12. 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?

     

     

×