• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Rifleman set as building not turning

Level 3
Joined
Mar 14, 2022
Messages
17
Hey! I'm new to map making, and have been educating myself through Tutorials on the Hive. I don't want to ask any questions that have an obvious answer, so will only post when I feel I have absolutely no idea.

I'm building a TD where I have some towers based on Unit models (Such as a Rifleman and Canons), but the guns don't follow with the rest of the animation when it turns. Is there a way to fix the animation so the gun goes with the unit, or the unit can turn on the spot without being able to move completely?

Apologies if there is a really simple fix for this I cant seem to find or work out.

Solved - Tower Turning Tutorial

Note (from Uncle) -
You don't need a Spellbook - Find the root ability in the abilities tab, and set it's Hotkey (usually "R") to Blank/None and the Art - Button Positions to 0 (X), -11 (Y).

Note that you need to hold shift when opening a field to allow negative values. This can be useful for other things as well like a negative armor Devotion Aura that affects enemies.

Spellbooks were necessary back in the day when the Editor was lacking features. But now the only time you really need them is if you literally want a book full of spells that extends your normal command card.
 

Attachments

  • Turning Animation Fail.png
    Turning Animation Fail.png
    2.3 MB · Views: 12
Last edited:
Level 3
Joined
Mar 14, 2022
Messages
17
For SD graphics, models need to have a specific bone in order to be turning at all if they're used as buildings, but I have no idea how they work with reforged graphics
Is there a way I can make it so they fire and stay facing the one way instead?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
You can fix it with some triggers, although be warned of potential unwanted side effects.
  • Tower Finishes Construction
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Default movement speed of (Triggering unit)) Greater than 0.00
    • Actions
      • Set VariableSet Tower_Unit = (Triggering unit)
      • -------- --------
      • -------- Remove the Move ability from the tower: --------
      • Custom script: call UnitRemoveAbility( udg_Tower_Unit, 'Amov')
      • -------- --------
      • -------- Register an Event that forces the tower to face it's acquired attack target: --------
      • Trigger - Add to Tower Face Attack Target 1 <gen> the event (Unit - Tower_Unit Acquires a target)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Tower_Enable_Triggers Equal to False
        • Then - Actions
          • Set VariableSet Tower_Enable_Triggers = True
          • Trigger - Turn on Tower Face Attack Target 1 <gen>
          • Trigger - Turn on Tower Face Attack Target 2 <gen>
        • Else - Actions
  • Tower Face Attack Target 1
    • Events
    • Conditions
    • Actions
      • -------- This runs whenever a registered Tower acquires an enemy unit to attack --------
      • -------- Note: The Events of this trigger are added via Tower Finishes Construction --------
      • Unit - Make (Triggering unit) face (Targeted unit) over 0.00 seconds
  • Tower Face Attack Target 2
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • ((Triggering unit) is A structure) Equal to True
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(smart))
          • (Issued order) Equal to (Order(attack))
    • Actions
      • -------- This runs whenever a Tower is ordered to attack a unit (right click or manually) --------
      • Unit - Make (Triggering unit) face (Target unit of issued order) over 0.00 seconds
Also, you must ensure that your Tower has it's Speed Base set to a value greater than 0. It seems like you can leave Movement Type set to None but maybe set it to Foot for good measure.

Edit: Posted a second after Remixer, I think his solution is far more practical, if you're into that sort of thing :p
 

Attachments

  • Tower Facing Fix 1.w3m
    19.8 KB · Views: 3
Last edited:
Level 3
Joined
Mar 14, 2022
Messages
17
Thank you for everyone's help and suggestions!

Ok - I tried adding the 'root (Ancients)' ability to the Units 'Abilities - Normal' section with unfortunately no change. The Legs of the unit stay planted with the torso turning which makes for a great horror visual. :p

I could try this again by creating a whole new unit based on an ancient or ancient protector and see if that works? But theoretically I should be able to get it to function the same by editing the values under the unit regardless of the original base settings, right? (If I were to just copy the settings from an ancient tee for tee for example).

I had the units movement set to 0, so I change the base and maximum values to 1, which had the model turning correctly when I then removed the 'roots' ability. I also set the 'Movement Type' to Foot.

Is there a way to remove or hide the 'move' button from the units ability grid? In my head - The unit is turning correctly because it's technically moving extremely slowly at a speed of 1, and I doubt it would ever move enough to actually land in a different place on the map. This may not be the best solution though if the unit is still hypothetically able to move to a new position... eventually.

If I am just setting the roots ability up incorrectly - Then I'm keen to give that another go as well as it removes the move buttons from the unit.
 
Level 3
Joined
Mar 14, 2022
Messages
17
Update Solved - I found this Tutorial on the Hive and it works!

It's probably just explaining what you meant by using the Root Ability... But also how to set it up using a spellbook.

Thanks again!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,564
Update Solved - I found this Tutorial on the Hive and it works!

It's probably just explaining what you meant by using the Root Ability... But also how to set it up using a spellbook.

Thanks again!
You don't need a Spellbook, just set the Root abilities Hotkey to None and the Art - Button Positions to 0, -11.

Note that you need to hold shift when opening a field to allow negative values. This can be useful for other things as well like a negative armor Devotion Aura that affects enemies.

Spellbooks were necessary back in the day when the Editor was lacking features. But now the only time you really need them is if you literally want a book full of spells that extends your normal command card.
 
Level 3
Joined
Mar 14, 2022
Messages
17
You don't need a Spellbook, just set the Root abilities Hotkey to None and the Art - Button Positions to 0, -11.

Note that you need to hold shift when opening a field to allow negative values. This can be useful for other things as well like a negative armor Devotion Aura that affects enemies.

Spellbooks were necessary back in the day when the Editor was lacking features. But now the only time you really need them is if you literally want a book full of spells that extends your normal command card.
Ah! Yes - That works too and simplifies it more. Thank you so much!
 
Top