• 🏆 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!

How To Rotate Buildable Structure With Trigger?

Status
Not open for further replies.
Either "Unit - Move (Triggering unit) instantly to (Center of (Playable map area)), facing Default building facing degrees" or "Unit - Move (Triggering unit) instantly to (Center of (Playable map area)), facing (Position of (Triggering unit))" can be used for this and also they allow for instant turning for anything without 'Amov' aka the movement ability.

Unsure if these work but you could try
"Actions
Unit - Make No unit face No unit over 0.00 seconds
Unit - Make No unit face (Center of (Playable map area)) over 0.00 seconds
Unit - Make No unit face Default building facing over 0.00 seconds"
as well.
 
Level 39
Joined
Feb 27, 2007
Messages
5,008
If you need it to change for all buildings for the whole map you can edit Gameplay Constants. My best guess is the second value is for NE Ancient-based buildings that can uproot and move, but I'm unsure. If I'm correct then you could potentially have 2 different default facings based on what race they are.
  • Building Facing Angle (degrees)
  • Building Facing Angle, Rooted (degrees)
@Dat-C3 that does not work for buildings without a movement type and base speed > 0; if you test you'll find they don't turn to face when ordered or when moved + facing via triggers. To get the facing action to work we build on this old thread with no replies:
  1. In the OE, set the building's movement type to "foot" or anything other than none
  2. In the OE, set the building's speed base to 1 (you do not have to change the other move speed values, they can stay at 0)
  3. Remove the 'Amov' (move) ability from the buildings with triggers whenever they are created (this can only be done with JASS or custom scripts, Move doesn't show up in the GUI ability list)
  4. Order them to face any point or unit at will, they will do it instantly as Dat-C3 described
Trigger to do this:
  • Catch
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • Unit-type of (triggering unit) equal to YOUR_BUILDING
    • Actions
      • Custom script: call UnitRemoveAbility(GetTriggerUnit(), 'Amov')
      • Unit - Make (Triggering Unit) face WHATEVER_FACING over 0.00 seconds
OE screenshot:
move.png
 
Level 7
Joined
Feb 20, 2016
Messages
274
Trigger worked but when going to build the structure it shows in the default angle, when I start building the structure will turn around to the angle given in the trigger. It looks a bit odd and inconsistent with the same type of structure from other faction. Maybe I should have them be separate models. I tried editing with 3DS MAX (and mdx importer exporter plugin), rotated it but it didnt change the rotation in game and doesnt load the textures.
 
Level 39
Joined
Feb 27, 2007
Messages
5,008
Just did more testing and the two values of default building orientation are indeed applied based on whether the building has the ancient classification or not. So change the appropriate constant, make all your rotated towers ancients, and make all of your regular towers not ancients. See below for other imperfect solutions.

If you want to edit the models, this is probably a good method to look into.

The UI will always show the building orientation at Default Building Facing when you're choosing where to place the building. There's no way around that except changing the value of that constant, which will affect all buildings on the map. You can get an instant rotation by removing the unit and making a new one with the right facing, but if you do that when construction begins it'll bork the building of the thing (except for for humans) so that is not an option. If you do it when construction finishes it will look weird because the model birth animation shows it being built in the 'wrong' orientation and it flips when it's complete. Here's a trigger that does that:

  • Rotate
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • Custom script: call BJDebugMsg("spawn")
      • Set tp = (Position of (Triggering unit))
      • Set ut = (Unit-type of (Triggering unit))
      • Set pl = (Owner of (Triggering unit))
      • Unit - Remove (Triggering unit) from the game
      • Unit - Create 1 ut for pl at tp facing 90.00 degrees
      • Custom script: call UnitRemoveAbility(bj_lastCreatedUnit,'Amov')
      • Custom script: call RemoveLocation(udg_tp)
There's no perfect solution here besides model edits; you're going to have to live with a subpar implementation of this because there really isn't another way without replacing on construct start AND getting the construction itself to re-start. There's no trigger action that will make a unit begin constructing after you've already created it. Why specifically do you want some buildings to have a different rotation?
 
Level 7
Joined
Feb 20, 2016
Messages
274
Ya seems so. Do you know what's the best software for doing this?
Do you also know why rotating it in 3DS Max doesn't actually rotate it, or why it has no textures when I import it to 3DS Max? I assume it's cause it uses WC3 textures but when I place it in WE it has no textures.
 
Level 39
Joined
Feb 27, 2007
Messages
5,008
It likely uses in-game textures that 3dsMax can't see, but they should work in-game. Did you try restarting your editor after importing? It could be an issue introduced by the new CASC filestructure that replaced .mpqs in 1.30.


I have next to 0 modeling experience so I can't help with the rotation. I would imagine that you simply rotated the view of the model, not the model itself. There could be a bone in the model that determines facing.
 
Level 7
Joined
Feb 20, 2016
Messages
274
I did try restarting but the still no textures. I'm also noob to modeling so I don't know how I could fix this and didn't see any bone. I have an idea of a workaround but I prefer fixing this problem through modeling. Anyways thanks for attempting to find a solution to this.

Update: Good news everyone! I found out how to rotate in War3ModelEditor Problem solved!
 
Last edited:
Status
Not open for further replies.
Top