Birth Animation Integration

Status
Not open for further replies.
Level 7
Joined
Apr 1, 2011
Messages
151
Hey guys i'm working on a custom map and trying to make my buildings use a custom birth as a sfx, setting a time trigger to remove it. i was wondering if there is a way to remove the birth effect when the building is completed instead? (when i use warpten cheat for example it would detect the building has finished construction faster and delete the birth effect?)
 

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,166
Store the Sfx as a Variable in your begins construction trigger and then reference it later on in your Ends construction trigger.

I uploaded a map with an example of doing this with a Unit Indexer. The Unit Indexer assigns a unique # to each unit in the map. It assigns this number in the form of the unit's Custom Value. Using the custom value combined with a Variable's Array you can store almost endless amounts of data to a unit.

So in my map I create and link the Special Effect to the Constructing Structure using this method. I have a Special Effect Variable called Construction_Sfx that has an Array [], and I put the Structure's Custom Value into it. From that point on, if you want to reference the Special Effect then all you have to do is get the Structure's custom value. That can be done in both the "Begins construction" and "Finishes construction" Events since we know that the Constructing AND Constructed Structure is the same unit.
The Array Index [] for Construction_Sfx will always be different for each Structure since each Structure has it's own unique Custom Value.

Example:
Let's say you create three structures. The Unit Indexer will assign a unique Custom Value to each of them as they enter the map:
Structure 1's Custom Value = 1
Structure 2's Custom Value = 2
Structure 3's Custom Value = 3

So in our Begins Construction trigger we create the Special Effect, get our Structure's Custom Value (UDex), and plug that value into Construction_Sfx's Index.

Index = The Integer in the [brackets].
  • Begin Construction Sfx
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set VariableSet UDex = (Custom value of (Constructing structure))
      • Set VariableSet Point = (Position of (Constructing structure))
      • Special Effect - Create a special effect at Point using Abilities\Spells\Orc\Voodoo\VoodooAura.mdl
      • Set VariableSet Construction_Sfx[UDex] = (Last created special effect)
      • Custom script: call RemoveLocation (udg_Point)
^The Variable UDex is an Integer that I use simply as a shortcut. It's a lot easier to reference UDex rather than "custom value of constructing structure" over and over again.

So:
Construction_Sfx[1] is assigned to Structure 1
Construction_Sfx[2] is assigned to Structure 2
Construction_Sfx[3] is assigned to Structure 3

If we were to create a 4th Structure it's Custom Value would be 4 and it's special effect would be Construction_Sfx[4].
 

Attachments

  • Construction Sfx.w3m
    21.2 KB · Views: 42
Last edited:

Uncle

Warcraft Moderator
Level 69
Joined
Aug 10, 2018
Messages
7,166
Point = A Point variable.
Construction_Sfx[] = A Special Effect variable with an Array.

Are you not using the latest patch?

Here are the triggers if you wish to recreate it yourself:
  • Begin Construction Sfx
    • Events
      • Unit - A unit Begins construction
    • Conditions
    • Actions
      • Set VariableSet UDex = (Custom value of (Constructing structure))
      • Set VariableSet Point = (Position of (Constructing structure))
      • Special Effect - Create a special effect at Point using Abilities\Spells\Orc\Voodoo\VoodooAura.mdl
      • Set VariableSet Construction_Sfx[UDex] = (Last created special effect)
      • Custom script: call RemoveLocation (udg_Point)
  • Finish Construction Sfx
    • Events
      • Unit - A unit Finishes construction
    • Conditions
    • Actions
      • Set VariableSet UDex = (Custom value of (Constructed structure))
      • Special Effect - Destroy Construction_Sfx[UDex]
  • Cancel Construction Sfx
    • Events
      • Unit - A unit Cancels construction
    • Conditions
    • Actions
      • Set VariableSet UDex = (Custom value of (Cancelled structure))
      • Special Effect - Destroy Construction_Sfx[UDex]
And the Unit Indexer:
GUI Unit Indexer 1.4.0.0
Simply copy and paste the Unit Indexer folder into your map. Nothing else required to do. I recommend importing the Unit Indexer first before creating these triggers.
 
Last edited:
Status
Not open for further replies.
Top