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

[Trigger] EXP Query

Status
Not open for further replies.
Level 22
Joined
Jul 25, 2009
Messages
3,091
  • Groups Gets a Kill
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
    • Actions
      • Set TempUnit = (Killing unit)
      • Set GroupEXP[(Custom value of TempUnit)] = (GroupEXP[(Custom value of TempUnit)] + 1)
      • Hashtable - Save GroupEXP[(Custom value of TempUnit)] as (Custom value of TempUnit) of (Player number of (Owner of TempUnit)) in Exptable[1]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load (Custom value of TempUnit) of (Player number of (Owner of TempUnit)) from Exptable[2]) Greater than or equal to 30
        • Then - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Load (Custom value of TempUnit) of (Player number of (Owner of TempUnit)) from Exptable[2]) Equal to (Load (Custom value of TempUnit) of (Player number of (Owner of TempUnit)) from Exptable[1])
            • Then - Actions
              • Set GroupRequirements[(Custom value of TempUnit)] = (GroupRequirements[(Custom value of TempUnit)] + 5)
              • Hashtable - Save GroupRequirements[(Custom value of TempUnit)] as (Custom value of TempUnit) of (Player number of (Owner of TempUnit)) in (Last created hashtable)
              • Set TempGroup = (Units in (Playable map area) matching ((Custom value of (Matching unit)) Equal to (Custom value of TempUnit)))
              • Unit Group - Pick every unit in TempGroup and do (Actions)
                • Loop - Actions
                  • Unit - Add EXP DMG Bonus to (Picked unit)
                  • Unit - Add EXP HP Bonus to (Picked unit)
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Level of Veterancy for TempUnit) Equal to 0
                    • Then - Actions
                      • Unit - Add Veterancy to (Picked unit)
                    • Else - Actions
                      • Unit - Set level of Veterancy for (Picked unit) to ((Load (Custom value of TempUnit) of (Player number of (Owner of TempUnit)) from Exptable[1]) / 5)
              • Custom script: call DestroyGroup(udg_TempGroup)
            • Else - Actions
  • Startup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Exptable[1] = (Last created hashtable)
      • Hashtable - Create a hashtable
      • Set Exptable[2] = (Last created hashtable)
Custom values query squads, squads gain exp for killing shit, every 5 kills is a level, levels stop at 30, every level gives the same bonus that stacks. Why doesn't it work?
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Why are you using 2 Hashtables? And why are you using them as a Hashtable array? I see no need for a Hashtable or for a Hashtable Array that in the trigger.


  • t
    • Hashtable - Save GroupEXP[(Custom value of TempUnit)] as (Custom value of TempUnit) of (Player number of (Owner of TempUnit)) in Exptable[1]
    • If - Conditions
      • (Load (Custom value of TempUnit) of (Player number of (Owner of TempUnit)) from Exptable[2]) Greater than or equal to 30
You save in Exptable[1] and then load from Exptable[2]. Where did you set the data of the Exptable[2]?
 
Status
Not open for further replies.
Top