Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- span class="re5"> func_createBox = {
- private ["_boxSize", "_boxHeight", "_boxPos", "_lastLowerWall", "_cornerObj", "_cornerPos"];
- _boxSize = _this select 0;
- _boxHeight = _this select 1;
- _boxPos = _this select 2;
- _boxPos = [((_boxPos select 0) + _boxSize * 0.5) , ((_boxPos select 1) - _boxSize * 0.5), _boxPos select 2];
- _lastLowerWall = [_boxPos, 90, _boxSize, _boxHeight] call func_createConcreteWall;
- _cornerObj = [_lastLowerWall, -90, _boxHeight] call func_createConcreteCorner;
- _cornerPos = getPos _cornerObj;
- deleteVehicle _cornerObj;
- _lastLowerWall = [_cornerPos, 180, _boxSize, _boxHeight] call func_createConcreteWall;
- _cornerObj = [_lastLowerWall, 90, _boxHeight] call func_createConcreteCorner;
- _cornerPos = getPos _cornerObj;
- deleteVehicle _cornerObj;
- _lastLowerWall = [_cornerPos, -90, _boxSize, _boxHeight] call func_createConcreteWall;
- _cornerObj = [_lastLowerWall, 0, _boxHeight] call func_createConcreteCorner;
- _cornerPos = getPos _cornerObj;
- deleteVehicle _cornerObj;
- _lastLowerWall = [_cornerPos, 0, _boxSize, _boxHeight] call func_createConcreteWall;
- };
- func_createConcreteWall = {
- private ["_sleepTime", "_wallType", "_startPos", "_wallDirection", "_desiredLength", "_height", "_wallLevel", "_wall1", "_wallSize", "_wallWidth", "_wallLength", "_wallHeight", "_blockCount", "_lastLowerWall", "_skippedFirst", "_skippedFirstH"];
- _sleepTime = 0.01;
- _wallType = "Land_ConcreteBlock";
- _startPos = _this select 0;
- _wallDirection = _this select 1;
- _desiredLength = _this select 2;
- _height = _this select 3;
- _wallLevel = ((_startPos) select 2);
- _wall1 = _wallType createVehicle [
- _startPos select 0,
- _startPos select 1,
- _wallLevel
- ];
- _wall1 setDir _wallDirection;
- _wall1 setPos [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1),
- _wallLevel
- ];
- _wall1 setvectorup [0,0,1];
- _wallSize = boundingBox _wall1;
- _wallWidth = _wallSize select 1; _wallWidth = _wallWidth select 0; _wallWidth = (_wallWidth * 2) - 0.1;
- _wallLength = _wallSize select 1; _wallLength = _wallLength select 1; _wallLength = (_wallLength * 2) - 0.1;
- _wallHeight = _wallSize select 1; _wallHeight = _wallHeight select 2; _wallHeight = (_wallHeight * 2) - 0.1;
- _blockCount = _desiredLength / _wallWidth; _blockCount = ceil _blockCount;
- _lastLowerWall = objNull;
- if (_wallDirection == 0 || _wallDirection == 360) then {
- for "_k" from 2 to _height do {
- call compile format(['
- _wallh1_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setDir _wallDirection;
- _wallh1_%1 setPos [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setvectorup [0,0,1];
- '
- ,_k]);
- };
- _skippedFirst = false;
- _skippedFirstH = false;
- for "_i" from 1 to _blockCount do {
- if (_skippedFirst) then {
- _lastLowerWall = call compile format(['
- _wall_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0) + (_wallWidth * (%1 - 1)),
- ((getPos _wall1) select 1),
- _wallLevel
- ];
- _wall_%1 setDir _wallDirection;
- _wall_%1 setPos [
- ((getPos _wall1) select 0) + (_wallWidth * (%1 - 1)),
- ((getPos _wall1) select 1),
- _wallLevel
- ];
- _wall_%1 setvectorup [0,0,1];
- _wall_%1
- '
- ,_i]);
- if (_skippedFirstH) then {
- for "_j" from 2 to _height do {
- call compile format(['
- _wallh_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0) + (_wallWidth * (%2 - 1)),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh_%1 setDir _wallDirection;
- _wallh_%1 setPos [
- ((getPos _wall1) select 0) + (_wallWidth * (%2 - 1)),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh_%1 setvectorup [0,0,1];
- '
- ,_j,_i]);
- };
- };
- };
- _skippedFirst = true;
- _skippedFirstH = true;
- };
- };
- if (_wallDirection == 180 || _wallDirection == -180) then {
- for "_k" from 2 to _height do {
- call compile format(['
- _wallh1_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setDir _wallDirection;
- _wallh1_%1 setPos [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setvectorup [0,0,1];
- '
- ,_k]);
- };
- _skippedFirst = false;
- _skippedFirstH = false;
- for "_i" from 1 to _blockCount do {
- if (_skippedFirst) then {
- _lastLowerWall = call compile format(['
- _wall_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0) - (_wallWidth * (%1 - 1)),
- ((getPos _wall1) select 1),
- _wallLevel
- ];
- _wall_%1 setDir _wallDirection;
- _wall_%1 setPos [
- ((getPos _wall1) select 0) - (_wallWidth * (%1 - 1)),
- ((getPos _wall1) select 1),
- _wallLevel
- ];
- _wall_%1 setvectorup [0,0,1];
- _wall_%1
- '
- ,_i]);
- if (_skippedFirstH) then {
- for "_j" from 2 to _height do {
- call compile format(['
- _wallh_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0) - (_wallWidth * (%2 - 1)),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh_%1 setDir _wallDirection;
- _wallh_%1 setPos [
- ((getPos _wall1) select 0) - (_wallWidth * (%2 - 1)),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh_%1 setvectorup [0,0,1];
- '
- ,_j,_i]);
- };
- };
- };
- _skippedFirst = true;
- _skippedFirstH = true;
- };
- };
- if (_wallDirection == 90) then {
- for "_k" from 2 to _height do {
- call compile format(['
- _wallh1_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setDir _wallDirection;
- _wallh1_%1 setPos [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setvectorup [0,0,1];
- '
- ,_k]);
- };
- _skippedFirst = false;
- _skippedFirstH = false;
- for "_i" from 1 to _blockCount do {
- if (_skippedFirst) then {
- _lastLowerWall = call compile format(['
- _wall_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1) + (_wallWidth * (%1 - 1)),
- _wallLevel
- ];
- _wall_%1 setDir _wallDirection;
- _wall_%1 setPos [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1) + (_wallWidth * (%1 - 1)),
- _wallLevel
- ];
- _wall_%1 setvectorup [0,0,1];
- _wall_%1
- '
- ,_i]);
- };
- if (_skippedFirstH) then {
- for "_j" from 2 to _height do {
- call compile format(['
- _wallh_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1) + (_wallWidth * (%2 - 1)),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh_%1 setDir _wallDirection;
- _wallh_%1 setPos [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1) + (_wallWidth * (%2 - 1)),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh_%1 setvectorup [0,0,1];
- '
- ,_j,_i]);
- };
- };
- _skippedFirst = true;
- _skippedFirstH = true;
- };
- };
- if (_wallDirection == -90) then {
- for "_k" from 2 to _height do {
- call compile format(['
- _wallh1_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setDir _wallDirection;
- _wallh1_%1 setPos [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setvectorup [0,0,1];
- '
- ,_k]);
- };
- _skippedFirst = false;
- _skippedFirstH = false;
- for "_i" from 1 to _blockCount do {
- if (_skippedFirst) then {
- _lastLowerWall = call compile format(['
- _wall_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1) - (_wallWidth * (%1 - 1)),
- _wallLevel
- ];
- _wall_%1 setDir _wallDirection;
- _wall_%1 setPos [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1) - (_wallWidth * (%1 - 1)),
- _wallLevel
- ];
- _wall_%1 setvectorup [0,0,1];
- _wall_%1
- '
- ,_i]);
- };
- if (_skippedFirstH) then {
- for "_j" from 2 to _height do {
- call compile format(['
- _wallh_%1 = _wallType createVehicle [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1) - (_wallWidth * (%2 - 1)),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh_%1 setDir _wallDirection;
- _wallh_%1 setPos [
- ((getPos _wall1) select 0),
- ((getPos _wall1) select 1) - (_wallWidth * (%2 - 1)),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh_%1 setvectorup [0,0,1];
- '
- ,_j,_i]);
- };
- };
- _skippedFirst = true;
- _skippedFirstH = true;
- };
- };
- _lastLowerWall
- };
- func_createConcreteCorner = {
- private ["_wallEndObj", "_cornerDir", "_newDir", "_height", "_startPos", "_wallType", "_sleepTime", "_wallLevel", "_corner1", "_wallSize", "_wallWidth", "_wallLength", "_wallHeight", "_cornerObj", "_cornerDir2", "_skippedFirst"];
- _wallEndObj = _this select 0;
- _cornerDir = _this select 1;
- _newDir = getDir _wallEndObj + _cornerDir;
- _cornerDir = _newDir;
- _height = _this select 2;
- _startPos = getPos _wallEndObj;
- _wallType = "Land_ConcreteBlock";
- _sleepTime = 0.01;
- _wallLevel = ((_startPos) select 2);
- _corner1 = _wallType createVehicle [
- _startPos select 0,
- _startPos select 1,
- _wallLevel
- ];
- _corner1 setDir _cornerDir;
- _wallSize = boundingBox _corner1;
- _wallWidth = _wallSize select 1; _wallWidth = _wallWidth select 0; _wallWidth = (_wallWidth * 2) - 0.1;
- _wallLength = _wallSize select 1; _wallLength = _wallLength select 1; _wallLength = (_wallLength * 2) - 0.1;
- _wallHeight = _wallSize select 1; _wallHeight = _wallHeight select 2; _wallHeight = (_wallHeight * 2) - 0.1;
- _cornerObj = _corner1;
- _cornerDir2 = _cornerDir;
- if ((_this select 1) == -90) then {
- _corner1 setPos [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1) + _wallWidth,
- _wallLevel
- ];
- for "_k" from 2 to _height do {
- _skippedFirst = false;
- if (_skippedFirst) then {
- call compile format(['
- _wallh1_%1 = _wallType createVehicle [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1) + (_wallLength / 2),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setDir _cornerDir2;
- _wallh1_%1 setPos [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setvectorup [0,0,1];
- '
- ,_k]);
- };
- _skippedFirst = true;
- };
- };
- if ((_this select 1) == -180) then {
- _corner1 setPos [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1) - (_wallLength),
- _wallLevel
- ];
- _corner1 setDir (_cornerDir - 90);
- _cornerDir2 = _cornerDir - 90;
- for "_k" from 2 to _height do {
- _skippedFirst = false;
- if (_skippedFirst) then {
- call compile format(['
- _wallh1_%1 = _wallType createVehicle [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1) - (_wallLength),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setDir _cornerDir2;
- _wallh1_%1 setPos [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setvectorup [0,0,1];
- '
- ,_k]);
- };
- _skippedFirst = true;
- };
- };
- if ((_this select 1) == 90) then {
- _corner1 setPos [
- ((getPos _corner1) select 0) - (_wallWidth) -1,
- ((getPos _corner1) select 1) - (_wallWidth) - 3,
- _wallLevel
- ];
- for "_k" from 2 to _height do {
- _skippedFirst = false;
- if (_skippedFirst) then {
- call compile format(['
- _wallh1_%1 = _wallType createVehicle [
- ((getPos _corner1) select 0) - (_wallWidth / 2),
- ((getPos _corner1) select 1) - (_wallLength * 2),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setDir _cornerDir2;
- _wallh1_%1 setPos [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setvectorup [0,0,1];
- '
- ,_k]);
- };
- _skippedFirst = true;
- };
- };
- if ((_this select 1) == 180) then {
- _corner1 setPos [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1) + (_wallLength / 2),
- _wallLevel
- ];
- _corner1 setDir (_cornerDir + 90);
- _cornerDir2 = _cornerDir + 90;
- for "_k" from 2 to _height do {
- _skippedFirst = false;
- if (_skippedFirst) then {
- call compile format(['
- _wallh1_%1 = _wallType createVehicle [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1) + (_wallLength / 2),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setDir _cornerDir2;
- _wallh1_%1 setPos [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setvectorup [0,0,1];
- '
- ,_k]);
- };
- _skippedFirst = true;
- };
- };
- if ((_this select 1) == 0) then {
- _corner1 setPos [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1) - _wallLength,
- _wallLevel
- ];
- _corner1 setDir (_cornerDir + 90);
- _cornerDir2 = _cornerDir + 90;
- for "_k" from 2 to _height do {
- _skippedFirst = false;
- if (_skippedFirst) then {
- call compile format(['
- _wallh1_%1 = _wallType createVehicle [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1) - _wallLength,
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setDir _cornerDir2;
- _wallh1_%1 setPos [
- ((getPos _corner1) select 0),
- ((getPos _corner1) select 1),
- _wallLevel + (_wallHeight * (%1 - 1))
- ];
- _wallh1_%1 setvectorup [0,0,1];
- '
- ,_k]);
- };
- _skippedFirst = true;
- };
- };
- _cornerObj
- };
- func_createBase = {
- private ["_boxSize", "_boxHeight", "_boxPos", "_lastLowerWall", "_cornerObj", "_cornerPos"];
- _boxSize = _this select 0;
- _boxHeight = _this select 1;
- _entranceHeight = _this select 2;
- _boxPos = _this select 3;
- _boxPos = [((_boxPos select 0) + (_boxSize * 0.5)) , ((_boxPos select 1) - (_boxSize * 0.5)), _boxPos select 2];
- _lastLowerWall = [_boxPos, 90, _boxSize, _boxHeight] call func_createConcreteWall;
- _cornerObj = [_lastLowerWall, -90, _boxHeight] call func_createConcreteCorner;
- _cornerPos = getPos _cornerObj;
- deleteVehicle _cornerObj;
- _lastLowerWall = [_cornerPos, 180, _boxSize, _boxHeight] call func_createConcreteWall;
- _cornerObj = [_lastLowerWall, 90, _boxHeight] call func_createConcreteCorner;
- _cornerPos = getPos _cornerObj; _secondCornerPos = _cornerPos;
- deleteVehicle _cornerObj;
- _lastLowerWall = [_cornerPos, -90, _boxSize, _boxHeight] call func_createConcreteWall;
- _cornerObj = [_lastLowerWall, 0, _boxHeight] call func_createConcreteCorner;
- _cornerPos = getPos _cornerObj; _thirdCornerPos = _cornerPos;
- deleteVehicle _cornerObj;
- _lastLowerWall = [_cornerPos, 0, (_boxSize / 3.1), _boxHeight] call func_createConcreteWall;
- _lastLowerWallPos = position _lastLowerWall;
- _wallSize = boundingBox _lastLowerWall;
- _wallWidth = _wallSize select 1; _wallWidth = _wallWidth select 0; _wallWidth = (_wallWidth * 2) - 0.1;
- _wallLength = _wallSize select 1; _wallLength = _wallLength select 1; _wallLength = (_wallLength * 2) - 0.1;
- _wallHeight = _wallSize select 1; _wallHeight = _wallHeight select 2; _wallHeight = (_wallHeight * 2) - 0.1;
- _blockCount = _boxSize / _wallWidth; _blockCount = ceil _blockCount;
- _heliPadPos = [(_secondCornerPos select 0) + _wallWidth * 2, (_secondCornerPos select 1) - _wallWidth * 1, 0];
- _heliPad = "HeliHCivil" createVehicle _heliPadPos;
- _vehSpawnPos = _heliPadPos;
- _heli = "UH1H_DZ" createVehicle _heliPadPos;
- _heli setPos _heliPadPos;
- for "_i" from 0 to (_entranceHeight - 1) do {
- _outerWallEPos = [];
- _outerWallEPos2 = [];
- _outerWallEPos3 = [];
- _outerWallE = objNull;
- _outerWallE2 = objNull;
- _outerWallE3 = objNull;
- _outerWallEPos = [(_lastLowerWallPos select 0) + (_wallWidth * 0.8), (_lastLowerWallPos select 1) - (_wallWidth * 1.15), (_wallHeight * _i)];
- _outerWallE = "Land_ConcreteBlock" createVehicle _outerWallEPos;
- _outerWallE setDir -15;
- _outerWallE setPos _outerWallEPos;
- _outerWallE setvectorup [0,0,1];
- _outerWallEPos2 = [(_outerWallEPos select 0) + (_wallWidth * 0.96), (_outerWallEPos select 1) + (_wallWidth * 0.256), (_wallHeight * _i)];
- _outerWallE2 = "Land_ConcreteBlock" createVehicle _outerWallEPos2;
- _outerWallE2 setDir -15;
- _outerWallE2 setPos _outerWallEPos2;
- _outerWallE2 setvectorup [0,0,1];
- _outerWallEPos3 = [(_outerWallEPos select 0) + ((_wallWidth * 0.96) * 2), (_outerWallEPos select 1) + (_wallWidth * 0.512), (_wallHeight * _i)];
- _outerWallE3 = "Land_ConcreteBlock" createVehicle _outerWallEPos3;
- _outerWallE3 setDir -15;
- _outerWallE3 setPos _outerWallEPos3;
- _outerWallE3 setvectorup [0,0,1];
- };
- _camoNetPos = [(_thirdCornerPos select 0) + 5, (_thirdCornerPos select 1) + _wallWidth * 0.5, 0];
- _net = "Land_CamoNetVar_NATO" createVehicle _camoNetPos;
- _net setPos _camoNetPos;
- _net setvectorup [0,0,1];
- _crate1SpawnPos = [(_thirdCornerPos select 0) + 0.3, (_thirdCornerPos select 1) + _wallWidth * 0.3, 0];
- _crate1 = "RUVehicleBox" createVehicle _crate1SpawnPos;
- _crate1 setPos _crate1SpawnPos;
- _crate1 setvectorup [0,0,1];
- _crate2SpawnPos = [(_thirdCornerPos select 0) + 0.3, (_thirdCornerPos select 1) + _wallWidth * 0.6, 0];
- _crate2 = "RUVehicleBox" createVehicle _crate2SpawnPos;
- _crate2 setPos _crate2SpawnPos;
- _crate2 setvectorup [0,0,1];
- _crate3SpawnPos = [(_thirdCornerPos select 0) + 6.8, (_thirdCornerPos select 1) + _wallWidth * 0.3, 0];
- _crate3 = "RUVehicleBox" createVehicle _crate3SpawnPos;
- _crate3 setPos _crate3SpawnPos;
- _crate3 setvectorup [0,0,1];
- _crate4SpawnPos = [(_thirdCornerPos select 0) + 6.8, (_thirdCornerPos select 1) + _wallWidth * 0.6, 0];
- _crate4 = "RUVehicleBox" createVehicle _crate4SpawnPos;
- _crate4 setPos _crate4SpawnPos;
- _crate4 setvectorup [0,0,1];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement