Jump to content

Recommended Posts

Base Builder for ARMA III, ver.  0001 (2019) 
438077-1574101288.png

This MODULE is compatible with BASE GAME (current version)


Base Builder under construction...

Download: you_fnc_camp


readMe:

Spoiler

 

INSTALLATION:
============

To play the DEMO: Install 000_test.vr to your documents/arma3/user/missions folder

 

To create a new scenario with camp options: Install the required you_camp files and init the library,

 

Initialize the library from init.sqf: execVM "you_fnc_camp.sqf";

 

Or

 

from the editor init properties: you_camp= execVM "you_fnc_camp.sqf";

 

This version (0001) includes:
you_fnc_camp.sqf
you_defines.hpp
description.ext

also included:
you_GUIedit.sqf,
to customize the GUI: Copy the contents of this file to the clip-board and then open in the GUI Editor with ctrl+O.


Base Builder Instructions:
==========================

1) Deploy your camp
Deploying a camp designates the area (~30 m) around the camp object as your build-zone. You may pack/re-deploy camp area any time/anywhere. 

 

2) Object Menu
Click a button to spawn an object. Move the field of view/character to position the object and choose "Place Object". Once an object is placed it may be grabbed and relocated or removed via the action menu. Anything in the base area can be grabbed (including units, use to place guards in specific positions) and anything except units/vehicles may be removed. The rampart and scaffold can be used to change elevation of placed objects.*

You may build any of the objects on the left side for free**. Most of the objects on the right side of the object menu require salvage or some other condition. Click each object to discover the requirements. There are additional requirements for objects on the top and bottom of the menu.

Supplies object 1 (free) is both an example of the salvage object and a counter for current salvage amount. Use "Check Salvage" to get a count of collected resources.

*Literally lift objects to the desired elevation. Caution: Scaffolds are dangerous objects which may cause clipping death.
**H-BARs, Sandbags, concrete walls, ect. are mostly made of dirt.

 

3) Salvage
Salvage boxes can be found within a 1 km radius of the camp. There is not a fixed amount of boxes but there are more than enough to build a cool base.*

By default there is a chance a new box will spawn randomly each time salvage is collected.

 

FAQ
===

Q: Can I add this anywhere on any map?
A: Totally.

 

Q: Can I build more than one base?
A: Yes but only one can be active at a time. In-active bases will not grant base actions such as build, repair, load group, ect. but may still contain supplies and objects. The camp object deploys camps but once a camp is deployed the object is no longer connected (until the camp is packed up).

 

Q: Can the camp object be anything?
A: Most anything, yes. Objects, units, vehicles-- anything which can be named and the player can be in proximity to.

 

Q: What are the camp services?
A: These actions are available at a deployed camp/base: Repair Vehicle, Refuel Vehicle, Open Arsenal, Wait 6 Hours (heal). Additionally: Objects (menu), Grab, Remove and Pack Camp.

 

Q: How much salvage do I need?
A: This depends on how many objects and how detailed your base is.
see you_fnc_camp section set up to configure loot: [centre, select from array or object, # of loot objects] call you_fnc_randomLoot;
 

 

APL-SA.png
Arma Public License No Derivatives (APL-ND)

 

Have fun!

  • Like 5
  • Thanks 3

Share this post


Link to post
Share on other sites

Looking good. Do you mind sharing any plans you have for it? Messed with the UI a bit last night, here's what I came up with so far.

(model preview rotates)

Hkyiz7J.png

 

Cfg for adding new objects  to build menu

Spoiler

class baseObjects
	{
		class land_HBarrier_1_f
		{
			displayName = "H-Barrier";
			treeGrp = "Walls";
			costArray[] = {1,1,0};	//[scrap,wood,electric];
		};
		class land_HBarrier_5_f
		{
			displayName = "H-Barrier(5)";
			treeGrp = "Walls";
			costArray[] = {4,4,0};	//[scrap,wood,electric];
		};
		class land_HBarrier_BIG_f
		{
			displayName = "Big H-Barrier(4)";
			treeGrp = "Walls";
			costArray[] = {5,5,0};	//[scrap,wood,electric];
		};
		class land_HBarrierWALL_corridor_f
		{
			displayName = "H-Corridor";
			treeGrp = "Walls";
			costArray[] = {5,5,0};	//[scrap,wood,electric];
		};
		class land_HBarrierWALL_corner_f
		{
			displayName = "H-Corner";
			treeGrp = "Walls";
			costArray[] = {5,5,0};	//[scrap,wood,electric];
		};
		class Land_CNCwall4_f
		{
			displayName = "CNC Wall";
			treeGrp = "Walls";
			costArray[] = {5,5,0};	//[scrap,wood,electric];
		};
		class land_bagFence_short_f
		{
			displayName = "Sandbag Short";
			treeGrp = "Walls";
			costArray[] = {1,1,0};	//[scrap,wood,electric];
		};
		class land_bagFence_long_f
		{
			displayName = "Sandbag Long";
			treeGrp = "Walls";
			costArray[] = {2,2,0};	//[scrap,wood,electric];
		};
		class land_bagFence_round_f
		{
			displayName = "Sandbag Round";
			treeGrp = "Walls";
			costArray[] = {2,2,0};	//[scrap,wood,electric];
		};
		class land_shoot_house_wall_stand_f
		{
			displayName = "Wood Wall";
			treeGrp = "Walls";
			costArray[] = {1,3,0};	//[scrap,wood,electric];
		};
		class land_shoot_house_corner_stand_f
		{
			displayName = "Wood Corner";
			treeGrp = "Walls";
			costArray[] = {1,3,0};	//[scrap,wood,electric];
		};
		class Land_rampart_F
		{
			displayName = "Rampart";
			treeGrp = "Walls";
			costArray[] = {1,1,0};	//[scrap,wood,electric];
		};
		class land_campingChair_v2_f
		{
			displayName = "Chair";
			treeGrp = "Furniture";
			costArray[] = {1,1,0};	//[scrap,wood,electric];
		};
		class land_woodenTable_02_Large_f
		{
			displayName = "Table";
			treeGrp = "Furniture";
			costArray[] = {1,1,0};	//[scrap,wood,electric];
		};
		class Land_portable_Generator_f
		{
			displayName = "Generator";
			treeGrp = "Electric";
			costArray[] = {20,0,0};	//[scrap,wood,electric];
		};
		class Land_portableLight_double_f
		{
			displayName = "Light";
			treeGrp = "Electric";
			costArray[] = {5,0,2};	//[scrap,wood,electric];
		};
	};

 

Open/Load UI and Change/Rotate model preview

Spoiler

camp_fnc_Load =
{
	_display = createDialog "RscBaseObject";
	_tree = (findDisplay 30000) displayCtrl 30001;
	_configs = "true" configClasses (missionConfigFile >> "cfgBaseBuild" >> "baseObjects");
	_grps = [];
	{
		_className = configName _x;
		_grp = getText (_x >> "treeGrp");
		if !(_grp in _grps) then
		{
			_grps pushBack _grp;
			_trunk = _tree tvAdd [[], _grp];
		};
		for "_i" from 0 to (_tree tvCount []) do
		{
			_text = _tree tvText [_i];
			if (_text == _grp) then
			{
				_objName = getText (_x >> "displayName");
				_obj = _tree tvAdd [[_i], _objName];
				_tree tvSetData [[_i,_obj], _className];
			};
		};
	} forEach _configs;
};

camp_fnc_ObjSel =
{
	disableSerialization;
	params ["_tree","_index"];
	if ((count _index) > 1) then
	{
		private _modelCtrl = ((findDisplay 30000) displayCtrl (30002));
		_objClass = _tree tvData _index;
		_objModel = getText(configFile >> "cfgVehicles" >> _objClass >> "model");
		_modelCtrl ctrlShow false;
		sleep 0.25;
		_dummy = _objClass createVehicleLocal [0,0,0];
		_modelSize = sizeOf (typeOf _dummy);
		deleteVehicle _dummy;
		_modelPos = ctrlPosition _modelCtrl;
		_modelPos set [1,(_modelSize * 2)];
		_modelCtrl ctrlSetPosition _modelPos;
		_modelCtrl ctrlSetModel _objModel;
		_modelCtrl ctrlShow true;
		while {ctrlShown _modelCtrl} do
		{
			_vectorDirAndUp = ctrlModelDirAndUp _modelCtrl;
			_vectorDir = _vectorDirAndUp select 0;
			_newVector = [_vectorDir,0.5] call BIS_fnc_rotateVector2D;
			_modelCtrl ctrlSetModelDirAndUp [_newVector,(_vectorDirAndUp select 1)];
			sleep 0.02;
		};
	};
};

 

UI cfg

Spoiler

#define true 1
#define false 0

class RscBaseObject
{
    idd= 30000;
    movingEnable = false;
    enableSimulation = true;
    fadein=0;
    duration = 1e+011;
    fadeout=0;
    onLoad= "";

    controlsBackground[]=
    {
        RscBack
    };
    controls[]=
    {
        RscObjTree
    };
    objects[]=
    {
        RscObjPreview
    };


    class RscBack: IGUIBack
    {
        idc = -1;
        x = 0* safezoneW + safezoneX;
        y = 0.24 * safezoneH + safezoneY;
        w = 0.5 * safezoneW;
        h = 0.52 * safezoneH;
        colorBackground[] = {0,0,0,0.75};
    };
    class RscObjTree : RscTree
    {
        idc = 30001;
        x = -0.005 * safezoneW + safezoneX;
        y = 0.25 * safezoneH + safezoneY;
        w = 0.16 * safezoneW;
        h = 0.5 * safezoneH;
        sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.25)";
        colorText[] = {1,1,1,1.0};
        colorSelect[] = {1,1,1,0.7};
        colorSelectText[] = {0,0,0,1};
        colorBackground[] = {0,0,0,0};
        colorSelectBackground[] = {0,0,0,0.5};
        colorBorder[] = {0,0,0,0};
        colorPicture[] = {1,1,1,1};
        colorPictureSelected[] = {1,1,1,1};
        colorPictureDisabled[] = {1,1,1,1};
        colorPictureRight[] = {1,1,1,1};
        colorPictureRightDisabled[] = {1,1,1,0.25};
        colorPictureRightSelected[] = {0,0,0,1};
        colorDisabled[] = {1,1,1,0.25};
        borderSize = 0;
        expandOnDoubleclick = 1;
        maxHistoryDelay = 1;
        colorArrow[] = {0,0,0,0};
        colorMarked[] = {1,0.5,0,0.5};
        colorMarkedText[] = {1,1,1,1};
        colorMarkedSelected[] = {1,0.5,0,1};
        onTreeSelChanged = " _this spawn camp_fnc_ObjSel;";
        onTreeLButtonDown = "";
        onTreeDblClick = "";
        onTreeExpanded = "";
        onTreeCollapsed = "";
        onTreeMouseMove = "";
        onTreeMouseHold = "";
        onTreeMouseExit = "";
        class ScrollBar: RscTreeScrollBar{};
    };
    class RscObjPreview :  RscObject
    {
        idc = 30002;
        type = 81;
        enableZoom = 1;
        model = "\A3\Air_F_Exp\VTOL_01\VTOL_01_armed_F.p3d";
        scale = 1;
        x = 0.33 * safezoneW + safezoneX;
        y = 0.5 * safezoneH + safezoneY;
        z = 40;
        direction[] = {0.25,0,0};
        up[] = {0,1,0};
        tooltip = "";
        tooltipColorShade[] = {0,0,0,1};
        tooltipColorText[] = {1,1,1,1};
        tooltipColorBox[] = {1,1,1,1};
        onMouseMoving = "";
        onMouseHolding = "";
        onMouseDown = "";
    };
};

 

 

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites

@soolie,

That looks awesome!

The plan for this project was to release it so people can play around with-- and apparently vastly improve it.

I'm updating the script right now for MP compatibility and the ability to move objects vertically-- my trigonometry is not great but I almost got it. In fact the vertical movement is all sorted out I just need to preserve the object's current direction.

you_fnc_interact

Spoiler

you_fnc_interact=
{	params [["_caller", player], ["_interact", false]];
	private _obj= cursorObject;
	if (_interact) then {
			_caller setVariable ["object_LOC", 1];
			_obj enableSimulation false;
			_distance = _obj distance _caller;
			_objDir= obj getRelDir player;
			_playerDir = player getRelDir _obj;

			while {_caller getVariable ["object_LOC", 0]==1} do
			{
_direction =
((acos((ATLtoASL positionCameraToWorld [0,0,1] select 2)-(ATLtoASL positionCameraToWorld [0,0,0] select 2))-90)*-1);
_high = ((tan _direction) * _distance) + 1.45 + ((getPos _caller) select 2);
if (_high > (4 + ((getPos _caller) select 2))) then { _high = ((getPos _caller) select 2) + 4};
if (_high < (-4 + ((getPos _caller) select 2))) then { _high = ((getPos _caller) select 2) + -4};
_obj attachTo [_caller,[0, _distance,_high]];
			};

			detach _obj;
			_obj enableSimulation true;
	} else {
			if !(_obj isKindOf "MAN" || _obj isKindOf "CAR") then {
					deleteVehicle _obj
			} else {
					systemChat "Can't remove that"
		};
	};
};

            _objDir and _playerDir are recorded but unused because I haven't figured out the math yet.

Thanks,

Have fun!

  • Like 2

Share this post


Link to post
Share on other sites

Getting really close to finished with this. Going to release a beta version later tonight to be tested.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Still working out the object placement. Trying a bunch of different  things like setting the pos in a loop with lineintersectsurfaces, vectormultiply based on screen center, using attachtorelative etc.

Just working out the best way. Should have something soon(tm).

  • Like 5

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

×