Jump to content

_qor

Member
  • Content Count

    294
  • Joined

  • Last visited

  • Medals

Posts posted by _qor


  1. Hey there,

     

    I want to wide the friend/enemy conditions a bit. So even if the player is regarded as enemy to a side, it can be setCaptive true.

    The conditions for this are fullfilled if the player has no weapon or is inside unarmored car.

     

    This is the loop:

    while {checkCaptive} do {

     
    if (vehicle player != player &&
    (vehicle player isKindOf "LandVehicle" OR vehicle player isKindOf "UAZ_AGS30_Base") &&
    !(vehicle player isKindOf "Motorcycle") && !(vehicle player isKindOf "StaticWeapon") &&
    !(vehicle player isKindOf "HMMWV_Base") && !(vehicle player isKindOf "Offroad_DSHKM_base") &&
    !(vehicle player isKindOf "Pickup_PK_base") && !(vehicle player isKindOf "MTVR") &&
    !(vehicle player isKindOf "Ural_Base_withTurret") && !(vehicle player isKindOf "Ural_ZU23_Base") &&
    !(vehicle player isKindOf "Wheeled_APC") && !(vehicle player isKindOf "Tank") ) then 
     
    {player setCaptive true}
     
     
    else 
     
     
    {
     
    if (vehicle player == player && primaryWeapon player == "" && secondaryWeapon player == "") then {player setCaptive true} else {player setCaptive false};
     
    };
     
     
    sleep 1;
     
    };
     
    player setCaptive false;

     
    And the question is how to control if the loop stops or continues. So if the player has been identified as enemy, the loop has to stop so it wont set the player to captive true again. Unfortunately I realized too late that knowsAbout is not suitable for this, because its result doesnt decrease properly.
     
    Actually I wanted to stop the loop if west knowsAbout player >= 0.105 and to continue it if < 0.105.
    So is there better way to check if the player is not seen/detected by side west? I would combine that with a specific period of time this condition must be true (timeout).

  2. Hey,

     

    I was very lucky when I found helling3r's script which handles reading and refilling of cargo space: https://dev.withsix.com/issues/68594

    But it is not possible for me to remove multiple items at once:

    _removeW = [_box, "AK_74", 5] call CBA_fnc_removeWeaponCargoGlobal;

    Additionally, the simple syntax only removes ALL items:

    _removeW = [_box, "AK_74"] call CBA_fnc_removeWeaponCargoGlobal;

    Is there anything I could have done wrong with this? Apparently there are 3 files to download, of course I use the latest one...

    Does this work for you?


  3. Hey,

     

    I am looking for a way to transfer weapons from ammoboxes to vehicles without picking each single weapon.

    Best way would be to have an interface which allows you to choose the weapons and which adds/removes the selection when finished.

    But this requieres some experience with creating interfaces.

     

    Perhaps there already exists a script or there is an easier way to do this?

    Otherwise I really have to get into creating interfaces. In this case it would be great if the dialog of the already existing gear menu can be seen.

     

     

    Thanks!


  4. Wow, excellent!!!

    Exactly what I was looking for!

     

    So you call BIS_fnc_removeIndex to remove the each existing weapon from the vehicle?

    Or does this just removes the preexisting weapons in the ammunition MTVRs?

     

    Script works great for weapons, but not for magazines.

    I dont really know how to adapt the script. 

    {_vehicle addMagazineCargoGlobal _x} forEach _weaponsCargo; returns onlythe given  weapons.


  5. Hey,

     

    I added some weapons and magazines to a vehicle's cargo. Is there a way to swap this weapon-setup, which may have changed, to an ammobox?

     

    Cant find a way to do this by getWeaponCargo and weapons only returns "TruckHorn".

    I think there is a way to do this with getWeaponCargo, otherwise this code would have been introduced only to make the cargo visible.

     

    Unfortunately pickWeaponPool and putWeaponPool doesnt work. I read some posts mentioning that those codes do work.


  6. Hey,

     

    the scenario first: a convoy which has to get stolen by the player which has to unload the convoy's content at base. Convoy gets respawned if dead and therefore two vehicles with actually the same name can exist.

     

     

    Problem is, that when a vehicle with the same name as an existing vehicle gets spawned, the first vehicle (the "old" one) gets a new name.

    So there is a trigger which fires when a convoy vehicle is inside. But it wont get fired by the old vehicle which has been renamed.

    Actually I solved this problem (it just worked good without knowing exactly why), but while "improving" the script it seems to be a problem again.

     

    So this how I set up the addAction:

    FC2veh setVehicleInit "unloadFC2 = this addAction ['UNLOAD','convoys\Unload\FCunload.sqf','',1,true,true,'','((_target distance _this) <6) && (FC2veh getVariable ''GOODS'' == 1) && [FS_anar,_this] call bis_fnc_inTrigger']";
     
    processInitCommands;
    
    

    What I thought is, the local variables would alway return the correct vehicle. But when the new vehicle is spawned, the action disappears from the old vehicle and only appears back when the new one is inside trigger too. Does this mean that [FS_anar,_this] call bis_fnc_inTrigger always returns FC2veh?

     

    Pls help, I got lost in script-glyphs ._.

     

     

    EDIT

    Got the point! Ofcourse the problem came up with introducing the a getVariable which is connected to the name.

    Anyway, it would be great if there is a convenient way to work around this problem with respawn and unitnames!


  7. To your last problem:

     

     

    Add this to your suspect's init:

    handcuffAction = this addAction ['HANDCUFF','handcuffScript.sqf','',1,true,true,'','((_target distance _this) < _range)']

    Where you have to replace _range with the distance you want to be able to catch the suspect (try with 4).

     

     

     

    Create in your mission folder: handcuffScript.sqf

     
    _suspect = _this select 0;
    _police = _this select 1;
    _action = _this select 2;
     
    _suspect disableAI "MOVE";
    ///_suspect setCaptive true;
    _suspect removeAction _action;
     
    hint "SUSPECT IN CUSTODY";
    

    As far as you chase civilian units, you wont need to set them to captive because they are neutral to anyone anyway.

    If this is the case, just delete this line in the script, otherwise delete "///"!


  8. Hey,

     

    I want to evaluate the fuel-level of a fuel station and add some fuel.

     

    Using an trigger to evaluate will return "scalar", but putting the same code in an gamelogic's init, it will return 1.

    fuel ((position this) nearestObject 94046)

    So why does this work only with a gamelogic? How can I evaluate this with an external script?

     

     

    Besides, does anybody know whether the fuel stations have eternal resources or get empty when in use?


  9. Didnt know that command, I will give it a try!

    But combining lineintersects and "fired" may not be a solution as far as I add the eventHandler to all enemies in game.

    So the code should get executed from the vehicle which is under fire.

     

    "Max hardcoded distance is 1000m" could be a problem, because it should be about an helicopter and an AA ground unit, which targets the heli when it is about 2000m away.

     

     

     

    EDIT: IncomingMissile EVH should work! I realize to post more information next time ;D This EVH works great for this special purpose.

     

    But there is another problem: the EVH doesnt work for players firing a not guided missile ._.


  10. Hey,

     

    I want to spawn a Chinook with all crew inside, but using BIS_fnc_spawnVehicle spawns the Chinook like in the air with engineOn true and with some velocity.

    Although the heli spawns on the ground, the Chinook acts like a rocket firing straight in the air.

     

    I used setVelocity [0,0,0] and engineOn false, so at least the Chinook takes off smoothly. But I actually want it to stay on the ground with engine turned off.

     

    Do I need to use createVehicle and add the crew or is there a better way?


  11. Hey,

    its just about this script that is not working:

    _trg1 = createTrigger ["EmptyDetector", getPos FC1veh];
    _trg1 setTriggerArea [20, 20, 0, false];
    _trg1 setTriggerActivation ["ANY", "PRESENT", true];
    
    
    if (EAST countSide list _trg1 == 0) then {hint "free to delete"} else {hint "occupied"};
    

    Of course the necessary conditions to fire the trigger are fulfilled.

    Got an idea what might be wrong?


  12. Why FC2grp?

    EDIT:

    Okay it works this way

    {deleteVehicle _x} forEach crew FC1veh;
    deleteVehicle FC1veh;
    
    
    {deleteVehicle _x} forEach crew FC2veh;
    deleteVehicle FC2veh;
    
    {deleteVehicle _x} forEach crew FC3veh;
    deleteVehicle FC3veh;
    
    {deleteVehicle _x} forEach crew FC4veh;
    deleteVehicle FC4veh;
    

    But if a unit is not in the vehicle, it wont get deleted.

    I would delete each unit of FC1grp, but curiously its just not working. Although I created all waypoints by referring to FC1grp (and this works!).

    Is there a solution?


  13. Hey,

    I spawn a convoy with this script

    FC1 = [getmarkerPos "FC_spawn1", 172, "HMMWV_M1151_M2_DES_EP1", West] call Bis_fnc_spawnvehicle;
    
    FC1veh = FC1 select 0;
    FC1crw = FC1 select 1;
    FC1grp = FC1 select 2;
    
    
    
    FC2 = [getmarkerPos "FC_spawn2", 172, "MtvrRefuel_DES_EP1", FC1grp] call Bis_fnc_spawnvehicle;
    
    FC2veh = FC2 select 0;
    FC2crw = FC2 select 1;
    FC2grp = FC2 select 2;
    
    
    
    convoyGuardFC = createGroup west;
    
    FCg_l = convoyGuardFC createUnit ["US_Delta_Force_TL_EP1", getMarkerPos "cgFC", [], 0, "FORM"];
    FCg_mg = convoyGuardFC createUnit ["US_Delta_Force_MG_EP1", getMarkerPos "cgFC", [], 0, "FORM"];
    FCg_s = convoyGuardFC createUnit ["US_Delta_Force_Marksman_EP1", getMarkerPos "cgFC", [], 0, "FORM"];
    
    {_x moveInCargo FC1veh} forEach units convoyGuardFC;
    
    

    Is there a way to delete all of them (drivers, vehicles, cargo units, gunners...)?

    It doesnt work with

    {deleteVehicle _x} foreach units FC1grp; {deleteVehicle _x} foreach units convoyGuardFC;
    

    If the convoy is destroyed, I want to spawn the same convoy again, so I think I need to delete the old one because otherway there would be a name-problem?!

    It is possible that a driver of any vehicle has disembarked. So I cant refer to driver vehicle and need to refer to the whole group.

×