• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Solved] Units spawing for the second time and how to make ghost units not make corpses using triggers.

Level 12
Joined
Aug 3, 2021
Messages
455
Hello it's Pekisa7. The first question is about units spawning twice and how to prevent it. I have already asked this question but when I was working with timers I accidentally ruined the already working trigger for the special units like fazalak , ras fleasheater and drakuru to not spawn twice. I have set it in the trigger to be like ras fleasheater = last created unit in another trigger where he acually spawns too and so forth. It acually spawned one unit but for the others two. The trigger where I put all the special units as last created unit worked but now it doesen't . For the other question. How do I make ghost units that I made transparent not leave corspes by using tirggers. I have set for the units that you can build to be can't raised does not decay. But for the ghost units I can't figure out how for them not to leave a corpse upon dying. Can you guys help me with this? Id be gratefull. Best regards from Pekisa7. Here are the triggers:
  • Set Reinforcmance
    • Events
    • Conditions
    • Actions
      • Set FazalaktheWebber = (Last created unit)
      • Set RasFlesheater = (Last created unit)
  • Raise Dead 07
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Raise Dead
    • Actions
      • Set RaiseUnitType = (Unit-type of (Target unit of ability being cast))
      • Set RaiseUnitPoint = (Position of (Target unit of ability being cast))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RaiseUnitType Equal to Villager (Wakable)
        • Then - Actions
          • Unit - Create 1 Zombie for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
          • Set RaiseSummon = (Last created unit)
          • Animation - Play RaiseSummon's birth animation
          • Animation - Queue RaiseSummon's stand animation
          • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RaiseUnitType Equal to Villager (Walkable)
            • Then - Actions
              • Unit - Create 1 Zombie for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
              • Set RaiseSummon = (Last created unit)
              • Animation - Play RaiseSummon's birth animation
              • Animation - Queue RaiseSummon's stand animation
              • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • RaiseUnitType Equal to Villager (Walkable)
                • Then - Actions
                  • Unit - Create 1 Zombie for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
                  • Set RaiseSummon = (Last created unit)
                  • Animation - Play RaiseSummon's birth animation
                  • Animation - Queue RaiseSummon's stand animation
                  • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • RaiseUnitType Equal to Villager (Walkable)
                    • Then - Actions
                      • Unit - Create 1 Zombie for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
                      • Set RaiseSummon = (Last created unit)
                      • Animation - Play RaiseSummon's birth animation
                      • Animation - Queue RaiseSummon's stand animation
                      • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • RaiseUnitType Equal to Villager (Walkable)
                        • Then - Actions
                          • Unit - Create 1 Zombie for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
                          • Set RaiseSummon = (Last created unit)
                          • Animation - Play RaiseSummon's birth animation
                          • Animation - Queue RaiseSummon's stand animation
                          • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • RaiseUnitType Equal to Hawkstrider
                            • Then - Actions
                              • Unit - Create 1 Hawkstrider for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
                              • Unit - Set Name of (Last created unit) to Spectral Hawkstrider
                              • Unit - Add classification of Undead to (Last created unit)
                              • Set RaiseSummon = (Last created unit)
                              • Animation - Play RaiseSummon's birth animation
                              • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
                              • Animation - Queue RaiseSummon's stand animation
                              • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                              • Unit - Resume corpse decay for (Last created unit)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • RaiseUnitType Equal to Shal Lightbinder
                                • Then - Actions
                                  • Unit - Create 1 Shal Darkbinder (Undead) for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
                                  • Set RaiseSummon = (Last created unit)
                                  • Animation - Play RaiseSummon's birth animation
                                  • Animation - Queue RaiseSummon's stand animation
                                  • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • RaiseUnitType Equal to Granis The Protector
                                    • Then - Actions
                                      • Unit - Create 1 Granis The Protector (Undead) for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
                                      • Set RaiseSummon = (Last created unit)
                                      • Animation - Play RaiseSummon's birth animation
                                      • Animation - Queue RaiseSummon's stand animation
                                      • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • RaiseUnitType Equal to Pit Lord
                                        • Then - Actions
                                          • Unit - Create 1 Pit Lord for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
                                          • Unit - Set Name of (Last created unit) to Spectral Pit Lord
                                          • Unit - Add classification of Undead to (Last created unit)
                                          • Set RaiseSummon = (Last created unit)
                                          • Animation - Play RaiseSummon's birth animation
                                          • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
                                          • Animation - Queue RaiseSummon's stand animation
                                          • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                                          • Unit - Resume corpse decay for (Last created unit)
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • RaiseUnitType Equal to Dreadlord
                                            • Then - Actions
                                              • Unit - Create 1 Dreadlord for Player 4 (Purple) at RaiseUnitPoint facing Default building facing degrees
                                              • Unit - Set Name of (Last created unit) to Spectral DreadLord
                                              • Unit - Add classification of Undead to (Last created unit)
                                              • Set RaiseSummon = (Last created unit)
                                              • Animation - Play RaiseSummon's birth animation
                                              • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
                                              • Animation - Queue RaiseSummon's stand animation
                                              • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                                              • Unit - Resume corpse decay for (Last created unit)
                                            • Else - Actions
                                              • Custom script: call RemoveLocation( udg_RaiseUnitPoint )
I'm using patch 1.31.1 btw.
 
Last edited:
Regarding your second question, the simplest approach is probably to just modify the death type flags via trigger using the action 'Unit - Set Unit Boolean Field' and modifying both flags "Decayable ('udec')" and "Raisable ('urai')" to False. You can also change death time of such unit, for example to 0.00, so the unit disappears immediately and have another trigger that detects the ghost's death, through which you spawn some nice custom effect.
  • Unit - Set Unit: your_unit's Boolean Field: Raisable ('urai') to Value: False
  • Unit - Set Unit: your_unit's Boolean Field: Decayable ('udec') to Value: False
  • Unit - Set Unit: your_unit's Real Field: Death Time (seconds) ('udtm') to Value: 0.00
As for your first question about how to prevent unit from being spawned twice, that kind of depends on when this happens. But probably the most universal approach would be to use a boolean variable, something like this:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Fazalak_Spawned Equal to False
    • Then - Actions
      • Set VariableSet Fazalak_Spawned = True
      • Unit - Create 1 Fazalak for some_player at some_location facing Default building facing degrees
    • Else - Actions
 
Regarding your second question, the simplest approach is probably to just modify the death type flags via trigger using the action 'Unit - Set Unit Boolean Field' and modifying both flags "Decayable ('udec')" and "Raisable ('urai')" to False. You can also change death time of such unit, for example to 0.00, so the unit disappears immediately and have another trigger that detects the ghost's death, through which you spawn some nice custom effect.
  • Unit - Set Unit: your_unit's Boolean Field: Raisable ('urai') to Value: False
  • Unit - Set Unit: your_unit's Boolean Field: Decayable ('udec') to Value: False
  • Unit - Set Unit: your_unit's Real Field: Death Time (seconds) ('udtm') to Value: 0.00
As for your first question about how to prevent unit from being spawned twice, that kind of depends on when this happens. But probably the most universal approach would be to use a boolean variable, something like this:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Fazalak_Spawned Equal to False
    • Then - Actions
      • Set VariableSet Fazalak_Spawned = True
      • Unit - Create 1 Fazalak for some_player at some_location facing Default building facing degrees
    • Else - Actions
Thank you so much friend! It works! Both of the triggers work.
 
Back
Top