Suggestion General Give access to agent "guard mode" control through Agent.EventControlFlag or Agent.MovementControlFlag

Users who are viewing this thread

Please give us dynamic control with ability to set agents / unset "guard mode" through and EventControlFlag or Movement ControlFlag

currently is just on a timer in "native_parameters.xml"
<native_parameter id="guard_reset_time" value="1.0"/>
 
I am re-writing the combat/movement system with intention to separate agent movement during combat from running / getting around the map, with new movement set animations for both running and walking.

I want to blend the guard animations during the "combat-walking" movement set where agents move much slower and keep the weapons pointed towards the enemy creating a look and feel similar to Hellish Quart game, or Assassins Creed 1.

Currently the way i have it working is switching the movement sets based on checking if the agent is in "Guard" mode, which works pretty well because agent controller automatically blends the guard actions after attacking or defending which is great.

The limitation I am runing into is if the timer is too short the way it is in vanilla agents switch to animations meant for getting around the map and move a lot faster in the middle of an engagement which does not look/feel good. And if the timer is too long and agent AI or player wan'ts to route / disengage they are combat walking away for a few seconds until the timer runs out, which also does not feel fluid and makes it sluggish feeling from players point of view.

Thus would like to be able to control the guard mode through code, where the switch for getting back to run mode can be bound to a key for players. And switched through and AIComponent for AI.

Hope that explains it,
Thanks!
 
Last edited:
Yes, this explains everything needed, thank you for that!

The short answer to this is - you should already be able to do this on your own.

The more detailed one would be - Guard actions have an action code type of "Guard". You can make the guard reset time a very large number so that it doesn't get reset by itself, and then reset the guard action whenever the time is right by using SetActionChannel function. You can give act_none with a priority value from the additional flags parameter, though it is not really needed because you would be checking the action type before canceling the current action anyway (ignore priority param would also work).

Hope this helps.
 
Yes, this explains everything needed, thank you for that!

The short answer to this is - you should already be able to do this on your own.

The more detailed one would be - Guard actions have an action code type of "Guard". You can make the guard reset time a very large number so that it doesn't get reset by itself, and then reset the guard action whenever the time is right by using SetActionChannel function. You can give act_none with a priority value from the additional flags parameter, though it is not really needed because you would be checking the action type before canceling the current action anyway (ignore priority param would also work).

Hope this helps.
Wanted to say Thanks! Finally got the upper body blends working properly,





I know i already requested it, but not going to hurt to request one more time, if you guys could update the moddocs page on the animation system, such as:
  • param1, param2, param3: Params are used in cases when the engine requires additional data. They may have quite different meanings.
Animations usually contain two other nodes: flags and clip_usage_data. clip_usage_data is a common data pointer that may refer to blend_data, displacement_data, bipedal_movement_and_ik_data, and quadrupedal_movement_data. Their usage is mostly for specific cases and their details are out of this explanation’s scope.
//public bool SetActionChannel(
//int channelNo,
//ActionIndexCache actionIndexCache,
//bool ignorePriority = false,
//ulong additionalFlags = 0UL,
//float blendWithNextActionFactor = 0f
//float actionSpeed = 1f,
//float blendInPeriod = -0.2f,
//float blendOutPeriodToNoAnim = 0.4f,
//float startProgress = 0f,
//bool useLinearSmoothing = false,
//float blendOutPeriod = -0.2f,
//int actionShift = 0,
//bool forceFaceMorphRestart = true)
Specifically why blends are negative values by default?
Is there a way to just use those values from animation clip and not having to fill it out for each action?
 
Last edited:
Back
Top Bottom