Jump to content

Undeceived

Member
  • Content Count

    1977
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by Undeceived


  1. I have another question here that has me racking my brains... @Larrow's code copies the subcontainers (uniforms, vests, backpacks) and their content to the end container (crate). The stuff stays in the subcontainers.

     

    How would the code have to look like when you want to empty ("pour out", so to speak) the subcontainers into the crate, so that the contents of the uniforms, vests and backpacks are directly in the crate, not in the subcontainers anymore?

     

    I hope my question is understandable. 😅

     

     

     


  2. Thanks, @Clayman, and sorry for the late reply, I was busy with other things in the project. Now I got back to this.
    I couldn't make it work with your code, but I managed to use Larrow's code here as basis to make it work somehow.

     

     

    Collect items, magazines and weapons (in weaponsItems format) from a trigger area, INCLUDING everything that is inside a container (e.g. vest or uniform) and copy everything to a container:

    Spoiler

     

    
    _trigger = TRIGGER1; 
    _targetContainer = CRATE1;
    
    //1:
    //Create array of all WeaponHolders in _trigger area (which means that you can place stuff in different places in the trigger area):
    
    _weaponHoldersInTriggerArea = (nearestObjects [_trigger, ["WeaponHolder", "WeaponHolderSimulated"], selectMax ((triggerArea _trigger) select [0, 2])]) select {_x inArea _trigger};
    
    
    //2:
    //Let the magic begin:
    //Larrow's GET and SET code, slightly adapted:
    
    {
    	_nul = [_x] call {
    
    		//GET:
    		_container = _this;
    		
    		TAG_fnc_getContents = {
    			params[ "_container" ];
    			
    			private _cargo = [ 
    				weaponsItemsCargo _container call BIS_fnc_consolidateArray,
    				( itemCargo _container select{ !( toLowerANSI( _x call BIS_fnc_itemType select 1 ) in [ "backpack", "uniform", "vest" ] ) } ) call BIS_fnc_consolidateArray,
    				magazinesAmmoCargo _container call BIS_fnc_consolidateArray
    			];
    			
    			private _containerCargo = everyContainer _container;
    			{
    				_x params[ "_type", "_object" ];
    
    				_containerCargo set[ _forEachIndex, [ _type, _object call TAG_fnc_getContents] ];
    			}forEach _containerCargo;
    			
    			[ _cargo, _containerCargo ]
    		};
    
    		_contentWeaponHolder = _container call TAG_fnc_getContents;
    
    
    		//SET:
    		TAG_fnc_setContents = {
    			params[ "_container", "_contents" ];
    			_contents params[ "_cargo", "_containers" ];
    			
    			{
    				_x params[ "_cont", "_contents" ];
    				
    				_every = everyContainer _container;
    				if ( _cont call BIS_fnc_itemType select 1 == "backpack" ) then {
    					_container addBackpackCargoGlobal[ _cont, 1 ];
    				}else{
    					_container addItemCargoGlobal[ _cont, 1 ];
    				};
    				_addedContainer = ( everyContainer _container - _every ) select 0 select 1;
    				
    				clearItemCargoGlobal _addedContainer;
    				clearWeaponCargoGlobal _addedContainer;
    				clearBackpackCargoGlobal _addedContainer;
    				clearMagazineCargoGlobal _addedContainer;
    				
    				[ _addedContainer, _contents ] call TAG_fnc_setContents;
    			}forEach _containers;
    			
    			_fnc_addContents = {
    				params[ "_index", "_details", "_count" ];
    				
    				switch ( _index ) do {
    				
    					case ( 0 ) : {
    						_container addWeaponWithAttachmentsCargoGlobal[ _details, _count ];
    					};
    				
    					case ( 1 ) : {
    						_container addItemCargoGlobal[ _details, _count ];
    					};
    					
    					case ( 2 ) : {
    						_details params[ "_mag", "_ammo" ];
    						
    						_container addMagazineAmmoCargo[ _mag, _count, _ammo ];
    					};
    				};
    			};
    			
    			{
    				private _index = _forEachIndex;
    				{
    					_x params[ "_item", "_count" ];
    
    					[ _index, _item, _count ] call _fnc_addContents;
    				}forEach _x;
    			}forEach _cargo;
    			
    		};
    
    		[ _targetContainer, _contentWeaponHolder ] call TAG_fnc_setContents;
    
    	}
    
    } forEach _weaponHoldersInTriggerArea;

     

     

     

     

    Small note: Uniforms, vests and backpacks will stay filled in the container with their content, like they were laying on the ground.

    If you want to "empty" the subcontainers in the target container (so that their content is outside of them in the target container), check Larrow's answer here. Super simple.

    • Like 1

  3. On 8/23/2020 at 9:39 PM, Larrow said:

    Suppose it depends on if you want to store weapons and their current attachments, mags and ammo count and magazines with ammo count.

      Hide contents
    
    
    
    //_container = myBox; //Some container name given in editor
    _container = cursorObject;
    
    TAG_fnc_getContents = {
    	params[ "_container" ];
    	
    	private _cargo = [ 
    		weaponsItemsCargo _container call BIS_fnc_consolidateArray,
    		( itemCargo _container select{ !( toLowerANSI( _x call BIS_fnc_itemType select 1 ) in [ "backpack", "uniform", "vest" ] ) } ) call BIS_fnc_consolidateArray,
    		magazinesAmmoCargo _container call BIS_fnc_consolidateArray
    	];
    	
    	private _containerCargo = everyContainer _container;
    	{
    		_x params[ "_type", "_object" ];
    		
    		_containerCargo set[ _forEachIndex, [ _type, _object call TAG_fnc_getContents ] ];
    	}forEach _containerCargo;
    	
    	[ _cargo, _containerCargo ]
    };
    
    //Get the contents
    _containerContents = _container call TAG_fnc_getContents;
    
    //Clear out cargo
    clearItemCargoGlobal _container;
    clearWeaponCargoGlobal _container;
    clearBackpackCargoGlobal _container;
    clearMagazineCargoGlobal _container;
    
    TAG_fnc_setContents = {
    	params[ "_container", "_contents" ];
    	_contents params[ "_cargo", "_containers" ];
    	
    	{
    		_x params[ "_cont", "_contents" ];
    		
    		_every = everyContainer _container;
    		if ( _cont call BIS_fnc_itemType select 1 == "backpack" ) then {
    			_container addBackpackCargoGlobal[ _cont, 1 ];
    		}else{
    			_container addItemCargoGlobal[ _cont, 1 ];
    		};
    		_addedContainer = ( everyContainer _container - _every ) select 0 select 1;
    		
    		clearItemCargoGlobal _addedContainer;
    		clearWeaponCargoGlobal _addedContainer;
    		clearBackpackCargoGlobal _addedContainer;
    		clearMagazineCargoGlobal _addedContainer;
    		
    		[ _addedContainer, _contents ] call TAG_fnc_setContents;
    	}forEach _containers;
    	
    	_fnc_addContents = {
    		params[ "_index", "_details", "_count" ];
    		
    		switch ( _index ) do {
    			//weapons
    			case ( 0 ) : {
    				_container addWeaponWithAttachmentsCargoGlobal[ _details, _count ];
    			};
    			//items
    			case ( 1 ) : {
    				_container addItemCargoGlobal[ _details, _count ];
    			};
    			//magazines
    			case ( 2 ) : {
    				_details params[ "_mag", "_ammo" ];
    				
    				_container addMagazineAmmoCargo[ _mag, _count, _ammo ];
    			};
    		};
    	};
    	
    	{
    		private _index = _forEachIndex;
    		{
    			_x params[ "_item", "_count" ];
    
    			[ _index, _item, _count ] call _fnc_addContents;
    		}forEach _x;
    	}forEach _cargo;
    	
    };
    
    //Add cargo back in
    [ _container, _containerContents ] call TAG_fnc_setContents;

    Needs thoroughly testing.

     

    Just thank you, @Larrow You're a mastermind. 😄

    Lil' beer incoming.

    • Thanks 1

  4. Hi @Schatten @bad benson (or others who can help), how are you guys doing? After 5 years, I have another question on this topic:

     

    Is there a way to include items, magazines and weapons (in weaponsItems format) that are inside a container (e.g. vest or uniform) which is lying in the "collector" trigger area?

     

     

     

    EDIT:

     

    Brief summary of what I'm looking for:

     

    This code creates an array of all items, magazines and weapons that are on the ground in a trigger area (if I'm not mistaken, more precise, they're in a WeaponHolder in that trigger area). Later in the code, I also put all the stuff in a crate.

     

    Spoiler
    
    _trigger = triggerName;  
    _stuff = [[],[],[],[]];
      
    _objs = (nearestObjects [_trigger, ["WeaponHolder", "WeaponHolderSimulated"], selectMax ((triggerArea _trigger) select [0, 2])]) select {_x inArea _trigger};   
      
    _objs inAreaArray _trigger apply   
    {  
     (_stuff select 0) append (weaponsItemsCargo _x);  
     (_stuff select 1) append (magazineCargo _x);
     (_stuff select 2) append (itemCargo _x);  
     (_stuff select 3) append (backpackCargo _x); 
    };
    
    
    //Now put stuff in crate:
    stuffInTriggerArea = _stuff;
    
    {crate addWeaponWithAttachmentsCargoGlobal [_x,1]; } forEach (stuffInTriggerArea select 0); 
    {crate addMagazineCargoGlobal [_x,1]; } forEach (stuffInTriggerArea select 1); 
    {crate addItemCargoGlobal [_x,1]; } forEach (stuffInTriggerArea select 2); 
    {crate addBackpackCargoGlobal [_x,1]; } forEach (stuffInTriggerArea select 3);

     

     

    Now I'd like to expand this code so it also gets items, mags and weapons that are in containers (e.g. vests, uniforms) which are in this trigger area.

     

    Any help would be much appreciated, thanks!


  5. On 3/13/2023 at 11:42 PM, Undeceived said:

    Really low FPS twice throughout the mission. Can't really tell when exactly this happened, there was a lot of action and movement, but this doesn't seem to be related to my PC. The FPS dropped down to 12 or so and I had to close Arma and reload several times until it somehow fixed the problem.

    Just a small addition: I noted that this is indeed a problem on my end, so nevermind.


  6. Hello everyone, after 5 years here comes a small update (see first post). Thanks to Maxjoiner's support, the Max Life Pack is now part of the download (it wasn't on SW anymore and vanished from Armaholic obviously).

     

    If you are interested and played this before, maybe try to find another ending. 🤪

     

     

    • Like 1
    • Thanks 2

  7. Played the SP mission and here's my feedback. It was really a great mission. Having to return to the FOB with the intel for analysis somehow motivated me as hell. The side objectives were good too. Had some great playing sessions.

     

    Downsides which lowered the quality:

    • I had problems with the UAV (which was a pity because using it was a lot of fun!). When I was in the turret, the UAV itself began moving and turning around wierdly. Auto hovering was on obviously. Altitude maybe? I was at 200 m and then tested it at 150 m but maybe this was still to high? Eventually it stopped moving like that and I could use it again but in the last fight the problem started again so I just abandoned it.
    • Really low FPS twice throughout the mission. Can't really tell when exactly this happened, there was a lot of action and movement, but this doesn't seem to be related to my PC. The FPS dropped down to 12 or so and I had to close Arma and reload several times until it somehow fixed the problem.
    • The UAV turret starts shooting on known enemies when you select another unit
    • When I attacked a location, some enemies would just stand around, not reacting. Only when shot at.

    Especially the last two points should have been a bit better in such an official release.

     

    All in all this was money well spent though. Congratulations on the release!

    • Like 1
    • Thanks 1

  8. 2 hours ago, Undeceived said:

    Cutscenes in the mission section can't be skipped

    Uh, isn't this possible by now? I remember some cutscenes in newer Bohemia DLC where you can press Space to skip... Can anyone point me in the right direction, how the command is called?

     

     

    Edit:
    Searched for this in the official pbo.s (e.g. Laws of War) and found something like fnc_skip, but this seems way too complicated... I probably have to give up on this.

×