I've created a trigger for my own gate unit handling:
And for changing ownership on death:
This all works fine. I can open and close a gate and repair it if it is destroyed.
However, there is one slight fault. Whenever I repair a gate, it's animation goes to stand (as all models share the same model) when it should be staying at death. I've tried countering this with a trigger:
And in the 'Repair Gate' ability I tried setting the Art - Animation Names to death,alternate. Unfortunately, these two methods have not worked and my gate still goes back to it's stand animation.
Any ideas of how I can solve this problem?
Trigger:
- Open Animation
- Events
- Unit - A unit Finishes casting an ability
- Conditions
- Or - Any (Conditions) are true
- Conditions
- (Ability being cast) Equal to Open Gate
- (Ability being cast) Equal to Close Gate
- (Ability being cast) Equal to Repair Gate
- Conditions
- Or - Any (Conditions) are true
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Ability being cast) Equal to Open Gate
- (Unit-type of (Triggering unit)) Equal to Gate (Closed Iron Horizontal)
- Then - Actions
- Unit - Replace (Triggering unit) with a Gate (Open Iron Horizontal) using The old unit's relative life and mana
- Animation - Play (Last replaced unit)'s death alternate animation
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Ability being cast) Equal to Close Gate
- (Unit-type of (Triggering unit)) Equal to Gate (Open Iron Horizontal)
- Then - Actions
- Unit - Replace (Triggering unit) with a Gate (Closed Iron Horizontal) using The old unit's relative life and mana
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Ability being cast) Equal to Repair Gate
- (Unit-type of (Triggering unit)) Equal to Gate (Dead Iron Horizontal)
- Then - Actions
- Unit - Replace (Triggering unit) with a Gate (Open Iron Horizontal) using The new unit's max life and mana
- Animation - Play (Last replaced unit)'s death alternate animation
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
And for changing ownership on death:
Trigger:
- Gate dies
- Events
- Unit - A unit Dies
- Conditions
- Or - Any (Conditions) are true
- Conditions
- (Unit-type of (Dying unit)) Equal to Gate (Open Iron Horizontal)
- (Unit-type of (Dying unit)) Equal to Gate (Closed Iron Horizontal)
- (Unit-type of (Dying unit)) Equal to Gate (Dead Iron Horizontal)
- Conditions
- Or - Any (Conditions) are true
- Actions
- Unit - Replace (Triggering unit) with a Gate (Dead Iron Horizontal) using The new unit's max life and mana
- Unit - Change ownership of (Last replaced unit) to (Owner of (Killing unit)) and Change color
- Animation - Play (Last replaced unit)'s death animation
- Events
This all works fine. I can open and close a gate and repair it if it is destroyed.
However, there is one slight fault. Whenever I repair a gate, it's animation goes to stand (as all models share the same model) when it should be staying at death. I've tried countering this with a trigger:
Trigger:
- Start Repairing Gate
- Events
- Unit - A unit Begins casting an ability
- Conditions
- (Ability being cast) Equal to Repair Gate
- Actions
- Animation - Play (Triggering unit)'s death animation
- Events
And in the 'Repair Gate' ability I tried setting the Art - Animation Names to death,alternate. Unfortunately, these two methods have not worked and my gate still goes back to it's stand animation.
Any ideas of how I can solve this problem?