• 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] Xp system

Status
Not open for further replies.
Level 4
Joined
Apr 30, 2007
Messages
62
Hello i have a problem with my system maybe someone can help me. It only work till lvl 2 then it dont work anymore.

  • Einheit - A unit Stirbt
  • Einheitengruppe - Pick every unit in (Units in (Region centered at (Position of (Dying unit)) with size (1200.00, 1200.00)) matching ((((Matching unit) belongs to an enemy of (Owner of (Casting unit))) Gleich True) and ((((Matching unit) is alive) Gleich True) and (((Matching unit) is Ein Gebäu and do (Actions)
    • Schleifen - Aktionen
      • Held - Add (((Hero level of (Dying unit)) / (Hero level of (Killing unit))) x 100) experience to (Picked unit), Verbergen level-up graphics
      • Schwebender Text - Create floating text that reads (String((Integer((((Real((Hero level of (Dying unit)))) / (Real((Hero level of (Killing unit))))) x 100.00))))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (80.00%, 0.00%, 100.00%), and 0.00% transparency
      • Schwebender Text - Set the velocity of (Last created floating text) to 85.00 towards 90.00 degrees
      • Schwebender Text - Change (Last created floating text): Deaktivieren permanence
      • Schwebender Text - Change the lifespan of (Last created floating text) to 1.50 seconds
      • Schwebender Text - Change the fading age of (Last created floating text) to 0.75 seconds
 
Last edited:
trigger tags: [TRIGGER]Your Trigger Here[/TRIGGER]

  • XP System
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 1200.00 of (Position of (Dying unit)) matching ((((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True) and ((((Killing unit) is alive) Equal to True) and (((Dying unit) is A structure) Equal to False)))) and do (Actions)
        • Loop - Actions
          • Hero - Add (((Hero level of (Dying unit)) / (Hero level of (Killing unit))) x 100) experience to (Picked unit), Hide level-up graphics
          • Floating Text - Create floating text that reads (String((((Hero level of (Dying unit)) / (Hero level of (Killing unit))) x 100))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (80.00%, 0.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 85.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
I optimized the Matching Unit thing and replaced that stupid "Casting Unit" thing, which is absolutly useless. One question, do you kill only heroes?
And are you using WeU? Because i dont have "Region centered at..."
 
I removed the leaks for you too.

Oh i'm so nice~:emote_razz:

  • XP System
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script - local location udg_TempPoint
      • Set TempPoint = (Position of (Dying Unit))
      • Set TempGroup = (Units within 1200.00 of TempPoint matching ((((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True) and ((((Killing unit) is alive) Equal to True) and (((Dying unit) is A structure) Equal to False))))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Hero - Add (((Hero level of (Dying unit)) / (Hero level of (Killing unit))) x 100) experience to (Picked unit), Hide level-up graphics
          • Floating Text - Create floating text that reads (String((((Hero level of (Dying unit)) / (Hero level of (Killing unit))) x 100))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (80.00%, 0.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 85.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
      • Custom script - call RemoveLocation( udg_TempPoint )
      • Custom script - call DestroyGroup( udg_TempGroup )
 
Level 4
Joined
Apr 30, 2007
Messages
62
thx very much i will try it but how to get
  • Units within 1200.00 of TempPoint matching ((((Dying unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True) and ((((Killing unit) is alive) Equal to True) and (((Dying unit) is A structure) Equal to False))))
? i cant find it

/edit: upps found :D
 
  • XP System
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Custom script: local location udg_TempPoint
      • Set TempPoint = (Position of (Dying unit))
      • Set TempGroup = (Units within 1200.00 of TempPoint matching ((((Dying unit) belongs to an enemy of (Owner of (Matching unit))) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Killing unit) is A structure) Equal to False))))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Hero - Add (((Hero level of (Dying unit)) x 100) / (Hero level of (Picked unit))) experience to (Picked unit), Hide level-up graphics
          • Floating Text - Create floating text that reads (String((((Hero level of (Dying unit)) x 100) / (Hero level of (Picked unit))))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (80.00%, 0.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 85.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 1.50 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 0.75 seconds
      • Custom script: call RemoveLocation( udg_TempPoint )
      • Custom script: call DestroyGroup( udg_TempGroup )
ok this works, but you have to set the experience rate to 0:
  • Hero - Make Player 1 (Red) Heroes gain 0.00% experience from future kills
And i know the problem, why you didnt get xp. It was your xp formula( ( Dying Level / Killer Level ) x 100 ).
I replaced it with actually the same result and it works.

/Edit Gratz Diablo-dk
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
The reason was clear.

( ( Dying Level / Killer Level ) x 100 ).

Is entirly integer (whole numers) based.

Because of that, if your hero was a higher level than the dying unit (like most units are only lvl 2-5) it would return 0, and 0*100 is 0.

Simply by making the entire formula be done in reals would have made it work fine.
 
Status
Not open for further replies.
Top