OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: woodser82 on 14 Aug 2006, 23:17:49
-
First of all I would like to commend everyone involved with this site, I know recently there have been some problems, but it still remains a great resource; full of the best Ofp scripters, mission makers, etc. I have gotten many nice addons, missions, etc from here in the past too.
The reason for my post, is that I have been trying pretty much all day to make a dude sit in a chair (WAIT!!! DON'T CLOSE THIS!!) I, of course figured out how to do this, but then old boy becomes static, even if dead. Do you recommend scripting another animation after onchair, or maybe null? I'm not sure, but I want general guba to be sitting down for a meeting and get smoked by the sniper (myself). Basically, how do I keep a unit animated but also responsive to enemy activity??
Any help could be great, although I have gotten more than enough from this site already!!
Pat
-
well, you've played an animation to get him to sit. the answer lies in noticing when he gets killed, then playing another animation.
set up a trigger, condition
not (alive guba)
on activation
guba switchmove "falling_off_chair_dead"
now obviously there's no such animation - as far as i know - but look through the Switchmove/Playmove Animation Library in the tutorials section of the ed depot, you should find something that'll fit.
and welcome back ;)
-
I don't know what animation you are using and i don't think it matters. It's the command that triggers the animation that's causing you trouble.
There's two ways to start an animation:
1) playMove
This is the smoother of the two alternatives. It will tell the unit to perform the movement as soon as possible, but it doesn't actually force him to perform the animation if he's busy doing something else (like getting in and out of a car, that also requires animations). Generally I use playMove if I can, but it doesn't work on all commands.
2) switchMove
This one works on most commands, and it forces the unit to execute the animation instantly, no matter what he was doing before. I suspect that you are using this one, right?
Either change your code to
unitName playMove "animationName"
or force him to leave the switchMove with another switchMove command. The later is done in the following way.
1) Make a trigger without any area.
2) Set the Condition to !(alive unitName)3) Set the Activation to unitName switchMove "NULL"
unitName refers to the sitting unit. The NULL command will force him to leave the switchMove instantly. The downside is that he snaps out of it, without a smooth transition. I think that will solve your problem.
EDIT: Bedges was faster than me, but the despite the fact that we answered your question in two different ways both answers are valid. Ofp is truly a marvelous game engine.
-
Wow, you guys really are on top of things around here...I appreciate it and will use it in my new mission. BTW, is Armed Assault replacing OFP2 or is it something entirely different. I'm surprised that there are more "unofficial" people and info about it than "official" stuff. Oh well, hopefully it comes out soon and my PC can handle it. Probably will have to upgrade just for that game, haha. Thanks again!
Pat
-
OFPEC is an editing site and we prefer to avoid speculation about as yet non-existant games. However, since you were so nice .... :D Armed Assault is the successor to Operation Flashpoint. It is not OFP2, which is a much more distant and uncertain game. ArmA is sort of "OFP 1.5" if you like.
Right, lets get back on topic ....
-
Gotcha. The animation advice worked like a charm. ;D