Home   Help Search Login Register  

Author Topic: Manipulating vehicle animations  (Read 1303 times)

0 Members and 1 Guest are viewing this topic.

Offline IceShade

  • Members
  • *
Manipulating vehicle animations
« on: 30 Nov 2009, 15:11:49 »
Hi there.

Working on a little script that turns a normal T72 into a wrecked, abandoned, disabled T72.

So far the only way I've been able to get AI to turn out of their hatches is to put them to Setbehaviour "SAFE". Unfortunately, the way they do it is unreliable (sometimes the gunner pops out first, other times the commander) and slow (for some reason they don't turn out all at once, but one at a time) ..

This wouldn't be a problem if BIS hadn't decided to reset the tank's turret and gun position once the gunner turns out. Considering I setHit the turret and gun to the point where the gunner can't move them anymore, I'm baffled. Because the turret/gun resets, I need to absolutely time it right, otherwise by the time the gunner has turned out and has been unassigned from the vehicle, the turret is already in the reset position.

That was the background story. Now for my actual question: I looked in the config for the T72 and it has a line called gunnerAction = "T72_GunnerOut";. Is there a way to use this animation in a script so I can make the hatches turn out without having to rely on actual AI infantry?

Offline Rellikki

  • Members
  • *
  • Die-hard OFP player
Re: Manipulating vehicle animations
« Reply #1 on: 30 Nov 2009, 18:44:20 »
Try the following command:

Code: [Select]
unitName action ["TURNOUT", vehicleName]
Use it along with the "safe" behaviour to ensure that the AI doesn't go back inside the tank after performing that command.

Offline IceShade

  • Members
  • *
Re: Manipulating vehicle animations
« Reply #2 on: 30 Nov 2009, 18:47:54 »
I tried it, but that only works for human commanders.

I'm not even sure whether this is the T72 animation for the hatch or the animation for the gunner, turning out ..

See, if you tell the guys to go into "SAFE" mode, they don't do it immediately. They take their time, and that time can be pretty random. I just need those hatches open, one way or another. The best and reliable way would be to just.. open them, using the T72 animation. 

Offline DeanosBeano

  • Addons Depot Staff
  • *****
  • SirDeanosbeano bstowed on me by sui ;)
    • Fraghaus
Re: Manipulating vehicle animations
« Reply #3 on: 01 Dec 2009, 19:35:57 »
 animations can be strange as everything in VR engine :).
 I dont know whether you can open the hatch without a user source anim applied  on tank hatches, however i do remember an occasion where it has worked on something else.

 a few ideas you can try is

 vehiclename animate  ["poklop_gunner",1] // 1 is open 0 is shut

 vehiclename  animate  ["poklop_commander",1] // 1 is open 0 is shut

 also remember when someone  starts in a vehicle   his id is changed with a letter at the end that coresponds with his role in the vehicle.

 so commander of a vehicle called  tank is not  Tank action but TankC  for commander  or  TankG for gunner .

unitName action ["TURNOUT", vehicleName]

 so this will become  vehiclenameC  action ["TURNOUT", vehicleName]  ?

 its been so long i get confused, there is a rule for tanks placed with crew and empty tanks that a crew enters, when tank is placed with crew  i think the commander will always be named TankC whether he is in or out of tank  for rest of game ?
 sorry for extra confusion but i hope it helps ;) .
 
« Last Edit: 02 Dec 2009, 15:33:58 by DeanosBeano »
I love ofp

Offline IceShade

  • Members
  • *
Re: Manipulating vehicle animations
« Reply #4 on: 05 Dec 2009, 04:06:47 »
Thanks Deanos, I'll try to use those animations. I think I found those in the config myself after a bit of digging, but I've since made my way around it.

It's a bit.. "dirty".. but basically I have a guy jump in the gunner seat, set him to safe mode (he immediately opens the hatch because he doesn't have to wait for other crew.. or something. AI responds a lot quicker when it's just himself) .. he pops open the hatch. 0.2 seconds later, I moveOut the guy and then moveInCommander the commander seat. He automatically pops the hatch open, because he's still in safe mode. I do the same for the driver seat, move him out, and delete him.

This takes about a second or less, and seems to be 100% reliable, as long as there are no enemies around which may break the safe mode.

Even though I've already got the result I wanted, I'll try the animations from the config. I'll report back here.

edit: Nope, looks like that doesn't work. Oh well, I've got my script up and running.
« Last Edit: 05 Dec 2009, 18:25:30 by IceShade »