• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

need som help

Status
Not open for further replies.
Level 11
Joined
Nov 13, 2010
Messages
212
well i made this trigger but then i try it show text but i try to set a hero level 30 and try killing random units and it say i get 46xxx xp but i only get from 100 to 1800 xp when i look a the hero xp how come and is it a but or is xp too all players and i only get some of it ?

  • when death happens
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Killing unit)) Not equal to (!=) (Hero experience of (Killing unit))
        • Then - Actions
          • Floating Text - Create floating text that reads (String(((Hero experience of (Killing unit)) + (Custom value of (Killing unit))))) above (Killing unit) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Show (Last created floating text) for (All players)
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
        • Else - Actions
      • Unit - Set the custom value of (Killing unit) to (Hero experience of (Killing unit))
 
Level 11
Joined
Nov 13, 2010
Messages
212
i made the trigger so it shows xp then a hero kills a unit but when i try with a level 30 hero it says i get 46xxx xp but then i look a the xp bar i only get from 90 to 1900 xp or so. so i want to know if i fuck something up or if it is a bug or if it show the xp all players get a round but i only get some of it
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,895
Currently, your triggers shows the experience your hero has plus the custom value of the hero, initially it should say "experience of your hero" + 0.
To know how much xp your hero gained, use this:
  • XP
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set GainedXP = ((Hero experience of (Killing unit)) - XP)
      • -------- -------Your actions here with gained XP----- --------
      • Game - Display to (All players) the text: (XP gained: + (String(GainedXP)))
      • -------- ---------------------------------------------------------------------- --------
      • Set XP = (Hero experience of (Killing unit))
 
Level 11
Joined
Nov 13, 2010
Messages
212
i want the Floating Text so can i do this
  • when death happens
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set GainedXP = ((Hero experience of (Killing unit)) - XP)
      • Set XP = (Hero experience of (Killing unit))
      • Floating Text - Create floating text that reads (String((XP + (Integer((Real(GainedXP))))))) above (Killing unit) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Show (Last created floating text) for (All players)
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,895
Yes, now just put the XP variable above all the other actions.
Edit: its supposed to be (String((XP + (String(GainedXP)))
Edit2: to be more clear: Floating Text - Create floating text that reads ((String(XP)) + ( + + (String(GainedXP)))) above (Killing unit) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
 
Level 11
Joined
Nov 13, 2010
Messages
212
it is still of a bit
see.jpg



if you can see the green number
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,895
it should be String(GainedXP), also your final trigger should be this:
"FloatText" is a floatingtext variable
  • when death happens
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Killing unit) is A Hero) Equal to True
          • ((Owner of (Killing unit)) is an enemy of (Owner of (Triggering unit))) Equal to True
        • Then - Actions
          • Custom script: local texttag float
          • Set GainedXP = ((Hero experience of (Killing unit)) - XP)
          • Floating Text - Create floating text that reads ((String((Hero experience of (Killing unit)))) + ( + + (String(GainedXP)))) above (Killing unit) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
          • Set FloatText = (Last created floating text)
          • Floating Text - Set the velocity of FloatText to 64.00 towards 90.00 degrees
          • Floating Text - Show FloatText for (All players)
          • Floating Text - Change FloatText: Disable permanence
          • Floating Text - Change the lifespan of FloatText to 2.00 seconds
          • Custom script: set float = udg_FloatText
          • Set XP = (Hero experience of (Killing unit))
          • Wait 2.00 seconds
          • Custom script: set udg_FloatText = float
          • Floating Text - Destroy FloatText
          • Custom script: call DestroyTextTag(float)
          • Custom script: set float = null
        • Else - Actions
It destroys floating texts.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,895
i try with
Floating Text - Create floating text that reads (String((XP + (Integer((String(GainedXP))))))) but still the same
It must be this:
Floating Text - Create floating text that reads (String((XP + (String(GainedXP)))))
not this:
Floating Text - Create floating text that reads (String((XP + (Integer((String(GainedXP)))))))
Look the difference.
You are converting a string to integer and then integer to string, which doesn't work properly
 
Level 11
Joined
Nov 13, 2010
Messages
212
okay thx for all the help m8 it help me a lot and it looks nice now :D it was because i was making an update to my new map and then i cam up with an idea to make an xp text some how because i think it wood be cool for the map,
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,206
Wrda
By disabling permanence, setting life time and a fade point the floating text will destroy itself automatically. There is no need to ever destroy floating text unless the queue for its destruction is unrelated to time (such as in response to an event or change in game state).

This means that the local, custom script and wait are all unnecessary.
 
Status
Not open for further replies.
Top