Jump to content
LSValmont

vehicles array fails to list some holders...

Recommended Posts

So Arma 3 holders are created via the createVehicle command and therefore should be listed/returned when using the vehicles command (https://community.bistudio.com/wiki/vehicles) yet some of the holders are not properly returned.

 

Example: playing as a playable unit, drop your weapon, the cursorTarget when pointing at the weapon on the ground is "GroundWeaponHolder"

 

Yet using the vehicles command shows an empty array when the weapon is on the ground failing to get the "GroundWeaponHolder":

 

vehicles select {(typeOf _x) in ["WeaponHolderSimulated", "GroundWeaponHolder", "WeaponHolderSimulated_Scripted"]};

PS: I am hosting the server (non dedicated) so the weaponHolder should be local to me.

 

Any ideas if this is a bug?

Share this post


Link to post
Share on other sites

Dropping your weapon places it in a GroundWeaponHolder, so talking about them specifically, they aren't returned by the vehicles command (as it says in the description, it only returns WeaponHolderSimulated). The parents for a GroundWeaponHolder are:

["WeaponHolder","ReammoBox","Strategic","Building","Static","All"]

Using nearestObjects will capture a GroundWeaponHolder though.

Share this post


Link to post
Share on other sites
1 hour ago, beno_83au said:

Dropping your weapon places it in a GroundWeaponHolder, so talking about them specifically, they aren't returned by the vehicles command (as it says in the description, it only returns WeaponHolderSimulated). The parents for a GroundWeaponHolder are:


["WeaponHolder","ReammoBox","Strategic","Building","Static","All"]

Using nearestObjects will capture a GroundWeaponHolder though.

 

That is indeed weird... since all holders are supposed to be "vehicles".

 

I guess that my super optimized Weapon Holder Cleaning Fnc will not work on player dropped weapons:

 

// [] spawn vHandleHolders;
vHandleHolders = {
	private _holdersArray = [];
	_holdersArray = vehicles select {(typeOf _x) in ["WeaponHolderSimulated","GroundWeaponHolder","WeaponHolderSimulated_Scripted"]};
	if (_holdersArray isEqualTo []) exitWith {};
	{
		private _pos = getPos _x;
		private _seenBy = [];
		_seenBy = allPlayers select {_x distance _pos < 100};
		if (_seenBy isEqualTo []) then {
			deleteVehicle _x;
		};
		sleep (1 + (random 2));
	} forEach _holdersArray;
};

And nearestObjects for the whole map is out of the question in terms of performance.

Share this post


Link to post
Share on other sites

Is allMissionObjects of any use here?

I'm not at all familiar with all the various 'WeaponHolder' classnames.

 

A quick test in the debug console detected 1 dropped MX, and an IR Laser Pointer - Which was dropped separately.

 

_holdersArray = allMissionObjects "WeaponHolder"

 

  • Like 1

Share this post


Link to post
Share on other sites
2 hours ago, Maff said:

Is allMissionObjects of any use here?

I'm not at all familiar with all the various 'WeaponHolder' classnames.

 

A quick test in the debug console detected 1 dropped MX, and an IR Laser Pointer - Which was dropped separately.

 


_holdersArray = allMissionObjects "WeaponHolder"

 

 

It seems allMissionObjects is very resource intensive specially for Multiplayer Servers. 

 

Entities is a faster alternative but still not nearly as fast as vehicles.

https://community.bistudio.com/wiki/entities

 

_holders = entities [["weaponHolder"], [], false, true];

 

For some reason entities ALSO do not work for player dropped weapons:

 

_holders = entities [["GroundWeaponHolder"], [], false, true]; // Returns [ ] // Even thou the player weapon is on the floor as a "GroundWeaponHolder";

_holders = entities [["WeaponHolderSimulated"], [], false, true]; // Returns [203888dd600# 812: dummyweapon.p3d,2038fb65600# 1277 ] but only detects Ai Dropped weapons.

 

But allMissionObjects works:

 

_holders = allMissionObjects "GroundWeaponHolder"; // returns [20380e3d600# 1308: dummyweapon.p3d ]

 

It seems like player dropped weapons and its "GroundWeaponHolder" behave different from all other weapon Holders. Does it ever get deleted?

Share this post


Link to post
Share on other sites
5 hours ago, LSValmont said:

 

So Arma 3 holders are considered vehicles and therefore should be listed

 

Vehicle is a very wide term when used in Arma. Could you give specific quote where holders are considered vehicles?

Share this post


Link to post
Share on other sites
9 hours ago, killzone_kid said:

Vehicle is a very wide term when used in Arma. Could you give specific quote where holders are considered vehicles?

 

Well, for starters they are created via createVEHICLE .... 😏 https://community.bistudio.com/wiki/createVehicle

_wh = "GroundWeaponHolder_Scripted" createVehicle position player;
player action ["DropWeapon", _wh, currentWeapon player];

Additionally the vehicles command DOES returns most holders, it is just player dropped weapons that it does not return.

 

I believe that is quite significant proof.

 

As you very well said, vehicles is a wide term in Arma and it includes most of the holders bare one or two classes of holders and that is the inconsistency. (Like what is the explanation or the reason behind that).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×