Jump to content

Lucky44

Member
  • Content Count

    359
  • Joined

  • Last visited

  • Medals

Posts posted by Lucky44


  1. Thanks, Pierremgi and Larrow for the replies.

     

    Correct me if I'm wrong, but in both your points, the problem isn't that the helo isn't waiting long enough to land or landing too soon. The problem is that it won't land, that it gets stuck hovering. So making it wait until "unitReady" would not make it more free to land, would it? 

     

    But I tried both solutions and nothing changed.

     

    Here's the code I changed it to:

    while {(_helo distance2D (getMarkerPos "WPair3")) >= 280} do {
    	sleep 2;
    };
    sleep 2;
    
    waitUntil {unitReady _helo};
    doStop _helo;
    _helo land "land";

    FWIW, I also tried removing the "doStop _helo" line, but that made no difference.

     

    As I said, it all works fine in single player, but on a dedi server, the helos won't land. Something about the dedi server is the problem, I think.


  2. I'm spawning 6 helos (one at a time), flying them into a location, having them land, then spawning infantry on the ground nearby (to simulate them getting out of the helos), then having the helos fly off. 

     

    It works fine in SP, but when I run it on a dedi server, the helos won't land, they just hover near the landing spot.

     

    I do have a bunch of helipads on the ground for them to land on. (More than one gets to the ground simultaneously, so I need multiple.) And as I said, it works fine in SP. I have to think it's something to do with the land command, that it doesn't work the same on a dedicated server.

     

    Here's the code called each time through a loop (once per helo spawn) - 

    _airGrp= createGroup east;
    
    			_Air1 = [getMarkerPos "spawnAir", 0, "O_Heli_Transport_04_covered_F", _AirGrp] call bis_fnc_spawnvehicle; // this spawns the aircraft and includes crew
    			//_Air1 is the VEHICLE array, with the actual vehicle being the first element of the array!! (Select 0)
    			_helo = (_Air1 select 0);//give it a shorter name!
    
    			_wp1 = _airGrp addWaypoint [getMarkerPos "WPair1", 0];
    
    			_wp2 = _airGrp addWaypoint [getMarkerPos "WPair2", 0];
    			_wp2 setWaypointSpeed "limited";
    
    			_wp3 = _airGrp addWaypoint [getMarkerPos "WPair3", 0];
    			_wp3 setWaypointSpeed "limited";
    			_wp3 setWaypointStatements ["true", "this flyinHeight 25"];
    
    			while {(_helo distance2D (getMarkerPos "WPair3")) >= 100} do {
    				sleep 2;
    			};
    			sleep 2;
    				doStop _helo;
    				_helo land "land";
    
    			while {(getPosATL _helo) select 2 >=1 } do {
    	//			hint format ["alt = %1", (getPosATL _helo) select 2]; //debugging only!!!!!!!!!!!!!
    				sleep 1;
    			};
    			sleep 2;//time to unload (fictional) troops
    			  --spawn the infantry now--
    			sleep 25;
    
    
    			_helo doMove (getmarkerPos "WPair4");
    			_wp4 = _airGrp addWaypoint [getMarkerPos "WPair4", 0];
    			_wp4 setWaypointType "MOVE";
    			_wp4 setWaypointSpeed "FULL";

    I've had this issue in the past, but it's been years since I dealt with it, and I can't remember a solution! Any clues?


  3. Yes, we generally run CUP, and we use ACE3 Medical (Basic, atm).

     

    That would explain why I couldn't get the killer and killed straight! I tried switching the two vars, switching the output, etc. but it never worked.

     

    Does anyone know a way to make KK's simple code work with ACE3 Medical? (or have an alternative approach)?


  4. 24 minutes ago, killzone_kid said:

    Sorry, you want my answer? If so, I have nothing more to add, the snippet I gave you works in MP i have just checked. Well in fact I've just checked it on stable since I downloaded it for something. It goes in init.sqf and boom it works for everyone.

     

    Thanks. And should it work for spawned units?


  5. I really appreciate the input!

     

    My goals for this script would be 

    1. It has to work on dedi server in MP.
    2. Has to work for spawned as well as placed AI civs.
    3. Note whenever a player (or it could be by faction: West) kills a civilian human.
    4. Keep running count of total.
    5. Publish message (hint is fine) to everyone showing who the player was, and use the player's profile name.
    6. Originally, the mission would end if the # of civs killed hit a set amount. Maybe not do that and show the count and the killers' names at the end of mission too, but that's a detail.

    I'll try the code y'all sent.

     

    UPDATE: KK's code works in SP to ID the unit name of the civ killer but not MP.  

     

    Does anyone see anything wrong with the Shuko code, for the current Arma 3 environment? -I'm not married to that code, but it does address #s 1-6 above.


  6. I have used Shuko's script to monitor when players kill civilians and then identify the killer. But it seems that it doesn't work in Arma 3 anymore. Does anyone have a solution to this or an alternative way to do this?

     

    Here's the code I had been using:

    //////////////////////////////////////////////////////////////////
    // Count Civ Deaths,
    // Consider which faction killed them,
    // Identify killer in hint to everyone.
    // Created by: Shuko
    //////////////////////////////////////////////////////////////////
     
     
    ////////////////////////CIVILIAN DEATH LIMIT/////////////////////////////////////////////////////////////
    SHK_DeadCivilianLimit =  99; // Set as specific number OR (paramsarray select 2) <--set in Description.ext
    SHK_DeadCivilianCount = 0;
    SHK_DeadCivilianArray = [SHK_DeadCivilianCount, objNull];
    SHK_EndMission = false;
     
    [] spawn {
      waituntil {SHK_EndMission};
      cuttext ["Mission Failure!\nUnfortunately, your team killed too many civilians.","PLAIN",2];
      sleep 10;
      endmission "END2";
    };
     
    SHK_fnc_deadCivilians = {
      _count = _this select 0;
      _killer = _this select 1;
      hintSilent format ["Civilians dead: %1 \nLast civ killer: %2", _count, name _killer];
     
      if (_count >= SHK_DeadCivilianLimit) then {
        SHK_EndMission = true;
        publicvariable "SHK_EndMission";
      };
    };
     
    SHK_eh_killed = {
      private "_side";
      _killer = _this select 1;
      _side = side _killer;
      //Set the players' side in next line
      if (_side == WEST) then {
        SHK_DeadCivilianCount = SHK_DeadCivilianCount + 1;
        SHK_DeadCivilianArray = [SHK_DeadCivilianCount, _killer];
        publicvariable "SHK_DeadCivilianArray";
        if isdedicated then {
          if (_this >= SHK_DeadCivilianLimit) then {
            SHK_EndMission = true;
            publicvariable "SHK_EndMission";
          };
        } else {
          [SHK_DeadCivilianCount, _killer] call SHK_fnc_deadCivilians;
        };
      };
    };
     
    if isserver then {
      {
        if (side _x == Civilian && _x iskindof "Man") then {
          _x addEventHandler ["killed", SHK_eh_killed];
        };
      } foreach allunits;
    } else {
      "SHK_DeadCivilianArray" addpublicvariableeventhandler {
        _array = _this select 1;
        _count = _array select 0;
        _killer = _array select 1;
        [_count, _killer] call SHK_fnc_deadCivilians
      };
    };
     
    [] spawn {
      waituntil {!isnil "BIS_alice_mainscope"};
      waituntil {!isnil "bis_fnc_variablespaceadd"};
      [BIS_alice_mainscope,"ALICE_civilianinit",[{_this addEventHandler ["killed", SHK_eh_killed]}]] call bis_fnc_variablespaceadd;
    };

     

    • Like 1

  7. Yeah, I guess the problem is that I'm trying to create a Virtual Arsenal that has 99.9% of the possible items in it, including the mods my group uses. So I really only want to Blacklist a dozen or two things. So any approach where I have to whitelist everything I want to include is not going to work, it seems, right?

     

    I looked at your linked scripts/functions. If I understand correctly, they require a whitelist. I can't do that by adding whole classes (like configFile >> "CfgWeapons"), can I?

     

    I am just looking for a way to restrict 10-20 items from a VA crate w/o having to whitelist every single item that is acceptable. -You'd think that BIS would make such a method!!


  8. Thanks for that explanation, Larrow. I can't say that I understood it all. But I was able to get the bottom section of code to work, creating a blacklist of items that don't appear in the crate, while everything else does. I have one problem still, though: if an item (e.g., the compact titan launchers in my list above) is in the blacklist, it doesn't appear in the crate, but it will still get given to someone who has it in their saved loadouts. That's true even if they don't have one in their current inventory. I'm testing this on a MP server, by the way.

     

    Any ideas how to prevent the blacklisted gear from showing up if it's someone's  saved loadouts?

     

    Also, I assume that you do not find bis_fnc_removevirtualweaponcargo useful, correct?


  9. Thanks for the reply, Revo.

     

    I tried this:

     

    #define BOX VA1
    
    //Create a full arsenal
    ["AmmoboxInit", [BOX,true]] spawn BIS_fnc_arsenal;
    //Retrieve all items
    private _magazines = BOX call BIS_fnc_getVirtualMagazineCargo;
    private _weapons = BOX call BIS_fnc_getVirtualWeaponCargo;
    private _items = BOX call BIS_fnc_getVirtualItemCargo;
    private _backpacks = BOX call BIS_fnc_getVirtualBackpackCargo;
    //Remove full arsenal
    ["AmmoboxExit",[BOX]] spawn BIS_fnc_arsenal;
    sleep 2;
    hint "New Arsenal created";
    //Create new empty arsenal
    ["AmmoboxInit", [BOX]] spawn BIS_fnc_arsenal;
    //Add all items
    [BOX,_magazines] call BIS_fnc_addVirtualMagazineCargo;
    [BOX,_weapons] call BIS_fnc_addVirtualWeaponCargo;
    [BOX,_items] call BIS_fnc_addVirtualItemCargo;
    [BOX,_backpacks] call BIS_fnc_addVirtualBackpackCargo;
    
    /*The Arsenal can now be edited freely*/
    
    [BOX,_backpacks] call BIS_fnc_removeVirtualBackpackCargo;
    
    [BOX, ["launch_B_Titan_short_F", "launch_B_Titan_short_tna_F",  "launch_O_Titan_short_F", "launch_I_Titan_short_F","launch_I_Titan_short_ghex_F"] ] call BIS_fnc_removeVirtualWeaponCargo;

    And it creates a VA crate, and then it removes the backpacks, but it won't remove the launchers. Any idea why that would be?


  10. Thanks for your reply, R3vo. Are you saying that you need to first whitelist anything that you're going to blacklist? I looked at the link and I tried this:

     

    EDIT: I changed the BIS_fnc_removeVirtualItemCargo to BIS_fnc_removeVirtualWeaponCargo, but that didn't change anything.

    handle = ["AmmoboxInit", [this,true,{true}]] spawn BIS_fnc_arsenal;
    [VA1, ["launch_B_Titan_short_F", "launch_B_Titan_short_tna_F",  "launch_O_Titan_short_F", "launch_I_Titan_short_F","launch_I_Titan_short_ghex_F"], true] call BIS_fnc_addVirtualWeaponCargo;
    [VA1, ["launch_B_Titan_short_F", "launch_B_Titan_short_tna_F",  "launch_O_Titan_short_F", "launch_I_Titan_short_F","launch_I_Titan_short_ghex_F"] ] call BIS_fnc_removeVirtualWeaponCargo; 

    But it didn't do anything. Am I missing something?


  11. I've been trying everything I can think of to make this work, and nothing seems to do anything. I've read this over and tried various approaches, but nothing is working to limit the objects from the crate.

     

    I've tried putting the code in the init box of the crate (with the crate names VA1), like this:

    handle = ["AmmoboxInit", [this,true,{true}]] spawn BIS_fnc_arsenal; 
    [ VA1, ["launch_B_Titan_short_F", "launch_B_Titan_short_tna_F",  "launch_O_Titan_short_F", "launch_I_Titan_short_F","launch_I_Titan_short_ghex_F"] ] call BIS_fnc_removeVirtualItemCargo; 

    And I've tried calling the code in other ways. 

     

    Am I doing something wrong? Any suggestions??


  12. Thanks for trying to help, all.

     

    But frankly, this is not helping! I would benefit from examples, for one thing. Let me be more clear about what I don't understand and what might help.

     

    Say I want to put a trigger on the map to detect BluFor Present. Let's skip the fact that triggers on the map have their own sets of problem for now. And when the trigger conditions become true, I want to run a script called myScript1.sqf. It has no arguments. How would I script that with remoteExec?

     

    Another example, I want to addAction to an object to hide it (aka run a script that makes it drop into the ground then deleteVehicle's it. I'm thinking it's better to put the code in the initFramework.sqf rather than in the init box of the object - would there be a difference in how remoteExec would be used there? How would I code it if the script is called hideObject.sqf?

     

    Let's just start with those examples. I'm sure I'll have questions after seeing the syntax!

     

    Thanks in advance for the help!


  13. I have a decent understanding of locality. And I've read the Biki pages on BIS_fnc_MP and remoteExec. I understand that remoteExec is the newer, preferred approach, but that the other still works too.

     

    But I have not been able to wrap my head around the syntax/usage of either of these. So I'm asking for someone who really does understand them to expand on what the Biki has and explain the usage -not just syntax, but how to use it in different situations. A variety of examples (and why it's done the way it's done in each example, and the effects of the variations) would be awesome.

     

    Anyone able to do this? It'd be a real benefit to all of us who make multiplayer missions!


  14. OK, so while I have your knowledge, can I go back to the original question? How should I use either remoteExec or BIS_fnc_MP to call a script to fire? Both in a trigger or from another script?

     

     

    -Really, what I'm looking for is a better explanation of the syntax for those two things; the wiki is not very clear to me! 

     

    EDIT: I'm going to start a new thread to ask for some good explanation on these. https://forums.bistudio.com/topic/193288-a-better-explanation-of-bis-fnc-mp-and-remoteexec-please/

×