• 🏆 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] trigger help

Status
Not open for further replies.
Level 7
Joined
Nov 17, 2019
Messages
224
I had an idea where a hero summons a cloud of mist for his ultimate, and if the mist survive for 12 in game seconds the cloud or mist turns into a powerful unit. So far it works, but it only summons an earth titan (earth elemental) the other parts of it somehow don't work, it also does not flash the integer that was picked for the randomizing process, here is the trigger below, plz help

  • Untitled Trigger 1A
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
      • (Unit-type of (Summoned unit)) Equal to Cosmic Mist (Summoning) 2
    • Actions
      • Set ASummonU = (Summoned unit)
      • Set I = (Random integer number between 0 and 4)
      • Game - Display to (All players) the text: (String(I))
      • Wait 12.00 game-time seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ASummonU is alive) Equal to True
        • Then - Actions
          • Special Effect - Create a special effect at (Position of ASummonU) using Abilities\Spells\Items\AIil\AIilTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Wait 0.30 game-time seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • I Equal to 1
            • Then - Actions
              • Unit - Replace ASummonU with a Rock Titan using The new unit's max life and mana
              • Unit - Add a 120.00 second Generic expiration timer to (Last replaced unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • I Equal to 2
                • Then - Actions
                  • Unit - Replace ASummonU with a Faceless One Deathbringer using The new unit's max life and mana
                  • Unit - Add a 120.00 second Generic expiration timer to (Last replaced unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • I Equal to 3
                    • Then - Actions
                      • Unit - Replace ASummonU with a Magnataur Destroyer using The new unit's max life and mana
                      • Unit - Add a 120.00 second Generic expiration timer to (Last replaced unit)
                    • Else - Actions
        • Else - Actions
          • Do nothing
 
So far it works, but it only summons an earth titan
I guess you mean "Rock Titan", as I don't see any line with "Earth Titan?

File -> Preferences -> Test Map -> Checkbox "Use Fixed Random Seed" -- ensure it is checked.

Are you aware of the spell only works for 1 instance, meaning "ASummonU" and "I" are global variables, which might get overwritten during the 12 seconds.
The random number can be solved easily, as you can just do "(Random integer number between 0 and 4)" right before you need it, and not at start.
For using the unit variable after time durations you could use
 
Level 7
Joined
Nov 17, 2019
Messages
224
I've checked that the "used Fixed Random Seed" box is checked

The variable ASummonU and i are only used for this trigger, and this trigger only applies to a single spell the cooldown of which is 60 seconds (much longer than 12)

No matter where I located the Random integer between 0 and 2 I get the same result, a rock titan is summoned, what's even more frustrating is that a rock titan is summoned even when I disable the trigger and turn it off, something is really off here
 
Maybe the spell just creates a rock titan, and trigger has nothing to do with it and doesn't even fire? You can put actions "Game - Displey Message" to check if which part of trigger runs.
No matter where I located the Random integer between 0 and 2 I get the same result
You do "(Random integer number between 0 and 4)", so 0,1,2,3,4
this trigger only applies to a single spell
Is the spell only used by 1 unit?
 
Level 7
Joined
Nov 17, 2019
Messages
224
The spell creates a mist cloud (the effect a dragonhawk can produce via cloud) no matter where in the trigger I put game - display message it doesn't show up, and yes its a trigger for one unit's ability, a really good ultimate
 
Level 7
Joined
Nov 17, 2019
Messages
224
You were right about it being a cast event, I tested it and it worked just fine with a few tweaks, wonder why my other abilities which have "a unit spawns a summon unit" as the event have worked fine so far, except for this one.
 
Status
Not open for further replies.
Top