• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[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?
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
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???
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
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