OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Rellikki on 18 Feb 2010, 09:22:31
-
Is there a way to check when a character has performed a certain animation? Something like the animationPhase (http://www.ofpec.com/COMREF/index.php?action=details&id=23&game=All) command, but for characters.
-
As far as I know, there isn't. It depends on how the animation is being called. If it's in a script, even if the animations are randomised, could you not set a global variable when a particular animation is performed?
Difficult to say without more details. :confused:
-
Well, I'm creating a script to plant bombs and wanted to check when the player has performed the "putDown" animation, which is done from the action menu and only then createVehicle a bomb at his position. Sadly, it wouldn't be perfectly precise if I just createVehicle'd the bomb after one second delay from executing the animation, because sometimes it takes a little longer to perform that animation, depending on the player's initial stance - If he's laying on ground or standing. Depending on the case, the bomb would be created too early / later.
Yeah, everything has to be that perfect. :D But if you say it's impossible, then I guess I can live with it. I wouldn't want to make it too complicated either. Just wanted to know if there's any simple way to check it.
-
If the "bomb" object is a regular satchel, one way around this would be to
- get a list of the player's inventory
- remove 2 magazines to create enough space for a satchel
- add a satchel to the inventory
- perform the 'put' action on the player, which iirc takes the stance into account
- add the removed magazines back to the player's inventory
Possibly?
EDIT - nope, quick test reveals that for some bizarre reason you cannot run the 'fire' action on the player. Probably why Lukin planting satchels in that Red Hammer mission was done in cutscene style...