Jump to content
fn_Quiksilver

Base-building / Object manipulation / Snapping / etc

Recommended Posts

Hi guys,

 

Interested in learning a little about base-building, object manipulation, object snapping to surfaces/vertices/etc. with respect to ArmA.

 

Are there any good examples of base-building, guides or anyone have some thoughts on it?

 

An example scenario is that I want a player to be able to place objects, but not to the extent they could for instance block access entirely to a building or area.

 

thanks

Share this post


Link to post
Share on other sites

Well the Zeus system is actually pretty good. Nearly no scripting, vanilla and easy to use. The part of not blocking entries is another problem though...

Share this post


Link to post
Share on other sites
On 5/9/2018 at 11:42 PM, fn_Quiksilver said:

Hi guys,

 

Interested in learning a little about base-building, object manipulation, object snapping to surfaces/vertices/etc. with respect to ArmA.

 

Are there any good examples of base-building, guides or anyone have some thoughts on it?

 

An example scenario is that I want a player to be able to place objects, but not to the extent they could for instance block access entirely to a building or area.

 

thanks

You could set it up to detect if there are any house objects nearby and stop them from building nearby.

 

Other than that the only way to stop them from blocking anything in is to block building completely in certain areas (e.g cities).

Share this post


Link to post
Share on other sites

For the restriction of placing objects in certain places, say doors of house is a tricky one. It is possible though. When you enter placement mode you could perhaps create invisible markers of near house door selection positions. Rather than on all across the map. When player confirms placement, you can check if it is X distance or in radius or something. Then delete invisible markers.

  • Like 3

Share this post


Link to post
Share on other sites
16 hours ago, HazJ said:

For the restriction of placing objects in certain places, say doors of house is a tricky one. It is possible though. When you enter placement mode you could perhaps create invisible markers of near house door selection positions. Rather than on all across the map. When player confirms placement, you can check if it is X distance or in radius or something. Then delete invisible markers.

 

thanks for the link, just what i was looking for

 

just wanted an idea of how simple/complex the scripting for this stuff is.

 

yes ill need to do some work with editing areas. not just doors but stairs as well ;/ 

Share this post


Link to post
Share on other sites
33 minutes ago, fn_Quiksilver said:

 

thanks for the link, just what i was looking for

 

just wanted an idea of how simple/complex the scripting for this stuff is.

 

yes ill need to do some work with editing areas. not just doors but stairs as well ;/ 

 

Stairs will be tricky, for doors and exits I was using this for visualizing positions:


addMissionEventHandler ["Draw3D",{

	_pos = getposATL player;
	_buildings = nearestObjects [_pos,["house"],15];
	_doorPositions = [];
	_exitPositions = [];

	{

		_building = _x;
		_exit = _building buildingExit 0;
		_it = 0;

		while {!(_exit isEqualTo [0,0,0])} do {

			_exit = _building buildingExit _it;

			_exitPositions pushBack _exit;
			_it = _it + 1;
		};

		_selectionNames = selectionNames _building;
		_selectionPositions = [];
		_doors = _selectionNames select {toUpper _x find "DOOR" >= 0 AND toUpper _x find "HANDLE" == -1};
		{
			_selectionPositions pushBack (_building modelToWorldVisual (_building selectionPosition [_x,"GEOMETRY"]));
		} forEach _doors;

		_doorPositions append _selectionPositions;

	} forEach _buildings;

	{
	_text = "Exit";
	drawIcon3D ["",[1,1,1,1],_x,1,1,0,_text,2];

	} forEach _exitPositions;

	{
	_text = "Door";
	if (player distance _x < 2) then {_text = toString [72,111,100,111,114]};
	drawIcon3D ["",[1,1,1,1],_x,1,1,0,_text,2];

	} forEach _doorPositions;

hintsilent str (_doorPositions + _exitPositions);
}];

Always good to have a visual clue, heh.

 

Cheers

Share this post


Link to post
Share on other sites

The only way I can think of doing it for stairs is manually get position of each building (house) type with stairs then use modelToWorld, etc...

  • Like 1

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

×