

shifty50
Member-
Content Count
4 -
Joined
-
Last visited
-
Medals
Community Reputation
10 GoodAbout shifty50
-
Rank
Rookie
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
BoundingBox of a Weapon inside a Weapon Holder
shifty50 replied to shifty50's topic in ARMA 3 - MISSION EDITING & SCRIPTING
This is true, but it spawns them around in a circle does it not ? Im spawning these items in a limited area and so are trying to place them in specific areas. Hence I need to know how big the weapon is so I can adjust its position accordingly (so its not hanging off the edge of a box or something). -
BoundingBox of a Weapon inside a Weapon Holder
shifty50 posted a topic in ARMA 3 - MISSION EDITING & SCRIPTING
So if I put a weapon in a weapon holder like so: weapon_on_ground = "groundWeaponHolder" createvehicle getpos _holder; weapon_on_ground addWeaponCargo [_wep, 1]; Now im trying to determine the dimensions of the weapon so I can place other items around it. When I use the boundingBox function it returns a far too big box, im assuming its the size of the game logic object of the weapon holder. Is there anyway to get the model of the weapon, and therefore the correct boundingBox from say maybe from the config files by the weapon name as a string ? So far all my attempts have failed. Thanks in advance -
Spawning Weapons on a Bench
shifty50 replied to shifty50's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks, I had no idea boundingBox even existed, ill have to read through the available functions more carefully next time. Anyways problem solved thanks guys. -
I am trying to spawn weapons on a bench, but im having some trouble positioning the weapon correctly. I spawn the bench ingame and run this script from the init field: null = [this, "launch_NLAW_F"] execVM "WeaponBench.sqf"; And here is my WeaponBench.sqf script: _bench = _this select 0; _wep = _this select 1; _holder = createVehicle ["groundWeaponHolder", getPos _bench, [], 0, "can_collide"]; _holder addWeaponCargo [_wep, 1]; _holder setDir (getDir _bench); _holder setPos [getPos _bench select 0, getPos _bench select 1, (getPos _bench select 2) + 0.5]; _holder setPos [getPos _holder select 0, (getPos _holder select 1) - 1, getPos _holder select 2]; So first I create a holder, and add the weapon to it and place it at the bench coordinates. The weapon spawns in the middle of the bench, but on the ground. So I want to move the weapon on top of the bench, so I add 0.5 to its z coorinate. This works but when I try to move it 1 along the y axis (so its not in the middle of the bench to make room for placing the ammo) it resets its Z coordinate, and goes back to spawning on the ground. I know I could do it in 1 stage, but Im wondering why the position of the wep dosen't seem to save after the first setPos. Also, when I rotate the bench the wep dosent stay on the table, but floats in the air. I tried to correct this by using setDir to line the wep's direction and the bench direction, but it dosent work. Unless the bench is perfectly facing north in the map editor, moving it left (-1 y axis) moves it off the bench rather than along it. Any help would be greatly appreciated. Im relatively new to arma scritping and just can't seem to work out what is going wrong here. Im thinking that the bench model may not be lined up along the axes, but I couldnt find any function to get a model's dimensions. Ideally I would like to not have to manually adjust the position, but instead detect the height and width of the bench and move the weapon accordingly, but not sure if that is possible. I can post screenshots if that makes it easier to understand. Thanks