Home   Help Search Login Register  

Author Topic: Ladder Raid.  (Read 1535 times)

0 Members and 1 Guest are viewing this topic.

Offline dhall99

  • Members
  • *
Ladder Raid.
« on: 20 May 2007, 13:41:31 »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Ladder Raid.
« Reply #1 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

Offline johnnyboy

  • OFPEC Patron
  • ****
  • Matan los Pantalones!!!
Re: Ladder Raid.
« Reply #2 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. 
El Cojon: "Do you like to Tango?"
You: "Only in Bagango."
Download Last Tango in Bagango and discover how El Cojon earned his name...

Offline dhall99

  • Members
  • *
Re: Ladder Raid.
« Reply #3 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







Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Ladder Raid.
« Reply #4 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

Offline The-Architect

  • Former Staff
  • ****
  • Bite my shiny metal...
    • Bob's Un-official Flashpoint Page
Re: Ladder Raid.
« Reply #5 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.
« Last Edit: 11 Aug 2008, 23:35:35 by The-Architect »
James Andrew Wilkinson 1977 - 2005 R.I.P.
"If it ain't the friggin' incoming it's the friggin' outgoing. Only difference is who gets the friggin' grease, and that ain't no friggin' difference at all."