I have made a skeleton animation and imported it into the game via modding kit. then I have modified action_sets.xml and action_types.xml
I add following code into action_sets.xml:
I add following code into action_sets.xml:
And I add following code into action_types.xml:<action type="act_yizizhan" animation="release_direct_fist" />
Then I add a C# class Inherited the MissionLogic class:<action name="act_yizizhan" type="actt_release_melee" usage_direction="ud_attack_up" action_stage="as_attack_release" />
And add it via addMissionBehavior:public class AgentYizizhanLogic : MissionLogic
{
public static readonly ActionIndexCache[] Actions = new ActionIndexCache[1]
{
ActionIndexCache.Create("act_yizizhan")
};
public override void OnMissionTick(float dt)
{
base.OnMissionTick(dt);
if (Input.IsKeyPressed(InputKey.Q) && Agent.Main != null)
{
Agent.Main.SetActionChannel(0, Actions[0]);
}
}
}
Now my character could do this action when I press the Q key, but it can't collide with other agents. How should I make this action hit someone and cause damage without replacing the original attack action?mission.AddMissionBehavior((MissionBehavior)new AgentYizizhanLogic());