Jump to content

realZNorQ

Member
  • Content Count

    18
  • Joined

  • Last visited

  • Medals

Posts posted by realZNorQ


  1. I created a simple add-on which will contain a few resources such as scripts and images, and I'm using "Arma 3 Tools" -> "Addon Builder"

    to pack into a pbo-file and add it to the game. Game loads add-on, no problems.

     

    Lets say the directory structure is as follows;

     

    NSF4Resources

     - img

     - sqf

     

    The "NSF4Resources" folder is the highest level which "Addon builder" uses, so the add-on will become "NSF4Resources.pbo". Under

    img and sqf there are various files that I want to use during a set of missions I'm making. The problem is when I'm trying to reference

    to the files - I can't reach them. Let's say under img there is a file called "overview.jpg" - what would the path be?

     

    PS! The actual finished pbo is placed under a folder called @nsf/addons/NSF4Resources.pbo, and I use "ArmA3Launcher" -> "Mods" ->

    "Local Mod" to add it to the game (and yes, I make sure that the mod is also in "loaded mods"-list).

     

    Oh, and I've also experimented with the "Addon Prefix" (putting in "nsf4" ) in the "Addon Builder".

     

    I've tried to find documentation on this - but all my search attempts just ends up on a discussion on where to put the acutal pbo-file.

     

    Kenneth aka ZNorQ

     


  2. 12 hours ago, Grumpy Old Man said:

    Might be, not sure though, if a member of a group dies the group doesn't instantly reflect that, depending on line of sight etc, so a groups status will only update once in a while or if they witness a units death directly.

    Can be  sped up using the "report status" radio command when in the same group.

    Same could be the case for the group leader, if no one saw him die it might take a while until a new one will take command.

     

    Would be more reliable to check via object array than using the group, like so:

    
    _toCheck = units TAG_grp_someGroup;
    {
    	_x setVariable ["TAG_arr_toCheck",_toCheck];
    	_x addEventhandler ["Killed",{
    		params ["_killed"];
    		_toCheck = _killed getVariable ["TAG_arr_toCheck",[]];
    		if (count (_toCheck select {alive _x}) isEqualTo 0) then {
    			hint "Everyone dead!";
    		}
    	}];
    } forEach _toCheck;

     

    Cheers

     

    Thank you for your suggestion, I will try this out too! 🙂


  3. 11 hours ago, killzone_kid said:

    Here is the solution:
     

    
    _tr = createTrigger ["EmptyDetector", [worldSize / 2, worldSize / 2], false]; 
    _tr setTriggerArea [worldSize, worldSize, 0, true]; 
    _tr triggerAttachVehicle [leader _group]; 
    _tr setTriggerActivation ["MEMBER", "NOT PRESENT", false]; 
    _tr setTriggerStatements ["this", "hint str 'AllDead'", ""];

    You create a trigger that covers whole map, and assign it to the leader of the group. "MEMBER" checks for any alive member of the group in trigger area. When all dead, NOT PRESENT condition is true and trigger activates. Simples.  

     

    Thanks killzone, I'll try this solution out - try to stress-test it :)


  4. But wouldn't that just check if the leader is dead, and not the whole group?

     

    I'm trying out the following code ...

     

    All groups I want to check if all units are dead have the following code in the group-init-box in 3DEN;

    this setVariable ["checkAllDead", true];

    The following code creates an eH for each unit in all groups that contain a variable "checkAllDead"=true

    false spawn
     { systemChat "starting eh";
      { systemChat format["Testing group %1", _x];
       if  ( _x getVariable [ "checkAllDead", false ] )
       then { _x setVariable [ "Total", count units _x ];
          _x setVariable [ "Dead", 0];
          _x setVariable [ "allDead", false ];
          systemChat format["Setting variables for %1!", _x];
          { _x addEventHandler 
           [ "Killed", 
            { params ["_unit", "_killer", "_instigator", "_useEffects" ]; 
             private _unitsGroup = group _unit;
             _unitsGroup setVariable[ "Dead", ( _unitsGroup getVariable "dead" ) +1 ];
             if ( ( _unitsGroup getVariable "Total" ) == ( _unitsGroup getVariable "dead" ) )
             then {_x setVariable [ "allDead", true ];};
             systemChat format[ "%1 died, shot by %2 (%3, %4)", _unit, _killer, _instigator, _useEffects ];
            }
           ];
           systemChat format["Added eh to %1", _x ];
          } forEach units _x;
          
         };
      } forEach allGroups;
     };

     

    What happens;

     

    Every time a unit gets killed in the flagged group, it adds to a death-counter "Dead" for the group that the unit belongs to.

    It then matches against "total" - how many in was part of the group initially. If the death-counter " and "total" is same, "allDead" is set to true.

     

    I'm not a very good coder - and it's been YEARS since my last sqf-endeavor- so be gentle in the critique! :P

     

    PS! I'm testing it out as I write this, so I'm not sure if it even works...

    PS2! systemChats shall be removed, of course.

     

    Kenneth aka ZNorQ.


  5. I'm creating a few triggers that contains the following code

    (count units group someNamedGroup) == 0

     

    However it took for ever for the engine to register that the group was empty, so I changed it to

    ({alive _x} count units someNamedGroup) == 0

    I suspect this may be an inefficient way to do it? What if there are tons for groups that I want checked...

    Are there better ways?

     

    Regards

    Kenneth aka ZNorQ


  6. On 23.1.2018 at 5:20 PM, HazJ said:

    As I stated, it worked for me but I only tested in SP Eden so I guess it must be MP only related. Try this:

    
    player addEventHandler ["WeaponDisassembled",
    {
    	params ["_unit", "_primaryBag", "_secondaryBag"];
    	deleteMarker format ["%1 (%2)", getText (configFile >> "CfgVehicles" >> (typeOf _primaryBag) >> "displayName"), (name _unit)];
    	hintSilent format ["Marker deleted: %1 (%2)", getText (configFile >> "CfgVehicles" >> (typeOf _primaryBag) >> "displayName"), (name _unit)];
    }];

     

     

    Sadly, it didn't work... :/

     

    I'm going to try something similar, but not through the configs. However, I'm not certain it will work globally for all players...


  7. 13 hours ago, HazJ said:

    Hm. Seems to work fine for me. Though then again, I have only tested with "Camp (Dome Tent)" type and in Eden SP, not MP. Can you provide more information please? If it the issue persists then you can probably use WeaponDisassembled EH with some code to delete the marker.

    Not sure what more info you need, but yes, it's in MP it is a problem. I use EDEN ofcourse to design the mission, and when I test it out in MP (only me as player though, and still within Eden), it is as stated earlier - won't move the marker when I disassemble/reassemble the tent.

    I've tried all three tents.

     

    I've tried the WeaponDisassembled, and I see I need the code to find the correct marker, find it and delete it. For that I guess I'm going to have to use allMapMarkers. To find the correct marker, I guess I have to use setVehicleVarName when assembling the tent so that I can easily find the correct on in allMapMarkers.

     

    It's been such a long time since I've scripted, so I have a lot to re-learn.


  8. When a (backpack) respawn tent have been assembled and then disassembled, it seems that the respawn map-marker will not be removed.

    Further, trying to re-assemble the tent does not move the map-marker, and only the previous respawn-position is  available in the respawn menu.

     

    Anyone know if this is an engine bug, or deliberate?

     

    PS! I'm using latest dev. build.

×