Jump to content
johnnyboy

Locate Ladder Position in Building object [SOLVED]

Recommended Posts

Anyone know how to find Ladder positions in buildings?  You can use selectionNames to find doors, but not ladders.

 

Maybe there is something in the building config that would help?

 

Solution:

This script is an example of how to find top and bottom positions of any building's ladders.  To use this script, open the editor and move player unit near any building that has a ladder.  Run the mission and look at the ladder, then press escape to get to the debug console.  Run this script from debug console.  The script will create an arrow at top and bottom position of the building's ladders.  It works on editor placed ladder objects also.

Spoiler

_house = cursorObject;  
_ladderArray = getArray (configfile >> "CfgVehicles" >> typeOf cursorObject >> "ladders" ); 
hint str [_ladderArray,_house];
_ladderPositions = [];
_inModelPosition = [];
{
	player groupChat str _x;
	_ladderStart = _x select 0;
	_inModelPosition = _house selectionPosition _ladderStart;
	_arrow = "Sign_Arrow_Yellow_F" createVehicleLocal [0,0,0];
	_arrow setpos (_house modelToWorld _inModelPosition);
	player sidechat str ["_inModelPosition",_ladderStart, _inModelPosition];
	_ladderPositions pushback (getposatl _arrow);
	
	_ladderEnd = _x select 1;
	_inModelPosition = _house selectionPosition _ladderEnd;
	_arrow = "Sign_Arrow_Cyan_F" createVehicleLocal [0,0,0];
	_arrow setpos (_house modelToWorld _inModelPosition);
	player sidechat str ["_inModelPosition",_ladderEnd, _inModelPosition];
	_ladderPositions pushback (getposatl _arrow);
} forEach _ladderArray;
systemChat str [typeOf _house,_ladderPositions];

 

Credit: @pierremgi and @beno_83au for their help.

ladder-Positions.jpg

Share this post


Link to post
Share on other sites

Something like?

configfile >> "CfgVehicles" >> "Land_Shop_City_07_F" >> "ladders"

returning:

ladders[] = {["Ladder_1_start","Ladder_1_end",2.5,"Ladder_1_action"]};

 

then:

theHouseObject selectionPosition "Ladder_1_start"  // [0.81087,7.85884,0.238917] relative to model center I guess


✌️

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
30 minutes ago, pierremgi said:

theHouseObject selectionPosition "Ladder_1_start"  // [0.81087,7.85884,0.238917] relative to model center I guess

 

Thanks a million Pierre!  I am going to try this out tonight or tomorrow morning.  Much appreciated.

  • Like 1

Share this post


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

Something like?

configfile >> "CfgVehicles" >> "Land_Shop_City_07_F" >> "ladders" 

returning:

ladders[] = {["Ladder_1_start","Ladder_1_end",2.5,"Ladder_1_action"]};

Hey Pierre, this line:

configfile >> "CfgVehicles" >> "Land_Shop_City_07_F" >> "ladders" 

 

returns this:

bin\config.bin/CfgVehicles/Land_dp_smallTank_F/ladders

 

I think there must be another step that returns this?

["Ladder_1_start","Ladder_1_end",2.5,"Ladder_1_action"]

 

How do I get that Ladder array?  Thanks.

Share this post


Link to post
Share on other sites
11 minutes ago, beno_83au said:

I'm assuming he used getArray

Perfect.  That worked.  Thanks.

  • Like 1

Share this post


Link to post
Share on other sites

I am reviving this topic because I never actually finished this script until now.   The top post contains the code for finding the 3D positions of tops and bottoms of ladders on building objects.  

ladder-Positions.jpg

  • Like 2
  • Thanks 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

×