From Bohemia Interactive Community
- Waffle SS. - c
- Posted on Dec 23, 2021 - 06:29 (UTC)
-
For those interested in the extra cursed, you can scale non-simple objects by running the command every frame.
The multiplayer performance of this is likely terrible.
addMissionEventHandler ["EachFrame", {
{
if (_x != player) then { _x setObjectScale 0.5; };
} forEach allUnits;
}];
- P1ker1 - c
- Posted on Jan 04, 2022 - 22:17 (UTC)
-
Note that
_obj setObjectScale 2;
doubles the scale factor of an object, not the volume. In the case of a cube this would be the length of an edge.
If you want to multiply the volume, raise the scale to the power of 1/3.
// Example with 1x1x1 m^3 helper objects
// vectorAdds elevate the cubes so they touch the ground after scaling.
_cube1 = createSimpleObject ["Land_VR_Shape_01_cube_1m_F",(getPosASL player vectorAdd [1,3,0.5])];
_cube2 = createSimpleObject ["Land_VR_Shape_01_cube_1m_F",(getPosASL player vectorAdd [3,1,0.5])];
_cube3 = createSimpleObject ["Land_VR_Shape_01_cube_1m_F",(getPosASL player vectorAdd [1.35,1.35,0.13])];
// Double the side length. V=2^3=8
_cube1 setObjectScale 2;
// Octuple(8x) the volume. V=(8^(1/3))^3=8
_cube2 setObjectScale 8^(1/3);
// Double the volume. V=(2^(1/3))^3=2
_cube3 setObjectScale 2^(1/3);