For an animation test (i.e., what animation is currently playing, you need two parts.
First, a simple loop trigger in your module_mission_templates:
Note that you have to include the line "cheer_animation_state_check," within the loops for the Missions; see examples such as common_reinforcement_check to see how to do that correctly.
module_scripts:
This would make it possible to then have horses respond to their riders' cheers, for example. Keep in mind that you'll also want to check the horse's animation state, so that if it's playing "anim_horse_cheer" (or whatever you call it) you don't call it again.
First, a simple loop trigger in your module_mission_templates:
Code:
cheer_animation_state_check = (0,0,0,[
(try_for_agents,":agent"),#cycle through every Agent
(call_script, ("script_cf_cheer_animation_state"),
],
[])
Note that you have to include the line "cheer_animation_state_check," within the loops for the Missions; see examples such as common_reinforcement_check to see how to do that correctly.
module_scripts:
Code:
("cf_cheer_animation_state", [
(agent_get_animation, ":anim", ":agent",0), #query the engine about our animation state
(agent_get_horse, ":agent_horse", ":agent"), #Got horse?
(try_begin),
(eq, ":anim", "anim_cheer"), #We're currently cheering
(neq, ":agent_horse", -1), #We're on a horse, of course
#Do Stuff
(try_end),
]),
This would make it possible to then have horses respond to their riders' cheers, for example. Keep in mind that you'll also want to check the horse's animation state, so that if it's playing "anim_horse_cheer" (or whatever you call it) you don't call it again.