[General] Skip Builder Build Animation

Status
Not open for further replies.
Level 6
Joined
Mar 27, 2019
Messages
51
Hi folks,

I'm using an Undead Builder and if that said Builder builds something and has something to do in his Build Queue List, he will play his Summon Animation without going to the next Building instantly (he takes his time).
Is there a way to make this instant? Like he builds the first one and paths towards the second one instantly, etc?

Tried to speed up the animation did not work...

Any help is highly appreciated!
 

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,279
I couldn't get anything simple to work but I think you could do something this:
1) Make the worker Flying or at least unable to collide with the structures
2) Detect when the worker issues a build order
3) In response to this order, create a Dummy unit which begins constructing the structure for you

Of course this means that your Worker won't have to move construct the buildings. Although I'm not too sure what you can do about the "I cannot summon there" error since the Dummy will be blocking the Worker's build spots.

Some other things which I messed with but didn't really help too much:
Cast Point - Cast Backswing (can speed up the cast animation)
SetUnitX() and SetUnitY() functions (moves a unit without interrupting it's orders)
 
Last edited:
Level 6
Joined
Mar 27, 2019
Messages
51
I couldn't get anything simple to work but I think you could do something this:
1) Make the worker Flying or at least unable to collide with the structures
2) Detect when the worker issues a build order
3) In response to this order, create a Dummy unit which begins constructing the structure for you

Of course this means that your Worker won't have to move construct the buildings. Although I'm not too sure what you can do about the "I cannot summon there" error since the Dummy will be blocking the Worker's build spots.

Some other things which I messed with but didn't really help too much:
Cast Point - Cast Backswing (can speed up the cast animation)
SetUnitX() and SetUnitY() functions (moves a unit without interrupting it's orders)
Yeah, I also tried some of these methods. I now have a working version of it.
Not with the Undead Build but with Human Build

  • Structure l Construct
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Unit Group - Add (Constructing structure) to Construct_Group
      • Trigger - Turn on Structure l Group <gen>

  • Structure l Group
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Construct_Group and do (Actions)
        • Loop - Actions
          • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
          • Unit - Set (Picked unit) construction progress to (Custom value of (Picked unit))%
          • Set VariableSet Temp_Integer = (Custom value of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Temp_Integer Greater than or equal to 100
            • Then - Actions
              • Unit - Set the custom value of (Picked unit) to 0
              • Unit Group - Remove (Picked unit) from Construct_Group.
              • Set VariableSet Temp_Point = (Position of (Picked unit))
              • Unit - Create 1 Your Main Builder for Neutral Passive at Temp_Point facing Default building facing degrees
              • Set VariableSet Temp_Unit = (Last created unit)
              • Custom script: call UnitAddAbility(udg_Temp_Unit,'Ahrp')
              • Custom script: call UnitAddAbility(udg_Temp_Unit,'Aloc')
              • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
              • Animation - Change (Last created unit)'s size to (0.00%, 0.00%, 0.00%) of its original size
              • Unit - Change ownership of (Last created unit) to (Owner of (Picked unit)) and Retain color
              • Unit - Order (Last created unit) to Human Peasant - Repair (Picked unit)
              • Unit - Add a 0.01 second Generic expiration timer to (Last created unit)
              • Custom script: call RemoveLocation(udg_Temp_Point)
              • Set VariableSet Temp_Integer = (Number of units in Construct_Group)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Temp_Integer Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions

  • Structure l Remove Dummy
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Your Main Builder
    • Actions
      • Unit - Remove (Triggering unit) from the game

Keep in mind that you need your Main Builder as your Dummy or else the created Unit cannot repair/finish the Building
Also remove the Repair (Human) Ability from your Main Builder to let him build the other Structures asap.

Example Map down below
 

Attachments

  • FastBuild.w3m
    14.5 KB · Views: 6

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,279
So I used your example to come up with a pretty clean solution. I created a Dummy version of the Main Builder which has the Locust/Repair abilities innately, and I made sure to give it the proper settings that a Dummy should have. Then I changed the Construct trigger to create this Dummy in response to the "Begins construction" Event and order it to build the structure. This doesn't work without a 0.00 second Wait, I assume because the "Begins construction" Event happens too early for the Dummy to begin repairing (maybe the structure can't be targeted yet?). Ideally, you'd use a 0.00 second Timer which would run the Repair order on the next frame but that's not going to make or break it.
  • Structure l Construct
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Wait 0.00 seconds
      • Set VariableSet Temp_Unit = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Temp_Unit is alive) Equal to True
        • Then - Actions
          • Set VariableSet Temp_Point = (Position of Temp_Unit)
          • Unit - Create 1 Your Main Builder (Dummy) for (Owner of Temp_Unit) at Temp_Point facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_Temp_Point)
          • Unit - Order (Last created unit) to Human Peasant - Repair Temp_Unit
        • Else - Actions
This trigger runs when the Dummy finishes/stops constructing a structure:
  • Structure l Remove Dummy
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Your Main Builder (Dummy)
    • Actions
      • Unit - Remove (Triggering unit) from the game


Also, I recommend against setting Custom Value yourself and instead using this system. It assigns each unit a unique Custom Value automatically:
You can then use Variable arrays in combination with a unit's Custom Value in order to store near endless amounts of data to it. For example:
  • Unit - Create 1 Footman...
  • Set Variable Luck[Custom value of (Last created unit)] = 5
  • Set Variable SpellLifesteal[Custom Value of (Last created unit)] = 0.25
  • Unit - Create 1 Rifleman...
  • Set Variable Luck[Custom value of (Last created unit)] = 10
  • Set Variable SpellLifesteal[Custom Value of (Last created unit)] = 0.50
We've now assigned two new custom stats to these units, one that tracks the unit's Luck stat and the other that tracks it's Spell Lifesteal stat. ANY type of data can be tracked this way -> Special Effect, Unit, Point, String, etc.

Then whenever we want to get this data from a unit we simply plug it's Custom Value into the [index] of our desired Variable array:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Luck Boost
  • Actions
    • Set Variable CV = Custom value of (Triggering unit)
    • Set Variable Luck[CV] = Luck[CV] + 10
    • Game - Display to (All players) for 30.00 seconds the text: (String(Luck[CV])
 

Attachments

  • FastBuild 2.w3m
    12.4 KB · Views: 6
Last edited:
Level 6
Joined
Mar 27, 2019
Messages
51
Yeah thats pretty clean, however I would create the Unit for Neutral Passive and then change its ownership so it doesn't count towards the Units created Leaderboard after a Game, just a preference tho.

  • Unit - Create 1 Your Main Builder (Dummy) for Neutral Passive at Temp_Point facing Default building facing degrees
  • Unit - Change ownership of (Last created unit) to (Owner of Temp_Unit) and Retain color
Thanks for your submit.
I rather tend to not use such Systems because my Projects ain't that overly complex and If I do such things I rather work with Hashtables (I know they most likely more performance intensive), I rarely work with Custom Value so there aren't any issues long term.
 
Status
Not open for further replies.
Top