• 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] About experience setting

Status
Not open for further replies.
Level 3
Joined
Mar 28, 2010
Messages
42
  • Demon Orc
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Demon Orc
    • Actions
      • Set CreepDieCount[1] = 0
      • Set CreepDie_group[1] = (Units within 1000.00 of (Position of (Dying unit)))
      • Unit Group - Pick every unit in CreepDie_group[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to True
            • Then - Actions
              • Set CreepDieCount[1] = (CreepDieCount[1] + 1)
              • Set CreepDieHero[CreepDieCount[1]] = (Picked unit)
            • Else - Actions
              • Do nothing
      • For each (Integer A) from 1 to CreepDieCount[1], do (Actions)
        • Loop - Actions
          • Hero - Add (61 / CreepDieCount[1]) experience to CreepDieHero[(Integer A)], Hide level-up graphics
      • Custom script: call DestroyGroup(udg_CreepDie_group[1])
but if in 1000 range only a hero...it will gained 122 exp==~
my setting is gained 61 exp...y gained double?
 
coz when you killed a unit, it will 'auto' gain experience...

try this...
- make an integer variable to store the experience from 'auto' gain
- after killing the orc, subtract it (it's like "gained experience - gained experience")
- then run your trigger

suggetions in your trigger;
- remove the do nothing
- casting unit >>> triggering unit
- position of something leaks if its not stored in a variable and removed
- you should put a matching condition in Units within 1000.00 blahhh, instead of putting another "IF" in >>> ((Picked unit) is A Hero) Equal to True
- the loop isnt good, you need to delay it by means of a timer or wait or a condition coz it will run instantly...
 
Level 3
Joined
Mar 28, 2010
Messages
42
coz when you killed a unit, it will 'auto' gain experience...

try this...
- make an integer variable to store the experience from 'auto' gain
- after killing the orc, subtract it (it's like "gained experience - gained experience")
- then run your trigger

suggetions in your trigger;
- remove the do nothing
- casting unit >>> triggering unit
- position of something leaks if its not stored in a variable and removed
- you should put a matching condition in Units within 1000.00 blahhh, instead of putting another "IF" in >>> ((Picked unit) is A Hero) Equal to True
- the loop isnt good, you need to delay it by means of a timer or wait or a condition coz it will run instantly...

but i already set the unit level = 0...the creep will not gain any exp when be kill...

  • Demon Orc
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Demon Orc
    • Actions
      • Set CreepDieCount[1] = 0
      • Set CreepDie_group[1] = (Units within 1000.00 of (Position of (Dying unit)) matching (((Picked unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in CreepDie_group[1] and do (Actions)
        • Loop - Actions
          • Wait 0.01 seconds
          • Set CreepDieCount[1] = (CreepDieCount[1] + 1)
          • Set CreepDieHero[CreepDieCount[1]] = (Picked unit)
      • For each (Integer A) from 1 to CreepDieCount[1], do (Actions)
        • Loop - Actions
          • Hero - Add (61 / CreepDieCount[1]) experience to CreepDieHero[(Integer A)], Hide level-up graphics
      • Custom script: call DestroyGroup(udg_CreepDie_group[1])
like this???
 
not that, but this...

  • Set CreepDieCount[1] = 0
  • Set temploc = Position of Triggering Unit
  • Set CreepDie_group[1] = (Units within 1000.00 of temploc matching (((matching unit) is A Hero) Equal to True))
    • Unit Group - Pick every unit in CreepDie_group[1] and do (Actions)
      • Loop - Actions
        • Set CreepDieCount[1] = (CreepDieCount[1] + 1)
        • Set CreepDieHero[CreepDieCount[1]] = (Picked unit)
  • Wait 0.5 seconds
  • For each (Integer A) from 1 to CreepDieCount[1], do (Actions)
    • Loop - Actions
      • Hero - Add (61 / CreepDieCount[1]) experience to CreepDieHero[(Integer A)], Hide level-up graphics
  • Custom script: call DestroyGroup(udg_CreepDie_group[1])
  • Custom script: call RemoveLocation(udg_loc)
although Wait will surely bug but its an option for your trigger...
 
Status
Not open for further replies.
Top