Jump to content
Sign in to follow this  
Bnae

Height of building floor

Recommended Posts

Hi,

 

I'm trying to create items into a building. Problem is that i have no idea how to get the height of the floor.

		{
			_posnumber = floor(random 5);
			_position = _x buildingpos _posnumber;

			_cargostyle = ["ITEMS"] call BIS_fnc_selectRandom;
			_gun = ["ITEMS"] call BIS_fnc_selectRandom;
			_survive = ["ITEMS"] call BIS_fnc_selectRandom;
			_ammo = ["ITEMS"] call BIS_fnc_selectRandom;
			
			_cargo = _cargostyle createVehicle _position;
			_supply = "Supply500" createVehicle [0,0,0];
			_supply attachto [_cargo, [0,0,0.5]];
			_supply addWeaponCargoGlobal [_gun,floor(random 2)];
			_supply addMagazineCargoGlobal [_ammo,floor(random 2)];
			_obj = _survive createVehicle _position;
		
		} forEach _building;

Here is the important part of the function.

 

Of course the height is different on every building type and every position of the building.

I could make a list of the heights of every building position and make a function to check if the position fits.

 

But if there is any easier way to do this, please give me a hint.

Thanks!

Share this post


Link to post
Share on other sites

Hi Bnae, for the most part I've been using a similar method, only with the exception of utilizing BIS_fnc_buildingPositions instead of buildingPos. Also, look into modelToWorld command too before even thinking of hard-coding building position lists.

 

Hope this helps,

Nikander

Share this post


Link to post
Share on other sites

Hi Bnae, for the most part I've been using a similar method, only with the exception of utilizing BIS_fnc_buildingPositions instead of buildingPos. Also, look into modelToWorld command too before even thinking of hard-coding building position lists.

 

Hope this helps,

Nikander

 

I think these will help me to get started.

Thanks Nikander

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
Sign in to follow this  

×