• 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.

[Help] GUI Triggerspell

Status
Not open for further replies.
Level 2
Joined
Aug 10, 2007
Messages
5
Hi there.. i made a new spell for one of my heroes. Basicly its pretty much like a Summon Serpent Wards Skill but i wanted to let the "Serpent Wards" be summoned in a small random Area around the target Point. I made this because i use a Doodad-Model in exchange of the Serpent Ward Model and it looks way better when all the Wards aren't crowded at one single point.

The Spell is working, but there are some bugs and it seems to me that the Code is way more complicated than it should be. My first Trigger spell though.

Here's the Code
  • Tormented Souls
    • Ereignisse
      • Einheit - A unit starts to cast a Ability
    • Bedingungen
      • (Ability being cast) Gleich Tormented Souls
    • Aktionen
      • Set TargetPoint = (Region centered at (Target point of ability being cast) with size (200.00, 200.00))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Bedingungen
          • (Real((Level of Tormented Souls for (Triggering unit)))) Gleich 1.00
        • 'THEN'-Aktionen
          • Sound - Play UndeadDissipate2 <gen>
          • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
          • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
          • Einheitengruppe - Add (Last created unit) to Grave
          • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
          • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
          • Einheitengruppe - Add (Last created unit) to Grave
          • Wait 7.00 seconds
          • Einheit - Kill (Random unit from Grave)
          • Einheit - Kill (Random unit from Grave)
        • 'ELSE'-Aktionen
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Bedingungen
              • (Real((Level of Tormented Souls for (Triggering unit)))) Gleich 2.00
            • 'THEN'-Aktionen
              • Sound - Play UndeadDissipate2 <gen>
              • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
              • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
              • Einheitengruppe - Add (Last created unit) to Grave
              • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
              • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
              • Einheitengruppe - Add (Last created unit) to Grave
              • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
              • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
              • Einheitengruppe - Add (Last created unit) to Grave
              • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
              • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
              • Einheitengruppe - Add (Last created unit) to Grave
              • Wait 7.00 seconds
              • Einheit - Kill (Random unit from Grave)
              • Einheit - Kill (Random unit from Grave)
              • Einheit - Kill (Random unit from Grave)
              • Einheit - Kill (Random unit from Grave)
            • 'ELSE'-Aktionen
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • 'IF'-Bedingungen
                  • (Real((Level of Tormented Souls for (Triggering unit)))) Gleich 3.00
                • 'THEN'-Aktionen
                  • Sound - Play UndeadDissipate2 <gen>
                  • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
                  • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
                  • Einheitengruppe - Add (Last created unit) to Grave
                  • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
                  • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
                  • Einheitengruppe - Add (Last created unit) to Grave
                  • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
                  • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
                  • Einheitengruppe - Add (Last created unit) to Grave
                  • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
                  • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
                  • Einheitengruppe - Add (Last created unit) to Grave
                  • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
                  • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
                  • Einheitengruppe - Add (Last created unit) to Grave
                  • Spezialeffekt - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Undead\RaiseSkeletonWarrior\RaiseSkeleton.mdx
                  • Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing Vorgabe für Gebäude-Ausrichtung degrees
                  • Einheitengruppe - Add (Last created unit) to Grave
                  • Wait 7.00 seconds
                  • Einheit - Kill (Random unit from Grave)
                  • Einheit - Kill (Random unit from Grave)
                  • Einheit - Kill (Random unit from Grave)
                  • Einheit - Kill (Random unit from Grave)
                  • Einheit - Kill (Random unit from Grave)
                  • Einheit - Kill (Random unit from Grave)
                • 'ELSE'-Aktionen
                  • Do nothing
The Ability Tormented Souls summons a DummyUnit at the Target, the Target Points is saved by a variable, a 100x100 Area around the TargetPoint gets formed, 1-6 Units get summoned at random points in the area, they get picked in a variable, they get killed after 7 seconds.

The Problem is that i can't make the Units unsummon themselfs like a normal Summon Skill (Or can i?), so i have to kill the Units after some time by a Trigger, but the way i do it (Save the Units in a Variable and kill them by Random) doesn't work correct. Sometimes it works, but sometimes only a few of the summoned Units get killed or even none of them. And the Code seems very unclean to me, but i dont know any better way.



I have second Problem with another summon Skill. This one is a normal summon Skill, based on Summon Spirit Wolfs just with exchanged Data, but i want the summoned Units to leave Corpses. I tried to kill/leave them Corpses by Trigger but it won't work correct, any ideas?
 
Last edited:
Level 16
Joined
Oct 30, 2004
Messages
1,277
The Ability Tormented Souls summons a DummyUnit at the Target, the Target Points is saved by a variable, a 100x100 Area around the TargetPoint gets formed, 1-6 Units get summoned at random points in the area, they get picked in a variable, they get killed after 7 seconds.

The Problem is that i can't make the Units unsummon themselfs like a normal Summon Skill (Or can i?), so i have to kill the Units after some time by a Trigger, but the way i do it (Save the Units in a Variable and kill them by Random) doesn't work correct. Sometimes it works, but sometimes only a few of the summoned Units get killed or even none of them. And the Code seems very unclean to me, but i dont know any better way.

  • Unit - Add a 7.00 second Generic expiration timer to (Triggering unit)
Btw, you should use the trigger tags instead of the code tag. It's also hard to read when there are so many german words. I can guess what they mean, but it still looks messy in my eyes. I believe WEU translates everything into english, so maybe you should use that and copy the trigger then.
 
Level 2
Joined
Aug 10, 2007
Messages
5
First thanks for the quick answer! I hate myself for not seeing that Trigger.. i searched the whole something like that..

Sorry because of the german code.. i already thought about translating my editor to english.. guess its time to do it.
 
Level 6
Joined
Mar 2, 2006
Messages
306
lets go through the trigger:

Set TargetPoint = (Region centered at (Target point of ability being cast) with size (200.00, 200.00))
location leak
(Real((Level of Tormented Souls for (Triggering unit)))) Gleich 1.00
no need to convert integer to real
Spezialeffekt - Create a special effect at (Position of (Last created unit)) using ...
location leak; also: you can not use (Last created unit) here since you haven't created any units recently; also: destroy that effect...
Einheit - Create 1 Tormented Soul (Stufe 1) for (Owner of (Triggering unit)) at (Random point in TargetPoint) facing ...
location leak; action should be above the previous one
Einheitengruppe - Add (Last created unit) to Grave
clean up the unit group before you start using it like this
Wait 7.00 seconds
because of waiting, only one unit can have this spell; also: use game-time waits instead
Einheit - Kill (Random unit from Grave)
killing a unit doesn't remove it from unit group. sometimes (at random) you order the game to kill a dead unit

once you fix that, the only thing left is to remove the level-branch:
instead of saying "if level=1 then create unit, create unit; if level=2 then create unit, create unit, create unit, create unit; if level=2 then create unit, create unit, create unit, create unit, create unit, create unit" (yes, i know what it looks like)...
...you would say: "for integer A = 1 to 2*level do multiple actions" and in actions-section you say "create unit, do effect, destroy effect, add unit to group"

that's about it...
 
Status
Not open for further replies.
Top