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

[Trigger] Birthing Animation.

Status
Not open for further replies.
Level 5
Joined
Nov 21, 2014
Messages
151
Okay I made this, (from a website) with a trigger, one problem, the transperancy also sets the birthing animation to 100% transperant, but if I don't do that, you can see the old building animation... someone help!! Thanks in advance!:thumbs_up:
Trigger:

  • DemonBirth
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Constructing structure)) Equal to Doom Tower (75s)
          • (Unit-type of (Constructing structure)) Equal to Flesh Mill (70s)
          • (Unit-type of (Constructing structure)) Equal to Warlock Temple (60s)
          • (Unit-type of (Constructing structure)) Equal to Inferno Vault (60s)
          • (Unit-type of (Constructing structure)) Equal to Void Shrine (60s)
          • (Unit-type of (Constructing structure)) Equal to Demon Gate (60s)
          • (Unit-type of (Constructing structure)) Equal to Legion Portal (60s)
          • (Unit-type of (Constructing structure)) Equal to Altar of Terror (50)
          • (Unit-type of (Constructing structure)) Equal to Fountain of Blood (50s)
          • (Unit-type of (Constructing structure)) Equal to Succorbenoth (50s)
    • Actions
      • Custom script: local effect udg_SFX
      • Custom script: local unit udg_Building
      • Set Building = (Constructing structure)
      • Animation - Change Building's vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
      • Special Effect - Create a special effect attached to the origin of Building using war3mapImported\DemonBirth.mdx
      • Set SFX = (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of Building) Equal to Warlock Temple (60s)
              • (Unit-type of Building) Equal to Inferno Vault (60s)
              • (Unit-type of Building) Equal to Void Shrine (60s)
              • (Unit-type of Building) Equal to Legion Portal (60s)
              • (Unit-type of Building) Equal to Demon Gate (60s)
        • Then - Actions
          • Wait 60.00 seconds
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Unit-type of Building) Equal to Fountain of Blood (50s)
                  • (Unit-type of Building) Equal to Altar of Terror (50)
                  • (Unit-type of Building) Equal to Succorbenoth (50s)
            • Then - Actions
              • Wait 50.00 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of Building) Equal to Doom Tower (75s)
                • Then - Actions
                  • Wait 75.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of Building) Equal to Flesh Mill (70s)
                    • Then - Actions
                      • Wait 70.00 seconds
                    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Building is alive) Equal to True
        • Then - Actions
          • Special Effect - Destroy SFX
          • Animation - Change Building's vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
        • Else - Actions
EDIT: also the SFX doesn't get removed..
 
Last edited:
Level 5
Joined
Nov 21, 2014
Messages
151
Of course it does. the only way possible is you have to wait until the construction is done before making the transparency to 100%. Though I don't get how that can let the players see the old building animation.

The idea was, it starts building, make it invisible (so it doesn't have its birth animation) paste the new birth animation, when the building is done, make it visible again, kill the new birth animation. But when you make the building invisible, the sfx goes too, and vice versa :ogre_rage::ogre_rage::ogre_rage:
 
Level 5
Joined
Nov 21, 2014
Messages
151
The workaround probably is you have to make the new birth animation as a dummy instead of sfx. Time it so the animation ends the same time when the building finishes constructing then remove it from the game.

Does that work with locals?
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
  • Custom script: local unit u = CreateUnit(Player(0), 'abcd', GetUnitX(GetTriggerUnit), GetUnitY(GetTriggerUnit(), 0.00)
this would create a unit of type 'abcd' for player 1 at the position of the triggering unit.
To get the dummies unit id, you need to press Ctrl + D in object editor.

i could do this trigger for you tommorow, if you want. You just need a JNGP editor ;)
 
Level 5
Joined
Nov 21, 2014
Messages
151
  • Custom script: local unit u = CreateUnit(Player(0), 'abcd', GetUnitX(GetTriggerUnit), GetUnitY(GetTriggerUnit(), 0.00)
this would create a unit of type 'abcd' for player 1 at the position of the triggering unit.
To get the dummies unit id, you need to press Ctrl + D in object editor.

i could do this trigger for you tommorow, if you want. You just need a JNGP editor ;)

Sure, anything to make it work!:grin:
 
Level 5
Joined
Nov 21, 2014
Messages
151
This should work. To edit the animation, change the dummy's model, and to give certain buildings the new animation, add the dummy ability to the building.

Amazing! How do I add my buildings / animation to it though?
It works flawless in the Normal WE but in the JNGP one it says: " wehack:lua:437: attempt to index global 'rtc_enabled' (a nil value) (First time using this program by the way) Can't give you any more rep for now... Will do when I can!
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
that's weird

i made a dummy unit into the test map, change the model of it to the animation you want.
you also need to set the variable in the Setup trigger to the dummy that you want to use as an animation.
same goes for the dummy ability.

if you have problems, you can send me the map and i'll try to fix it
 
Level 5
Joined
Nov 21, 2014
Messages
151
that's weird

i made a dummy unit into the test map, change the model of it to the animation you want.
you also need to set the variable in the Setup trigger to the dummy that you want to use as an animation.
same goes for the dummy ability.

if you have problems, you can send me the map and i'll try to fix it

Ah I see, I got the animation, but how do I make it work for my buildings? just give them the dummy ability and done?

I think the error is a jass helper problem because in the normal WE it worked properly.
EDIT: there is definetely a problem here... My map instead of going to the game goes the main menu again when you try to open it ...
EDIT2: I now tried to copy it from the normal WE into the normal WE and get 65 compiling errors...
 
Level 5
Joined
Nov 21, 2014
Messages
151
Okay I have an update now, First of all, the animation for the building is a bit too big (the birth animation it self) secondly, When the building is done, it becomes visible again but my animation doesn't stop and keeps on going till it's finished..
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
EDIT: there is definetely a problem here... My map instead of going to the game goes the main menu again when you try to open it ...
you need to save the map everytime you do a change.
the animation for the building is a bit too big
you can change this by changing the dummy's size
it becomes visible again but my animation doesn't stop and keeps on going till it's finished..
in the DemonBirth System trigger, search for those 2 lines "call KillUnit(Dummy[id])" and replace them with "call RemoveUnit(Dummy[id])"
 
Level 5
Joined
Nov 21, 2014
Messages
151
you need to save the map everytime you do a change.

you can change this by changing the dummy's size

in the DemonBirth System trigger, search for those 2 lines "call KillUnit(Dummy[id])" and replace them with "call RemoveUnit(Dummy[id])"

You are obsolutely amazing! It worked! A last thing, this is not a problem of yours, or the map you sent me, but about the model I use for the animation... The animation is simple not long enough for certain buildings. it only goes to build time: ~55, while i have buildings that are 70 and 60... Is there a way to add to it or slow it down?

EDIT: I know you can slow it down with triggers too (unit change animation speed to X%) But i don't know how or where I should place this in your custom text one..
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
That should do it. It will stretch/shrink the animation speed based on the building time compared to the animation time.
For that, you need to go into the Setup trigger again and add your Objects there.
Increase the array size for each building and set the time to the building time. dont forget to increase the "Array_Size" variable too.
 

Attachments

  • DemonBirth.w3x
    71.4 KB · Views: 59
Level 5
Joined
Nov 21, 2014
Messages
151
that should do it. It will stretch/shrink the animation speed based on the building time compared to the animation time.
For that, you need to go into the setup trigger again and add your objects there.
Increase the array size for each building and set the time to the building time. Dont forget to increase the "array_size" variable too.

amazing!
 
Level 5
Joined
Nov 21, 2014
Messages
151
I found one visual annoyance. This doesn't have to be fixed, but if anyone happends to know the answer (I'm looking at you dwarf :ogre_datass: ) This happends sometimes when you build it: (see attachments:) Thanks in advance!

It like has an angle where the other side is taller (while I want it to be flat, stuck to the ground)

EDIT: also you made the dummy cost food... might wanna fix that if you ever gonna give it to somebody else :)
 

Attachments

  • uhh.png
    uhh.png
    1,023.1 KB · Views: 177
Level 5
Joined
Nov 21, 2014
Messages
151
whoops ;)

i made the dummy flying, thats why his height is a bit off near trees and stuff, i will try to find a solution for this tomorrow. i think removing the collision should do it.

Do you mean the collision size? Or something inside your trigger? Because you had set the collision size to 0 already :)
 
Level 5
Joined
Nov 21, 2014
Messages
151
Ok, you don't actually need to remove the collision, just set the Movement - Type of the dummy unit to "NONE" and it's fixed :)

It worked! You are wonderful! I will credit you in my map, if you like it or not! You took the time to help me out big time :grin::grin::thumbs_up::thumbs_up::wink::xxd:
 
Status
Not open for further replies.
Top