• 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.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[Trigger] Spell Problems

Status
Not open for further replies.
Level 7
Joined
Jul 9, 2008
Messages
253
Hello everybody, I got some problems with one of my spells. The spell should do AoE damage per second for 5 seconds long on the place where you used it. But I've been trying for so long that I can't think anymore. So I need your help to figure it out.

(If the triggers don't make sense, then it's because I was desperate to make it work)

Trigger 1:

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Emberstorm
  • Actions
    • Set Unit = (Casting unit)
    • Set Ability = (Ability being cast)
    • Set Player = (Owner of Unit)
    • -------- --------------------------- --------
    • Set ConstantDamage = 10.00
    • Set LevelDamage = 10.00
    • Set AbilityPowerFactor = 0.20
    • Set Number = 5
    • Set Time = 1.00
    • -------- --------------------------- --------
    • Set Level = (Level of Ability for Unit)
    • Set Damage = (((Real(Level)) x LevelDamage) + ConstantDamage)
    • Set Location = (Target point of ability being cast)
    • -------- --------------------------- --------
    • Unit - Create 1 Dummy for Player at Location facing Default building facing degrees
    • Set Dummy = (Last created unit)
    • Unit - Add a 5.10 second Generic expiration timer to Dummy
    • -------- --------------------------- --------
    • Hashtable - Save Damage as 0 of (Key (Last created unit)) in ESTable
    • Hashtable - Save Number as 1 of (Key (Last created unit)) in ESTable
    • Hashtable - Save Time as 2 of (Key (Last created unit)) in ESTable
    • Unit Group - Add Dummy to ESGroup
    • -------- --------------------------- --------
    • Custom script: call RemoveLocation( udg_Location )
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Emberstorm <gen> is on) Equal to False
      • Then - Actions
        • Trigger - Turn on Emberstorm <gen>
      • Else - Actions
Trigger 2:

  • Events
    • Time - Every 0.10 seconds of game time
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Number of units in ESGroup) Greater than 0
      • Then - Actions
        • Unit Group - Pick every unit in ESGroup and do (Actions)
          • Loop - Actions
            • Set Damage = (Load 0 of (Key (Picked unit)) from ESTable)
            • Set Number = (Key (Load 1 of (Key (Picked unit)) in ESTable))
            • Set Time = (Load 2 of (Key (Picked unit)) from ESTable)
            • Set Unit = (Picked unit)
            • Set Player = (Owner of Unit)
            • Set Location = (Position of Unit)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Number Greater than 0
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • And - All (Conditions) are true
                      • Conditions
                        • Time Greater than 0.00
                  • Then - Actions
                    • Hashtable - Save (Time - 0.10) as 2 of (Key (Picked unit)) in ESTable
                  • Else - Actions
                    • Hashtable - Save (Number - 1) as 1 of (Key (Picked unit)) in ESTable
                    • Hashtable - Save (Time + 1.00) as 2 of (Key (Picked unit)) in ESTable
                    • -------- --------------------------- --------
                    • Set Group = (Units within 180.60 of Location matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of Player) Equal to False)))
                    • Unit Group - Pick every unit in Group and do (Unit - Cause Unit to damage (Picked unit), dealing Damage damage of attack type Spells and damage type Normal)
                    • -------- --------------------------- --------
                    • Special Effect - Create a special effect at Location using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                    • Special Effect - Destroy (Last created special effect)
              • Else - Actions
                • Unit Group - Remove Unit from ESGroup
                • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in ESTable
            • Custom script: call RemoveLocation( udg_Location )
      • Else - Actions
        • Trigger - Turn off (This trigger)
So I hope someone can help me, if something isn't clear about what the spell should do just post :)

Thanks in advance, Quetzalcotl
 
Yeah, had the same problem today :/

Why the hack isn't the spell working and I was deleting if-s, checking the triggers ten times... Then i realized that I should set a variable for Hashtable in Initialization trigger D:

If this isn't the reason, then look into your second trigger "Set Unit = (Picked unit)" Remove this and simply use picked unit (without variable), dunno could be a reason because it happened to me that if I set a var to picked unit, that variable become linked to one unit only...
 
Level 7
Joined
Jul 9, 2008
Messages
253
Hmm, my hashtable is working coz the spell did work only it didn't stop after 5 times. And when I change the picked unit thingy, I think the damage part will get messed up because that would mean: Picked unit damage Picked unit for damage. Doesn't make sense or?
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
You could debug it with "game - display..." and display your time and number variables.

For what are you using both time and number anyways?

-BerZeKeR- said:
Yeah, had the same problem today :/

Why the hack isn't the spell working and I was deleting if-s, checking the triggers ten times... Then i realized that I should set a variable for Hashtable in Initialization trigger D:

Ditto. Only the other day, after hitting "test map" about 6-7 times and trying to "fix" things I realised I hadn't initialized the hashtable :/
 
Status
Not open for further replies.
Top