Jump to content
bLAcKmAgE87

loadFile script mash : used to speed up codes...

Recommended Posts

Just another topic... I am using loadFile to pull out a text file of an array I made for object creation and assortment.
However in the end it doesn't work out for me because I can't quite pull the text out of the array without getting a type error.
At least I tried.... 

I thought it was tricky enough pulling out the code and getting it into a character again, but I 
pulled it off and got it working around.


I'm sure there's a better way of making objects, or classes... 
 

Spoiler


private _contents = [] ;
_contents = loadFile "copyConfigViks.txt";

//hint (str _contents) ;

_contentsAry = [] ; 
_contentsAry = toArray _contents ;
//private _asChars = [] ; 
//private _asChars = toString _contentsAry ;
_numCharsFile = count _contentsAry ;

private _spotInLine = [] ;



for [{ private  _zx = 0 }, { _zx < _numCharsFile }, { _zx = _zx + 1 }] do   
{  

private _spotInFile = ""  ;
_spotInFile = ( _contentsAry select _zx ) ;
_spotInLine pushBack _spotInFile ;

//hint (str _spotInFile ) ;


//sleep .03 ; 

};

private _asWas = toString _spotInLine ; 
hint (str _asWas ) ;
_numCharsFile2 = count _asWas ;
sleep 2 ;
hint (str "GO" ) ;
sleep 2 ;
for [{ private  _ux = 0 }, { _ux < _numCharsFile2 }, { _ux = _ux + 1 }] do   
{ 

 private _spotInFile2 = ""  ;
_spotInFile2 = ( _asWas select [_ux,1] ) ;
hint (str _spotInFile2 ) ;

sleep 2 ;
};

/*
spotAsNum = _spotInFile ;
_spotAsChar = (str _spotInFile );
*/
//deception... follow suite ... make money off of pesky worthless moderators... free speech is valuable

 

 

Share this post


Link to post
Share on other sites
Spoiler


?imw=5000&imh=5000&ima=fit&impolicy=Lett
?imw=5000&imh=5000&ima=fit&impolicy=Lett
?imw=5000&imh=5000&ima=fit&impolicy=Lett
CONGRATS BLACKAMAGE! ON THIS DAY YOU EARNED THE RANK OF LANCE CORPORAL!!! 

?imw=5000&imh=5000&ima=fit&impolicy=Lett

 

Share this post


Link to post
Share on other sites

Cool concept, this seems like an excellent way to bring in large datasets without adding them directly to scripts. I'll have to play around with this and figure out some good ways to use it

 

Sidenote: It's really not clear in the post that you are trying to bring forward an interesting command and generate discussion on it. In the past, I have made several tutorial-like posts, you may wish to follow my format or expand upon it and you might have more luck

  • Like 1

Share this post


Link to post
Share on other sites

Using .txt files to import data is a quite nice thought. I have used it in the past to both save player data (such as steam ID, achievements, qualifications, etc.) as well as bring/read them back in ArmA (as part of a achievement tracking for an ArmA Unit).

 

Would you care to share the content of the external file to see what is the format before it is imported and compare it to the "end product" (imported array)?

  • Like 1

Share this post


Link to post
Share on other sites

Hey, that's a lot of information and I am not sure I completely follow your approach or what exactly you are trying to achieve.

 

I do see some redundancy in the first script you provided in the last answer (for example you have a lot of for-loops that iterate through the same array and you don't really use data from the previous iterations, which means you could possibly fit everything in a single go of the for-loop. Additionally you could use findIf instead of find which is a wee bit faster, especially for large arrays) but I may be mistaken because I don't get exactly what you are trying to achieve.

 

Thanks for sharing though.

  • Like 2

Share this post


Link to post
Share on other sites

https://community.bistudio.com/wiki/parseSimpleArray
ok getting hungry 


You are going to create a directory beyond your init... 

textsToKeep/fireTexts/...
baseAConfig.txt

baseAPop.txt

baseARow.txt 

will go in the fireTexts folder as blank texts...

 

I call for vehicles... 
I call for "[] execVM matrixZ.sqf"
it starts off and once done and ready brings me text on the clipboard

three times

...when you see the first list..pause... paste the text into the baseAConfig.txt
then the next list pops up fast... paste into baseAPop.txt..

same thing for rows...

restart your mission to really clear up variables...

 

I use an object called towerSt from the editor and start my mish running .... "arrayMatrixViks.sqf ".... that's what I called it in this version. 

It will call "funcOneZF.sqf" QUITE A FEW TIMES QUICKLY... CREATING DATA FOR OBJECTS... 

"funcOneZF.sqf" works with any object like vehicles, weapons, or people... 

 

I havent really tried buildings yet.. but I'm sure the concept is the exact same as I have used this procedure

in other scripts to create a maze and forest. 


The deficit: You can go through my older posts and see that it becomes a trigonometric challenge when ordering arrays of objects on the map.
They face the same direction everytime and so does the entire array. I'll fiix this up once I clean up this code. That... is all. Orientation leads to more math and calculus. 

 

EACH TIME YOU CHANGE YOUR MODS... YOU CHANGE YOUR LISTINGS... YOU CALL ONE OF THESE THREE FIRST FUNCTIONS/SQF

One for vehicles... "[] execVM matrixZ.sqf"

 

Spoiler

 	_gats = [] ;   
  
 	_gats =  "true" configClasses (configFile >> "CfgVehicles" ) ;   
 	_countEnt = count _gats ;   
   
 	_dogs = [] ;   
  
	 _scan = 'bin\config.bin/CfgVehicles/' ;  
 	_countScan = count _scan ;  
 	_type = _scan ;   
 	for [{ _p = 0 }, { _p < _countEnt  }, { _p = _p + 1 }] do   
 	{   
   
 		 _foolu = _gats select _p ;    
  		_strag = (str _foolu) ;   
  		_donk = _strag find _scan  ;   
  		 if(_donk != -1) then   
   		 {   
    			 _dogs pushBack _foolu ;   
  		 };   
 	};   
   
   
 	_countDogs = count _dogs ;    
 	_passers = []  ;   
   
 	for [{ _p = 0 }, { _p < _countDogs }, { _p = _p + 1 }] do   
 	{   
  		_stol = _dogs select _p ;   
  		_stool = (str _stol) ;   
    
     
  		_newBoyC = count _stool ;   
  		_newBoyC = _newBoyC - _countScan ;  
  		_newBoyC = _newBoyC  ;  
  
  		_donker = _stool select [ _countScan , _newBoyC ] ;   
   
    
   		_passers pushBack _donker ;    
   
 	};   
   
  
  
 	//_countDogs =100 ;
 	_wasted = [] ;  
 	_wasted2 = [] ;  
 	_wasted3 = [] ; 
 	for [{ _g = 0 }, { _g < _countDogs }, { _g = _g + 1 }] do   
 	{   
  		sloty = _passers select _g ;   
  		_configs = configProperties [configFile >> "CfgVehicles" >> sloty ];  
  		_configs2 =  getNumber (configFile >> "CfgVehicles" >> sloty >> "fuelCapacity" ) ;  
  		_configs3 = getText (configFile >> "CfgVehicles" >> sloty >> "_generalMacro" ) ;
 		_wasted pushBack _configs ;  
  		_wasted2 pushBack _configs2 ;  
  		_wasted3 pushBack _configs3 ;  
 	};  
   
 	_spotty = _wasted select 0 ;  


 
	_fuul = [] ;  

 	for [{ _v = 0 }, { _v < _countDogs }, { _v = _v + 1 }] do   
 	{ 
 		_slotzz = _passers select _v ;   
 		_slotzv = _wasted2 select _v ;

 		_scanz = '1' ;
 		_spoz = (str _slotzv ); 
 		_donkz = _spoz find _scanz ;

 
 		if( _slotzv > 0) then 
 		{ 
  			_fuul pushBack _slotzz ; 

 		}; 
  
 	}; 
 

	_countTankX = count ( _fuul ) ;


	_blame = "" ;
	_blame2 = "" ;
	_blameX = "" ;
	_blameX2 = "" ;

	lastW = 0 ;
	lastL = 0 ; 
	lastWx = 0 ;
	lastLx = 0 ;
	rowPing = 0 ;

	hint("loop layer starting") ;

	_dimenzOf = [] ;
	_dimenzRow = [] ;
	
	bumperSpot = 0 ;	

	
	private _objNamePass = "" ;

	for [{private _gh = 0 }, { _gh < _countTankX }, { _gh = _gh + 1 }] do
	{	
		bumperSpot = -1 ;
		
		_shells = 0 ; 
		_moments = []  ;
		slotG = _fuul select _gh ; 
		_inPar = _fuul select _gh ;
		_fun = (str _inPar) ;

		_configGM = getText (configFile >> "CfgVehicles" >> slotG >> "editorSubcategory" ) ;
		_configXM = getText (configFile >> "CfgVehicles" >> slotG >> "_generalMacro" ) ;
		_blame = _configGM ;
		_blamer = _blame2  ;
		_blame2 = _blame ;
		_blameX = _configXM ;
		_blameXr = _blameX2  ;
		_blameX2 = _blameX ;
		_welp = _blame find _blamer ;	
		if(_welp < 0 ) then
		{
			_gelp = _blameX find _blameXr ;		
			if( _gelp < 0  ) then
			{
				if(_gh  != 0) then
				{
					bumperSpot = _gh ;
					
					_shells = _gelp ; 
					_dimenzRow pushBack _gh ; 
				};
			};
		} ;
		
		private _posNews = [(0),(0),(0)] ;
		_objNamePass = 'xzobj'+ (str _gh)  ;
		private _blamz = 'zobj'+ (str _gh)  ;
		private _blamor = _objNamePass   ;

		_blamz = createVehicle [_inPar,_posNews ,[],0,"CAN_COLLIDE"];
		private _dimenz = boundingBoxReal _blamz ;

	
		_blamz enableSimulation false ;
		_blamz allowDamage false ;
		_blamz hideObject true ;
		 
		private _z1 = _dimenz select 0;
		private _z2 = _dimenz select 1;

		private _zW = abs ((_z2 select 0) - (_z1 select 0));
		private _zL = abs ((_z2 select 1) - (_z1 select 1));
		private _zH = abs ((_z2 select 2) - (_z1 select 2));

		
		_mb = [] ;
		_mi = [] ;
		_mw = [] ;
		_ml = [] ;
		_mh = [] ;
		_mbs = [] ;
		_msh = [] ;

		_mb pushBack (  _blamor) ;
		_mi pushBack ( _inPar ); 
		_mw pushBack (str _zW );
		_ml pushBack (str _zL );
		_mh pushBack (str _zH );
		_mbs pushBack (str bumperSpot) ; 
		_msh pushBack (str _shells ); 

		_moments pushBack ( _mb ) ;
		_moments pushBack ( _mi ); 
		_moments pushBack ( _mw );
		_moments pushBack ( _ml );
		_moments pushBack ( _mh );
		_moments pushBack ( _mbs ) ; 
		_moments pushBack ( _msh ); 
	
		
		_dimenzOf pushBack ( _moments) ; 
		
		//deleteVehicle _blamz ;

	};

	hint (str _fuul ) ;
	copyToClipBoard (str _fuul ) ; 
	sleep 2 ;


	hint (str _dimenzOf ) ;
	copyToClipBoard (str _dimenzOf ) ; 
	sleep 6 ;

	//_dimenzOf = toString (toArray _dimenzOf) ; 
	//hint(str _dimenzOf) ;

	

	hint (str _dimenzRow ) ;
	copyToClipBoard (str _dimenzRow ) ; 
	sleep 6 ;

/*

[[{"xzobj0"},{"Car"},{0},{0},{0},{-1},{0}],[{"xzobj1"},{"Motorcycle"},{0},{0},{0},{1},{-1}],[{"xzobj2"},{"Bicycle"},{0},{0},{0},{-1},{0}],[{"xzobj3"},{"Tank"},{0},{0},{0},{-1},{0}],[{"xzobj4"},{"APC"},{0},{0},{0},{-1},{0}],[{"xzobj5"},{"Air"},{0},{0},{0},{5},{-1}],[{"xzobj6"},{"Helicopter"},{0},{0},{0},{6},{-1}],[{"xzobj7"},{"Plane"},{0},{0},{0},{7},{-1}],[{"xzobj8"},{"Ship"},{0},{0},{0},{8},{-1}],[{"xzobj9"},{"SmallShip"},{0},{0},{0},{-1},{0}],[{"xzobj10"},{"BigShip"},{0},{0},{0},{-1},{0}],[{"xzobj11"},{"Truck"},{0},{0},{0},{11},{-1}],[{"xzobj12"},{"PaperCar"},{0.05},{0.05},{0.05},{-1},{0}],[{"xzobj13"},{"Plane_Base_F"},{0},{0},{0},{13},{-1}],[{"xzobj14"},{"F_35C_Base"},{0},{0},{0},{-1},{0}],[{"xzobj15"},{"F_35C"},{13.4198},{15.8662},{6.02942},{-1},{0}],[{"xzobj16"},{"F_35C_S"},{13.4198},{15.8662},{6.02942},{-1},{0}]]

*/

 

One for people... "[] execVM matrixZPeople.sqf"

Spoiler

 	_gats = [] ;   
  
 	_gats =  "true" configClasses (configFile >> "CfgVehicles" ) ;   
 	_countEnt = count _gats ;   
   
 	_dogs = [] ;   
  
	 _scan = 'bin\config.bin/CfgVehicles/' ;  
 	_countScan = count _scan ;  
 	_type = _scan ;   
 	for [{ _p = 0 }, { _p < _countEnt  }, { _p = _p + 1 }] do   
 	{   
   
 		 _foolu = _gats select _p ;    
  		_strag = (str _foolu) ;   
  		_donk = _strag find _scan  ;   
  		 if(_donk != -1) then   
   		 {   
    			 _dogs pushBack _foolu ;   
  		 };   
 	};   
   
   
 	_countDogs = count _dogs ;    
 	_passers = []  ;   
   
 	for [{ _p = 0 }, { _p < _countDogs }, { _p = _p + 1 }] do   
 	{   
  		_stol = _dogs select _p ;   
  		_stool = (str _stol) ;   
    
     
  		_newBoyC = count _stool ;   
  		_newBoyC = _newBoyC - _countScan ;  
  		_newBoyC = _newBoyC  ;  
  
  		_donker = _stool select [ _countScan , _newBoyC ] ;   
   
    
   		_passers pushBack _donker ;    
   
 	};   
   
  
  
 	//_countDogs =100 ;
 	_wasted = [] ;  
 	_wasted2 = [] ;  
 	_wasted3 = [] ; 
 	for [{ _g = 0 }, { _g < _countDogs }, { _g = _g + 1 }] do   
 	{   
  		sloty = _passers select _g ;   
  		_configs = configProperties [configFile >> "CfgVehicles" >> sloty ];  
  		_configs2 =  getNumber (configFile >> "CfgVehicles" >> sloty >> "canCarryBackPack" ) ;  
  		_configs3 = getText (configFile >> "CfgVehicles" >> sloty >> "_generalMacro" ) ;
 		_wasted pushBack _configs ;  
  		_wasted2 pushBack _configs2 ;  
  		_wasted3 pushBack _configs3 ;  
 	};  
   
 	_spotty = _wasted select 0 ;  


 
	_fuul = [] ;  

 	for [{ _v = 0 }, { _v < _countDogs }, { _v = _v + 1 }] do   
 	{ 
 		_slotzz = _passers select _v ;   
 		_slotzv = _wasted2 select _v ;

 		_scanz = '1' ;
 		_spoz = (str _slotzv ); 
 		_donkz = _spoz find _scanz ;

 
 		if( _slotzv > 0) then 
 		{ 
  			_fuul pushBack _slotzz ; 

 		}; 
  
 	}; 
 

	_countTankX = count ( _fuul ) ;


	_markST = getPos towerSt;


	_blame = "" ;
	_blame2 = "" ;
	_blameX = "" ;
	_blameX2 = "" ;

	lastW = 0 ;
	lastL = 0 ; 
	lastWx = 0 ;
	lastLx = 0 ;
	rowPing = 0 ;

	hint("loop layer starting") ;

	_dimenzOf = [] ;
	_dimenzRow = [] ;
	
	bumperSpot = 0 ;	

	
	private _objNamePass = "" ;

	for [{private _gh = 0 }, { _gh < _countTankX }, { _gh = _gh + 1 }] do
	{	
		bumperSpot = -1 ;
		
		_shells = 0 ; 
		_moments = []  ;
		slotG = _fuul select _gh ; 
		_inPar = _fuul select _gh ;
		_fun = (str _inPar) ;
		
		_configGM = getText (configFile >> "CfgVehicles" >> slotG >> "faction" ) ;
		_configXM = getText (configFile >> "CfgVehicles" >> slotG >> "genericNames" ) ;
	
		_blame = _configGM ;
		_blamer = _blame2  ;
		_blame2 = _blame ;
		_blameX = _configXM ;
		_blameXr = _blameX2  ;
		_blameX2 = _blameX ;
		_welp = _blame find _blamer ;	
		if(_welp < 0 ) then
		{
			_gelp = _blameX find _blameXr ;		
			if( _gelp < 0  ) then
			{
				if(_gh  != 0) then
				{
					bumperSpot = _gh ;
					
					_shells = _gelp ; 
					_dimenzRow pushBack _gh ; 
				};
			};
		} ;
		
		private _posNews = [(0),(0),(0)] ;
		_objNamePass = 'xzobj'+ (str _gh)  ;
		private _blamz = 'zobj'+ (str _gh)  ;
		private _blamor = _objNamePass   ;

		_blamz = createVehicle [_inPar,_posNews ,[],0,"CAN_COLLIDE"];
		private _dimenz = boundingBoxReal _blamz ;

	
		_blamz enableSimulation false ;
		_blamz allowDamage false ;
		_blamz hideObject true ;
		 
		private _z1 = _dimenz select 0;
		private _z2 = _dimenz select 1;

		private _zW = abs ((_z2 select 0) - (_z1 select 0));
		private _zL = abs ((_z2 select 1) - (_z1 select 1));
		private _zH = abs ((_z2 select 2) - (_z1 select 2));

		
		_mb = [] ;
		_mi = [] ;
		_mw = [] ;
		_ml = [] ;
		_mh = [] ;
		_mbs = [] ;
		_msh = [] ;

		_mb pushBack (  _blamor) ;
		_mi pushBack ( _inPar ); 
		_mw pushBack (str _zW );
		_ml pushBack (str _zL );
		_mh pushBack (str _zH );
		_mbs pushBack (str bumperSpot) ; 
		_msh pushBack (str _shells ); 

		_moments pushBack ( _mb ) ;
		_moments pushBack ( _mi ); 
		_moments pushBack ( _mw );
		_moments pushBack ( _ml );
		_moments pushBack ( _mh );
		_moments pushBack ( _mbs ) ; 
		_moments pushBack ( _msh ); 
	
		
		_dimenzOf pushBack ( _moments) ; 
		
		//deleteVehicle _blamz ;

	};

	hint (str _fuul ) ;
	copyToClipBoard (str _fuul ) ; 
	sleep 2 ;


	hint (str _dimenzOf ) ;
	copyToClipBoard (str _dimenzOf ) ; 
	sleep 6 ;

	//_dimenzOf = toString (toArray _dimenzOf) ; 
	//hint(str _dimenzOf) ;

	

	hint (str _dimenzRow ) ;
	copyToClipBoard (str _dimenzRow ) ; 
	sleep 6 ;



 


 

 

One for just weapons... "[] execVM matrixZWeapons.sqf"

Spoiler

 	_gats = [] ;   
  
 	_gats =  "true" configClasses (configFile >> "CfgVehicles" ) ;   
 	_countEnt = count _gats ;   
   
 	_dogs = [] ;   
  
	 _scan = 'bin\config.bin/CfgVehicles/' ;  
 	_countScan = count _scan ;  
 	_type = _scan ;   
 	for [{ _p = 0 }, { _p < _countEnt  }, { _p = _p + 1 }] do   
 	{   
   
 		 _foolu = _gats select _p ;    
  		_strag = (str _foolu) ;   
  		_donk = _strag find _scan  ;   
  		 if(_donk != -1) then   
   		 {   
    			 _dogs pushBack _foolu ;   
  		 };   
 	};   
   
   
 	_countDogs = count _dogs ;    
 	_passers = []  ;   
   
 	for [{ _p = 0 }, { _p < _countDogs }, { _p = _p + 1 }] do   
 	{   
  		_stol = _dogs select _p ;   
  		_stool = (str _stol) ;   
    
     
  		_newBoyC = count _stool ;   
  		_newBoyC = _newBoyC - _countScan ;  
  		_newBoyC = _newBoyC  ;  
  
  		_donker = _stool select [ _countScan , _newBoyC ] ;   
   
    
   		_passers pushBack _donker ;    
   
 	};   
   
  
  
 	//_countDogs =100 ;
 	_wasted = [] ;  
 	_wasted2 = [] ;  
 	
 	for [{ _g = 0 }, { _g < _countDogs }, { _g = _g + 1 }] do   
 	{   
  		sloty = _passers select _g ;   
  		_configs = configProperties [configFile >> "CfgVehicles" >> sloty ];  
  		_configs2 =  getText (configFile >> "CfgVehicles" >> sloty >> "_generalMacro" ) ;  
  		
 		_wasted pushBack _configs ;  
  		_wasted2 pushBack _configs2 ;  
  		
 	};  
   
 	_spotty = _wasted select 0 ;  


 
	_fuul = [] ;  

 	for [{ _v = 0 }, { _v < _countDogs }, { _v = _v + 1 }] do   
 	{ 
 		_slotzz = _passers select _v ;   
 		_slotzv = _wasted2 select _v ;

 		_scanz = 'Weapon_Base_F' ;
 		_spoz = (str _slotzv ); 
 		_donkz = _spoz find _scanz ;

 
 		if( _donkz  != -1) then 
 		{ 
  			_fuul pushBack _slotzz ; 

 		}; 
  
 	}; 
 

	_countTankX = count ( _fuul ) ;


	_markST = getPos towerSt;


	_blame = "" ;
	_blame2 = "" ;
	_blameX = "" ;
	_blameX2 = "" ;

	lastW = 0 ;
	lastL = 0 ; 
	lastWx = 0 ;
	lastLx = 0 ;
	rowPing = 0 ;

	hint("loop layer starting") ;

	_dimenzOf = [] ;
	_dimenzRow = [] ;
	
	bumperSpot = 0 ;	

	
	private _objNamePass = "" ;

	for [{private _gh = 0 }, { _gh < _countTankX }, { _gh = _gh + 1 }] do
	{	
		bumperSpot = -1 ;
		
		_shells = 0 ; 
		_moments = []  ;
		slotG = _fuul select _gh ; 
		_inPar = _fuul select _gh ;
		_fun = (str _inPar) ;
		
		_configGM = getText (configFile >> "CfgVehicles" >> slotG >> "displayName" ) ;
		_configXM = getText (configFile >> "CfgVehicles" >> slotG >> "editorSubcategory" ) ;
	
		_blame = _configGM ;
		_blamer = _blame2  ;
		_blame2 = _blame ;
		_blameX = _configXM ;
		_blameXr = _blameX2  ;
		_blameX2 = _blameX ;
		_welp = _blame find _blamer ;	
		if(_welp < 0 ) then
		{
			_gelp = _blameX find _blameXr ;		
			if( _gelp < 0  ) then
			{
				if(_gh  != 0) then
				{
					bumperSpot = _gh ;
					
					_shells = _gelp ; 
					_dimenzRow pushBack _gh ; 
				};
			};
		} ;
		
		private _posNews = [(0),(0),(0)] ;
		_objNamePass = 'xzobj'+ (str _gh)  ;
		private _blamz = 'zobj'+ (str _gh)  ;
		private _blamor = _objNamePass   ;

		_blamz = createVehicle [_inPar,_posNews ,[],0,"CAN_COLLIDE"];

		
		private _dimenz = boundingBoxReal _blamz ;

	
		_blamz enableSimulation false ;
		_blamz allowDamage false ;
		_blamz hideObject true ;
		 
		private _z1 = _dimenz select 0;
		private _z2 = _dimenz select 1;

		private _zW = abs ((_z2 select 0) - (_z1 select 0));
		private _zL = abs ((_z2 select 1) - (_z1 select 1));
		private _zH = abs ((_z2 select 2) - (_z1 select 2));

		
		_mb = [] ;
		_mi = [] ;
		_mw = [] ;
		_ml = [] ;
		_mh = [] ;
		_mbs = [] ;
		_msh = [] ;

		_mb pushBack (  _blamor) ;
		_mi pushBack ( _inPar ); 
		_mw pushBack (str _zW );
		_ml pushBack (str _zL );
		_mh pushBack (str _zH );
		_mbs pushBack (str bumperSpot) ; 
		_msh pushBack (str _shells ); 

		_moments pushBack ( _mb ) ;
		_moments pushBack ( _mi ); 
		_moments pushBack ( _mw );
		_moments pushBack ( _ml );
		_moments pushBack ( _mh );
		_moments pushBack ( _mbs ) ; 
		_moments pushBack ( _msh ); 
	
		
		_dimenzOf pushBack ( _moments) ; 
		
		//deleteVehicle _blamz ;

	};

	hint (str _fuul ) ;
	copyToClipBoard (str _fuul ) ; 
	sleep 2 ;


	hint (str _dimenzOf ) ;
	copyToClipBoard (str _dimenzOf ) ; 
	sleep 6 ;

	//_dimenzOf = toString (toArray _dimenzOf) ; 
	//hint(str _dimenzOf) ;

	

	hint (str _dimenzRow ) ;
	copyToClipBoard (str _dimenzRow ) ; 
	sleep 6 ;


 

Suppose I want to call for vehicles or people...
"[] execVM arrayMatrixViks.sqf"

Spoiler

	private _contentZ = [] ;
	_contentZ = loadFile "textsToKeep\fireTexts\baseAPop.txt";
	_contentsAry = [] ; 
	_contentsAry = toArray _contentZ ;
	private _asWas = toString _contentsAry ; 
	_contentZZ = parseSimpleArray  _asWas ;

	private _contentRZ = [] ;
	_contentRZ =  loadFile "textsToKeep\fireTexts\baseARow.txt";
	_contentsRow = [] ; 
	_contentsRow = toArray _contentRZ ;
	private _rasWas = toString _contentsRow ; 
	_contentRR = parseSimpleArray  _rasWas ;

	

	private _dimenzOf = [] ;
	private _dimenzRow = [] ;

	_dimenzOf = _contentZZ  ;
	_dimenzRow = _contentRR  ;

	_countTankX = count ( _dimenzOf ) ;

	

	_treesW = 0 ;
	_treesL = 0 ;
	_rackX = _treesW ; 
	_rackY =  _treesL ; 

	_racks = _rackX * _rackY ; 
	_bumper = 1 ; 
	

	_markST = getPos towerSt;

	whax =   0 ;     
	whay =   0 ;       
	whaz =   0 ;

	
	rackBumpX = 10 ;
	rackBumpY = 3 ;
	
	
	
	whax = ( _markST select 0 ) ;
	whay = ( _markST select 1 )  ;
	whay = whay - 100 ; 
	
	
	whaLoc = whax ;
	whaLocY = whay ;
	halfDog =  2 ;
	

	_positionRemainY = [(whax),(whay),(whaz)] ;
	_positionRemainX = [(whax),(whay),(whaz)] ;
	_positionsXY = [] ; 
	
	lastW = 0 ;
	lastL = 0 ; 
	lastWx = 0 ;
	lastLx = 0 ;
	rowPing = 0 ;

	hint("loop layer starting") ;
	sleep (1.5) ;
	bumperSpot = 0 ;

	_lessThanCount = _countTankX - 1 ;
	startMark = 0 ;
	rememberMark = 0 ;
	
	 
	hint ( str(whax) + "\n" + str(whay) ) ;
	
	sleep (1.5) ;

	whacx = 0 ;
	whacy = 0 ;
	knox  = 0;
	knoy = 0; 
	knoz = 0;

	
	hint (str _countTankX + "...counter") ;
	sleep 2; 

	_stringTesting = "" ;	
	private _maxLidxRow = 0 ;

	private _countTankXX = _countTankX - 1 ;

	maxWidthR = 800 ;
	mxWR = 0 ;
	mucky = 0 ;
	_maxLidxx = 0 ;


	private _nextRowSX = 0 ;
	private _nextRowSX =  1 ;
	
				 
			

	for [{private _po = 0 }, { _po < _countTankXX }, { _po = _po+ 1 }] do
	{
			_partyx = _dimenzOf select _po; 
			twx =  ( _partyx select 2 ) select 0 ;
			twx =parseNumber  twx ;
			
			if (twx != 0 ) then 
			{

			whacx = whax + 0  ;
			whacy = (whay) + 0 ;

			private _posNex = [(whacx),(whacy),(whaz)] ;

			_objNumbez = "" ;
			_objNamez = "" ;
			tw = 0 ;
			tl = 0 ;
			th = 0 ;

			_objNext = 0 ;
			_rowIsNext = 0 ;

			_party = _dimenzOf select _po;  

			_objNumbez = ( _party select 0 ) select 0  ;
			
			_objNamez = (_party select 1 ) select 0 ; //literal strings up to here
			tw =  (_party select 2 ) select 0 ; //all strings pass here from numbers
			tl =  (_party select 3 ) select 0 ;
			th = (_party select 4 ) select 0 ;
			_objNext = ( _party select 5) select 0 ;
			_rowIsNext =( _party select 6 ) select 0;

			tw =parseNumber  tw ;
			tl =parseNumber  tl ;
			th =parseNumber  th ;
			_objNext = parseNumber _objNext  ;
			_rowIsNext = parseNumber _rowIsNext ;

			
			private _funGuy = (_objNumbez) + "x" ; 

			_bop = _po;
			_bopo = _lessThanCount ;
			

			_gonerz = [] ; 
			_gonerz = _dimenzOf select _po ;
			_gz = (_gonerz select 3 ) select 0 ;
			_gz = parseNumber _gz ;
			
			
			
			_inParts = _objNamez ;

			private _blarz = (str _po ) + "obj";

			_fu = (_bop) + 1 ;

			_goers = ( _dimenzOf select _fu) ;
			_rowIsNext =  ( _goers select 6 ) select 0; 
			_rowIsNext = parseNumber _rowIsNext ;
			_objNext =  (_goers select 5 ) select 0;
			_objNext = parseNumber _objNext  ;

			myFunz = compile preprocessFile "funcOneZF.sqf";

			_passToFunctionAry = [_po, _objNumbez , _objNamez , tw , tl, th, _objNext, _rowIsNext, _dimenzRow, _dimenzOf ] ;
			_returnsAry = [] ;
			waitUntil
			{
				_returnsAry = [_passToFunctionAry] call myFunz  ;
				true ; 
			} ;
			
			_Lprev = _returnsAry select 0  ;
			_Lnext = _returnsAry select 1 ; 
			_Lcur = _returnsAry select 2 ;	

			//_Lprev = parseNumber_Lprev  ;
			//_Lnext = parseNumber _Lnext  ; 
			//_Lcur = parseNumber _Lcur ;	

			//hint (str _Lprev + "P++N" + str _Lnext + "N++C" + str _Lcur) ;
			//sleep 2 ;

		
				
				
			private _nextWid = 0 ;
			_blarz = createVehicle [ _inParts , _posNex ,[],0,"CAN_COLLIDE"];
			_blarz enableSimulation true ;
			//_blarz enableSimulation false;
			//_blarz allowDamage false ;
			spaceW = tw ; 
			spaceW = spaceW ;

			if( _rowIsNext > 0) then
			{
				bumpPo = _po + 1 ;
				_gon = [] ; 
				_gon = _dimenzOf select bumpPo  ;
					
				_goo =  (_goo select 2 ) select 0 ;
				_goo = parseNumber _goo ;
				_nextWid = _goo ;
				_nextWid = _nextWid  ;
			}; //do not bump rows

			spaceW = spaceW + rackBumpX + _nextWid  ;

			whax =   whax + spaceW ;
			mxWR = mxWR + spaceW ; 
			widows =  _Lcur + _Lnext + _Lprev ;
			if( mxWR > maxWidthR ) then 
			{	
				mxWR = 0 ;
				whay = whay - widows ;
				whax = whaLoc ;
			} ; //bump rows
			
			if( _rowIsNext < 0 ) then 
			{			
					
				whay = whay - widows ;
				whax = whaLoc ;
			}; //bump rows again
				

			

			}; //end width != 0 (twx) 


			
	};

	hint("done with it") ;

 

The function it will call ...

"funcOneZF.sqf"

 

Spoiler


 scopeName 'mainN';

private _maxLidxN =  0 ;
private _maxLidxP =  0 ;
private _maxLidxC =  0 ;



_aa = _this select 0  ; 
	
_rowsZ = _aa select 8 ;

_poz = 0 ;
 _objNumbezz = ""  ; 
 _objNamezz  = ""  ;
 twz = 0 ; 
 tlz= 0 ; 
 thz = 0 ; 
 _objNextz = 0 ; 
 _rowIsNextz = 0 ; 

_poz = _aa select 0 ;
 _objNumbezz = _aa select 1 ; 
 _objNamezz =_aa select 2 ;
 twz = _aa select 3 ; 
 tlz = _aa select 4 ; 
 thz = _aa select 5 ; 
 _objNextz =_aa select 6 ; 
 _rowIsNextz = _aa select 7 ; 
_dimensions = _aa select 9 ;

_nextRowInd =0 ;
_prevRowInd = 0 ;
_prevRow = 0;
	
{

	_spotCheck = _x ;
	
	if( _spotCheck  >= _poz) then 
	{ 
		_nextRowInd  = _spotCheck  ;
		
		break ;
	} ;
	_prevRow = _spotCheck ; 
	

} forEach _rowsZ ;

_savedInd = _nextRowInd ; 
countRowBase = count _rowsZ ;
countRowBase = countRowBase - 1 ;

private _yougoiz = _rowsZ find ( _nextRowInd  ) ;
_endOfNext = countRowBase   ;
	
_beg = 0 ;
_begPrev = 0 ;

if(_yougoiz >= 2 ) then 
{
	_beg = _yougoiz - 1  ;
	_begPrev = _yougoiz - 2 ; 
	_beg = _rowsZ select _beg ; 
	_begPrev = _rowsZ select _begPrev ;
} ;
if( _yougoiz >= countRowBase || _yougoiz ==	 -1 ) then 
{
	_maxLidxN = 1 ;
	_maxLidxC = 1; 
	_maxLidxP = 1; 
	[_maxLidxP, _maxLidxC , _maxLidxN] breakOut 'mainN' ; 
			
		
}; 
		

		


				
		
_lidxN = [] ;
_lidxP = [] ;					
_lidxC = [] ;



if( _nextRowInd != -1) then 
{
		for [{private _gc = _beg}, { _gc < _nextRowInd }, { _gc = _gc + 1 }] do
		{
			_gonet = [] ; 	
			_gonet =  (_dimenzOf select _gc) ;			
			_gcx =  ( _gonet select 3) select 0 ;
			_gcx = parseNumber _gcx ;
			_lidxC  pushBack _gcx ; 

		};

		_maxLidxC =  selectMax _lidxC ;	
}; 
if( _nextRowInd == -1) then 
{
	_maxLidxC = 1 ;
	breakTo 'mainN' ;
	
} ; 

belowBase = countRowBase - 1 ;	

while { _maxLidxN == 0 } do
{


	if( _yougoiz >= countRowBase ) then 
	{
		_maxLidxN = 1 ;
		breakTo 'mainN' ;
	} ; 


	if( _nextRowInd != -1) then 
	{

		private _yougoi = _rowsZ find ( _nextRowInd  ) ;
	
		
		if( _yougoi < countRowBase && _yougoi >= 0) then 
		{

			_nextYou = _yougoi + 1 ;
			_endOfNext = _rowsZ select _nextYou ;
	
	

			for [{private _ga = _nextRowInd }, { _ga < _endOfnext  }, { _ga = _ga + 1 }] do
			{
				_gonet = [] ; 	
				_gonet =  (_dimenzOf select _ga) ;
					
				_gax =  ( _gonet select 3) select 0 ;
				_gax = parseNumber _gax ;
				_lidxN  pushBack _gax ; 

			};
		};

		_maxLidxN =  selectMax _lidxN ;
		_nextRowInd = _endOfNext ;
	

	};
	
	if( _nextRowInd == -1) then 
	{
		_maxLidxN = 1 ;
		breakTo 'mainN' ;
	
	} ; 

	

} ;


 _nextRowInd = _savedInd  ;
 

//hint ("_maxLidxP loop... " ) ; 
//sleep (.5) ; 
//hint (str _rowsZ) ;
//sleep (.5) ;



_decIndex = _nextRowInd  ;

while { _maxLidxP == 0 } do
{
	//hint ( str _decIndex + 'dec index...') ;
	//sleep (1.4) ;
	//hint ( str _nextRowInd  + '_next index...') ;
	//sleep (1.4) ;

	if( _decIndex > 2 ) then 
	{
		private _yougoi = _rowsZ find ( _decIndex ) ;
		//hint ( str _yougoi + '_yougoi  index...') ;
		//sleep (1.4) ;
		_beg = 0 ;
		_begPrev = 0 ;
	
		if(_yougoi < 2) then 
		{	
		
			_decIndex = 0 ;
		};
		if( _yougoi >= 2  ) then 
		{
			_beg = _yougoi - 1  ;
			_begPrev = _yougoi - 2 ; 
			_beg = _rowsZ select _beg ; 
			_begPrev = _rowsZ select _begPrev ;
			_decIndex = _beg  ;
	

			for [{private _gb = _begPrev }, { _gb < _beg  }, { _gb = _gb + 1 }] do
			{
				_gonet = [] ; 	
				_gonet =  (_dimenzOf select _gb) ;
					
				_gbx =  ( _gonet select 3) select 0 ;
				_gbx = parseNumber _gbx ;
				_lidxP  pushBack _gbx ; 
	
			};

			_maxLidxP =  selectMax _lidxP ;	
			_decIndex =  _beg  ; 
			_nextRowInd  = _rowsZ find ( _beg) ;

		} ;

	};		
	if( _decIndex <= 1  ) then 
	{
		breakTo 'mainN' ;
		_maxLidxP  = 1 ;
	} ;
				
};



//hint ( 'Pos: ' + str _poz +'\n' + 'Row before: ' + str _maxLidxP + '\n' + 'Current: ' + str _maxLidxC + '\n' + 'Next is: ' + str _maxLidxN ) ;
//sleep (2.5) ;


_this = [_maxLidxP, _maxLidxC , _maxLidxN]  ;
_this 

 


If you want to call that same function but for weapons display... "[] execVM arrayMatrixWeaponsF.sqf"

call this 

Spoiler

	private _contentZ = [] ;
	_contentZ = loadFile "textsToKeep\fireTexts\baseAPop.txt";
	_contentsAry = [] ; 
	_contentsAry = toArray _contentZ ;
	private _asWas = toString _contentsAry ; 
	_contentZZ = parseSimpleArray  _asWas ;

	private _contentRZ = [] ;
	_contentRZ =  loadFile "textsToKeep\fireTexts\baseARow.txt";
	_contentsRow = [] ; 
	_contentsRow = toArray _contentRZ ;
	private _rasWas = toString _contentsRow ; 
	_contentRR = parseSimpleArray  _rasWas ;

	

	private _dimenzOf = [] ;
	private _dimenzRow = [] ;

	_dimenzOf = _contentZZ  ;
	_dimenzRow = _contentRR  ;

	_countTankX = count ( _dimenzOf ) ;

	

	_treesW = 0 ;
	_treesL = 0 ;
	_rackX = _treesW ; 
	_rackY =  _treesL ; 

	_racks = _rackX * _rackY ; 
	_bumper = 1 ; 
	

	_markST = getPos towerSt;

	whax =   0 ;     
	whay =   0 ;       
	whaz =   1.4 ;

	
	rackBumpX = 1 ;
	rackBumpY = 1 ;
	
	
	
	whax = ( _markST select 0 ) ;
	whay = ( _markST select 1 )  ;
	whay = whay - 22 ; 
	
	
	whaLoc = whax ;
	whaLocY = whay ;
	

	_positionRemainY = [(whax),(whay),(whaz)] ;
	_positionRemainX = [(whax),(whay),(whaz)] ;
	_positionsXY = [] ; 
	
	lastW = 0 ;
	lastL = 0 ; 
	lastWx = 0 ;
	lastLx = 0 ;
	rowPing = 0 ;

	hint("loop layer starting") ;
	sleep (1.5) ;
	bumperSpot = 0 ;

	_lessThanCount = _countTankX - 1 ;
	startMark = 0 ;
	rememberMark = 0 ;
	
	 
	hint ( str(whax) + "\n" + str(whay) ) ;
	
	sleep (1.5) ;

	whacx = 0 ;
	whacy = 0 ;
	knox  = 0;
	knoy = 0; 
	knoz = 0;

	
	hint (str _countTankX + "...counter") ;
	sleep 2; 

	_stringTesting = "" ;	
	private _maxLidxRow = 0 ;

	private _countTankXX = _countTankX - 1 ;

	maxWidthR = 222 ;
	mxWR = 0 ;
	mucky = 0 ;
	_maxLidxx = 0 ;


	private _nextRowSX = 0 ;
	private _nextRowSX =  1 ;
	
				 
			

	for [{private _po = 0 }, { _po < _countTankXX }, { _po = _po+ 1 }] do
	{
			_partyx = _dimenzOf select _po; 
			twx =  ( _partyx select 2 ) select 0 ;
			twx =parseNumber  twx ;
			
			if (twx != 0 ) then 
			{

			whacx = whax + 0  ;
			whacy = (whay) + 0 ;

			private _posNex = [(whacx),(whacy),(whaz)] ;

			_objNumbez = "" ;
			_objNamez = "" ;
			tw = 0 ;
			tl = 0 ;
			th = 0 ;

			_objNext = 0 ;
			_rowIsNext = 0 ;

			_party = _dimenzOf select _po;  

			_objNumbez = ( _party select 0 ) select 0  ;
			
			_objNamez = (_party select 1 ) select 0 ; //literal strings up to here
			tw =  (_party select 2 ) select 0 ; //all strings pass here from numbers
			tl =  (_party select 3 ) select 0 ;
			th = (_party select 4 ) select 0 ;
			_objNext = ( _party select 5) select 0 ;
			_rowIsNext =( _party select 6 ) select 0;

			tw =parseNumber  tw ;
			tl =parseNumber  tl ;
			th =parseNumber  th ;
			_objNext = parseNumber _objNext  ;
			_rowIsNext = parseNumber _rowIsNext ;

			
			private _funGuy = (_objNumbez) + "x" ; 

			_bop = _po;
			_bopo = _lessThanCount ;
			

			_gonerz = [] ; 
			_gonerz = _dimenzOf select _po ;
			_gz = (_gonerz select 3 ) select 0 ;
			_gz = parseNumber _gz ;
			
			
			
			_inParts = _objNamez ;

			private _blarz = (str _po ) + "obj";

			_fu = (_bop) + 1 ;

			_goers = ( _dimenzOf select _fu) ;
			_rowIsNext =  ( _goers select 6 ) select 0; 
			_rowIsNext = parseNumber _rowIsNext ;
			_objNext =  (_goers select 5 ) select 0;
			_objNext = parseNumber _objNext  ;

			myFunz = compile preprocessFile "funcOneZF.sqf";

			_passToFunctionAry = [_po, _objNumbez , _objNamez , tw , tl, th, _objNext, _rowIsNext, _dimenzRow, _dimenzOf ] ;
			_returnsAry = [] ;
			waitUntil
			{
				_returnsAry = [_passToFunctionAry] call myFunz  ;
				true ; 
			} ;
			
			_Lprev = _returnsAry select 0  ;
			_Lnext = _returnsAry select 1 ; 
			_Lcur = _returnsAry select 2 ;	

			//_Lprev = parseNumber_Lprev  ;
			//_Lnext = parseNumber _Lnext  ; 
			//_Lcur = parseNumber _Lcur ;	

			//hint (str _Lprev + "P++N" + str _Lnext + "N++C" + str _Lcur) ;
			//sleep 2 ;

		
			vecX = -1 ;
			vecY = 0 ;
			vecZ = 0 ;	
				
			private _nextWid = 0 ;
			_blarz = createVehicle [ _inParts , _posNex ,[],0,"CAN_COLLIDE"];
			_blarz enableSimulation true ;
			//_blarz enableSimulation false;
			//_blarz allowDamage false ;

			_blarz setVectorUp [vecX ,vecY ,vecZ ];
			spaceW = tw ; 
			spaceW = spaceW ;

			if( _rowIsNext > 0) then
			{
				bumpPo = _po + 1 ;
				_gon = [] ; 
				_gon = _dimenzOf select bumpPo  ;
					
				_goo =  (_goo select 2 ) select 0 ;
				_goo = parseNumber _goo ;
				_nextWid = _goo ;
				_nextWid = _nextWid  ;
			}; //do not bump rows

			spaceW = spaceW + rackBumpX + _nextWid  ;

			whax =   whax + spaceW ;
			mxWR = mxWR + spaceW ; 
			widows =  _Lcur + _Lnext + _Lprev ;
			if( mxWR > maxWidthR ) then 
			{	
				mxWR = 0 ;
				whay = whay - widows ;
				whax = whaLoc ;
			} ; //bump rows
			
			if( _rowIsNext < 0 ) then 
			{			
					
				whay = whay - widows ;
				whax = whaLoc ;
			}; //bump rows again
				

			

			}; //end width != 0 (twx) 


			
	};

	hint("done with it") ;

 


... 

its not very well organized in terms of private vs. global variables yet, but it is fast... 
also... I should learn to write files that start these sheets for you. 

 

 

Edited by bLAcKmAgE87
7/7/2022

Share this post


Link to post
Share on other sites
Spoiler



?imw=5000&imh=5000&ima=fit&impolicy=Lett
Notice how long this takes... 2 mins plus... You should only have to do it once... after that you can keep the texts with the mods of your choice and quantity... 
?imw=5000&imh=5000&ima=fit&impolicy=Lett




Ok after I got the texts in place... I launch it for a fast  performance .... it only took a few seconds to start creating and finishes around 30s
?imw=5000&imh=5000&ima=fit&impolicy=Lett
?imw=5000&imh=5000&ima=fit&impolicy=Lett
?imw=5000&imh=5000&ima=fit&impolicy=Lett
?imw=5000&imh=5000&ima=fit&impolicy=Lett

Need markers and directional orientations 

?imw=5000&imh=5000&ima=fit&impolicy=Lett
?imw=5000&imh=5000&ima=fit&impolicy=Lett
?imw=5000&imh=5000&ima=fit&impolicy=Lett
?imw=5000&imh=5000&ima=fit&impolicy=Lett

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

×