OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: dhall99 on 20 May 2007, 13:41:31

Title: Ladder Raid.
Post by: dhall99 on 20 May 2007, 13:41:31

I am currently building ( or trying lol ) to build a SAS Landrover with a ladder attached.

I saw it on a SAS documentary they use it for quickly storming a building.

I currently have a Land rover and the BIS ladder , I am using a attach script  to mount the ladder the front of the Landrover.

Everything works manually e.g. drive up to building (Hotel) exit out of the car and mount the ladder and climb.  But I am unsure how to get the AI to climb custom ladders.

(see attached photo).

So … Questions


How can I make the ladder slant say 45 degree   (see attached photo). Is this possible with a script  ?

The ladder is named Unit2 , how can I make a soldier mount the ladder & climb whilst I drive up to the building ?   


Thanks

Dhall99.

Title: Re: Ladder Raid.
Post by: Mandoble on 20 May 2007, 13:56:59
You may play with setVectorUP to get the correct ladder angle and them, and with a bit of luck, use ai unit "action" command to climb it up. ArmA actions list (http://community.bistudio.com/wiki/ArmA:_Actions#LADDEROFF)
Title: Re: Ladder Raid.
Post by: johnnyboy on 20 May 2007, 19:20:44
This worked for me in OFP on ladders I placed via the editor:

Code: [Select]
_man action ["ladderup",b2_ladder2]
"b2_ladder2" is the name of the ladder object I added.   Note that when units get to the top, they would sometimes slide backwards and get stuck, so I would give them a little push forward to insure they ended up forward enough onto surface area they were climbing to, via setpos commands like this:

Code: [Select]
dostop _man
_man setdir _dir
_pos = getpos _man
_x = _pos select 0
_y = _pos select 1
_z = 11.8
?alive _man: _man setdir _dir
~.01
?alive _man: _man setpos [_x + .10,_y - .02, _z]
~.01
?alive _man: _man setpos [_x + .20,_y- .04, _z]
~.01
?alive _man: _man setpos [_x + .30,_y- .06, _z]
~.01

I used setdir to insure he was facing the direction to move, then incremented a series of setpos commands to slide the guy forward (you can now use modelToWorld command instead of incrementing x,y positions--its cleaner and easier to read).  The z value (height) I set to be just a tad higher than the surface area they need to get onto.  It was brute force code, but it worked, and didn't look too bad.  I don't know if ARMA will give you the same trouble when your unit gets to the top of the ladder or not.

I also wonder that if you use setvectorup to change the angle of the ladder to something other than 90 degrees, if the ladder climb animation will do it right.  I think your ladder will be slanted, but the retard AI will climb straight up. 
Title: Re: Ladder Raid.
Post by: dhall99 on 25 May 2007, 18:33:33
Thanks guys .
Both posts were great but I am now crashing to desktop when the AI climbs the ladder 

I have used



Quote
ladder1 setVectorUp [0,2,1]

To change the angle of ladder and

Quote
sas1 action ["ladderup",ladder1]

Looking at the comref  it mentions the syntax

Quote
unitName action ["LADDERUP", <target object>, <ladder index>, <position>] 


does anyone know on a custom ladder what the ladder index is or the position  is ? 

Thanks






Title: Re: Ladder Raid.
Post by: Mandoble on 25 May 2007, 19:00:22
Do the following test, put the ladder over the ground and with the bottom at ground level, then apply the desired inclination with the setVectorUp and then climb it yourself (the player), player's animation is the same as anyother unit animation when climbing laders, if it works fine for you, it should work fine for AI.

And, if the action fails, as long as you know the animation state, you may move the unit all over the ladder. Look here for a rapel script you may use the check the animation names: Rapel (http://www.ofpec.com/forum/index.php?topic=29217.0)
Title: Re: Ladder Raid.
Post by: The-Architect on 11 Aug 2008, 23:29:13
Sorry to dig this one up.

On custom ladders how do we determine the ladder index and the ladder position?

Edit: I tried some different commands and eventually something crashed ArmA. I read somewhere that the LadderDown command will crash ArmA in versions pre 1.09. It seems that it still does.