Key bindings

Users who are viewing this thread

Rize

Sergeant Knight at Arms
I'm trying to make a sitting crouch animation with the "jump" one. First i completely converted the jump animation to this, and it works pretty fine when shooting (otherwise you lift your hands), but i still need to also jump.

So how do i give crouching a different key binding?  :roll:
 
I don't undererstand why you wouldn't have created you own code and key mapping for the crouch...
 
Well, this is the point of the thread, i don't know how!  :lol:
I'm a beginner still.
 
Rize,  If I understand correct you've overridden jump.
You need to override one of unused animations in module_animations.py (e.g. unused_human_anim_1)
Then bind your crouch to key in each mission template in mission_templates.py.
To bind animation to key you should added code like

(  0, 0, 0,  [(key_is_down,key_u),], [ #bind to key ‘u’ , see header_trigger.py for possible alternative keys
(get_player_agent_no,”:agent”),
          (agent_set_animation,":ag","anim_unused_human_anim_1"),  
  ]),
 
I would think it was harder to change how a jump works than to map a function to another key...
 
Well, it works well, but there are some problems. You can't aim a gun left or right, you can't move and if you try to crouch while moving, the game CTD's, but aside from that, it only needs a good animation. The displace_position flag and extra lines only activate once you release the key, and you end up floating with the mid-jump animation, so i put the one at the start of the jump and it's like this. It helps getting behind cover.

mb3copy.jpg


If anyone wants it, the module_animations line is this: ["crouch", acf_enforce_lowerbody|acf_displace_position,
                                                                              [0.3, "jump", 22, 22, arf_blend_in_1|arf_cyclic, 0, (0, 0, 0), 0],
                                                                                ],
and the module_mission_templates line is this: (0, 0, 0, [(key_is_down, key_x),],
                                                                    [(get_player_agent_no,":agent"),
                                                                    (agent_get_horse,":horse",":agent"),
                                                                    (neg|gt,":horse",0),
                                                                    (agent_set_animation,":agent","anim_crouch"),
                                                                    ]),

 
The thing about this is that the animation mesh doesn't have a loop for doing what you do on the ground. So therefor you will just float in midair...'
I donno how to solve it though.



EDIT:
Code:
acf_align_with_ground
Maybe by adding this into the code will help


["crouch", acf_enforce_lowerbody|acf_displace_position|acf_align_with_ground,
[0.3, "jump", 22, 22, arf_blend_in_1|arf_cyclic, 0, (0, 0, 0), 0],
],
 
Back
Top Bottom