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

need help involving floating text.

Status
Not open for further replies.
Level 4
Joined
Oct 23, 2013
Messages
92
i'm trying to make a floating text to appear only to the unit of triggering event and allies within range but i can't seem to make it work i appreciate and thankful for the help.
 
Level 4
Joined
Oct 23, 2013
Messages
92
Show us what you have tried. Also tell us what is going wrong with yours.

  • Party Exp
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Equal to False
    • Actions
      • Set Exp_ValueParty = (Exp_ValueParty x (Hero level of (Dying unit)))
      • Set Exp_PickedPoint = (Position of (Picked unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (((Dying unit) is A Hero) Equal to True) and (((Killing unit) is A Hero) Equal to True)
        • Then - Actions
          • Unit Group - Pick every unit in (Units within Exp_Area of (Position of (Killing unit)) matching ((((Picked unit) is A Hero) Equal to True) and ((((Picked unit) belongs to an ally of (Owner of (Killing unit))) Equal to True) and (((Dying unit) belongs to an enemy of (Owner of (Killing unit)) and do (Actions)
            • Loop - Actions
              • Hero - Add Exp_ValueParty experience to (Picked unit), Hide level-up graphics
              • Floating Text - Create floating text that reads (+ + ((String(Exp_GainByLevelHero)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees
              • Custom script: call RemoveLocation(udg_Exp_PickedPoint)
              • Custom script: set udg_Exp_PickedPoint = null
        • Else - Actions
here's the trigger, i want it to, if possible add exp to nearby allied heroes only, the problem is the floating text appears even on the enemy unit and even if the unit is dead and when i try to alter the conditions it doesn't work.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Imo it seems like a LOT of exp is given but maybe because the party and killing unit xp are given at the same time, not sure. This worked for me.

  • Party Exp
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Equal to False
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempUnit2 = (Killing unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((TempUnit is A Hero) Equal to True) and ((TempUnit2 is A Hero) Equal to True)
        • Then - Actions
          • Set Exp_ValueParty = (Exp_ValueParty x (Hero level of TempUnit))
          • Set TempPoint = (Position of TempUnit2)
          • Unit Group - Pick every unit in (Units within Exp_Area of TempPoint) and do (Actions)
            • Loop - Actions
              • Set TempUnit3 = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
                  • (TempUnit3 is A Hero) Equal to True
                  • (TempUnit3 is alive) Equal to True
                • Then - Actions
                  • Set Exp_PickedPoint = (Position of TempUnit3)
                  • Hero - Add Exp_ValueParty experience to TempUnit3, Hide level-up graphics
                  • Floating Text - Create floating text that reads (+ + ((String(Exp_GainByLevelHero)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
                  • Floating Text - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees
                  • Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds
                  • Custom script: call RemoveLocation(udg_Exp_PickedPoint)
                  • Custom script: set udg_Exp_PickedPoint = null
                • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions
 
Level 4
Joined
Oct 23, 2013
Messages
92
Imo it seems like a LOT of exp is given but maybe because the party and killing unit xp are given at the same time, not sure. This worked for me.

  • Party Exp
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Equal to False
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempUnit2 = (Killing unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((TempUnit is A Hero) Equal to True) and ((TempUnit2 is A Hero) Equal to True)
        • Then - Actions
          • Set Exp_ValueParty = (Exp_ValueParty x (Hero level of TempUnit))
          • Set TempPoint = (Position of TempUnit2)
          • Unit Group - Pick every unit in (Units within Exp_Area of TempPoint) and do (Actions)
            • Loop - Actions
              • Set TempUnit3 = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
                  • (TempUnit3 is A Hero) Equal to True
                  • (TempUnit3 is alive) Equal to True
                • Then - Actions
                  • Set Exp_PickedPoint = (Position of TempUnit3)
                  • Hero - Add Exp_ValueParty experience to TempUnit3, Hide level-up graphics
                  • Floating Text - Create floating text that reads (+ + ((String(Exp_GainByLevelHero)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
                  • Floating Text - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees
                  • Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds
                  • Custom script: call RemoveLocation(udg_Exp_PickedPoint)
                  • Custom script: set udg_Exp_PickedPoint = null
                • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
        • Else - Actions

the exp is quite big because i forgot to tell that the exp shared is divided equal to the number of nearby allied heroes within range, and how come you didn't set the unit group? this seems to be promising, have tried this trigger?
 
Level 4
Joined
Oct 23, 2013
Messages
92
  • Party Exp
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Equal to False
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempUnit2 = (Killing unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((TempUnit is A Hero) Equal to True) and ((TempUnit2 is A Hero) Equal to True)
        • Then - Actions
          • Set Exp_ValueParty = (Exp_ValueParty / (Hero level of TempUnit2))
          • Set TempPoint = (Position of TempUnit2)
          • Unit Group - Pick every unit in (Units within Exp_Area of TempPoint) and do (Actions)
            • Loop - Actions
              • Set TempUnit3 = (Picked unit)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
                  • (TempUnit3 is A Hero) Equal to True
                  • (TempUnit3 is alive) Equal to True
                • Then - Actions
                  • Set Exp_PickedPoint = (Position of TempUnit3)
                  • Hero - Add Exp_ValueParty experience to TempUnit3, Show level-up graphics
                  • Floating Text - Create floating text that reads (+ + ((String(Exp_ValueParty)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
                  • Floating Text - Change the fading age of (Last created floating text) to 2.25 seconds
                  • Floating Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees
                  • Custom script: call RemoveLocation(udg_Exp_PickedPoint)
                  • Custom script: set udg_Exp_PickedPoint = null
                • Else - Actions
                  • Set Exp_ValueParty2 = (Exp_ValueParty2 / (Hero level of TempUnit2))
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((TempUnit is A Hero) Equal to False) and ((TempUnit2 is A Hero) Equal to True)
                      • (TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
                      • (TempUnit3 is A Hero) Equal to True
                      • (TempUnit3 is alive) Equal to True
                    • Then - Actions
                      • Hero - Add Exp_ValueParty2 experience to TempUnit3, Show level-up graphics
                      • Floating Text - Create floating text that reads (+ + ((String(Exp_ValueParty2)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
                      • Floating Text - Change (Last created floating text): Disable permanence
                      • Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
                      • Floating Text - Change the fading age of (Last created floating text) to 2.25 seconds
                      • Floating Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees
                      • Custom script: call RemoveLocation(udg_Exp_PickedPoint)
                      • Custom script: set udg_Exp_PickedPoint = null
                    • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: set udg_TempPoint = null
        • Else - Actions
i tried to add a non-hero triggers to it and it doesn't work, maybe i nested the triggers wrong? please check.
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Hmm seems I made a few mistakes, this one is probably not that efficient since I pick the same group twice but I'm exhausted, someone can help you from here.

The initial Ifs seems kind of pointless to me, we should be checking every time a unit dies if we need to give XP to a nearby hero, not just when a hero gets the last hit. Maybe you want to give more XP if the hero gets the last hit, if that is the case you will need to add an IF back in. However I don't think its needed as you seem to want 100 as the base amount (which is a lot early btw)

  • Party Exp
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Equal to False
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempUnit2 = (Killing unit)
      • Set Exp_ValueParty = (100 x (Level of TempUnit))
      • Set TempPoint = (Position of TempUnit2)
      • Set TempGroup = (Units within Exp_Area of TempPoint)
      • Set TempInteger = 0
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit3 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
              • (TempUnit3 is A Hero) Equal to True
              • (TempUnit3 is alive) Equal to True
            • Then - Actions
              • Set TempInteger = (TempInteger + 1)
            • Else - Actions
      • Set TempInt = (Exp_ValueParty / TempInteger)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit3 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
              • (TempUnit3 is A Hero) Equal to True
              • (TempUnit3 is alive) Equal to True
            • Then - Actions
              • Set Exp_PickedPoint = (Position of TempUnit3)
              • Hero - Add TempInt experience to TempUnit3, Hide level-up graphics
              • Floating Text - Create floating text that reads (+ + ((String(TempInt)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees
              • Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds
              • Custom script: call RemoveLocation(udg_Exp_PickedPoint)
              • Custom script: set udg_Exp_PickedPoint = null
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveLocation(udg_TempPoint)
Btw use Level of unit (it works for heroes and units)
 
Last edited:
Level 4
Joined
Oct 23, 2013
Messages
92
Hmm seems I made a few mistakes, this one is probably not that efficient since I pick the same group twice but I'm exhausted, someone can help you from here.

The initial Ifs seems kind of pointless to me, we should be checking every time a unit dies if we need to give XP to a nearby hero, not just when a hero gets the last hit. Maybe you want to give more XP if the hero gets the last hit, if that is the case you will need to add an IF back in. However I don't think its needed as you seem to want 100 as the base amount (which is a lot early btw)

  • Party Exp
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A structure) Equal to False
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempUnit2 = (Killing unit)
      • Set Exp_ValueParty = (100 x (Level of TempUnit))
      • Set TempPoint = (Position of TempUnit2)
      • Set TempGroup = (Units within Exp_Area of TempPoint)
      • Set TempInteger = 0
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit3 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
              • (TempUnit3 is A Hero) Equal to True
              • (TempUnit3 is alive) Equal to True
            • Then - Actions
              • Set TempInteger = (TempInteger + 1)
            • Else - Actions
      • Set TempInt = (Exp_ValueParty / TempInteger)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit3 = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempUnit3 belongs to an ally of (Owner of TempUnit2)) Equal to True
              • (TempUnit3 is A Hero) Equal to True
              • (TempUnit3 is alive) Equal to True
            • Then - Actions
              • Set Exp_PickedPoint = (Position of TempUnit3)
              • Hero - Add TempInt experience to TempUnit3, Hide level-up graphics
              • Floating Text - Create floating text that reads (+ + ((String(TempInt)) + party exp)) at Exp_PickedPoint with Z offset 100.00, using font size 9.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 70.00 towards 90.00 degrees
              • Floating Text - Change the fading age of (Last created floating text) to 1.25 seconds
              • Custom script: call RemoveLocation(udg_Exp_PickedPoint)
              • Custom script: set udg_Exp_PickedPoint = null
            • Else - Actions
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveLocation(udg_TempPoint)
Btw use Level of unit (it works for heroes and units)

for some reason, i couldn't open my map anymore it says main map file could not be found. I think it's much better if it checks if a hero dies.

I tried and tested the triggers and it works so far without bugs, now i'm gonna replicate so that it gives exp when killing non- hero units too, i'm going to try to integrate the trigger that gives exp only to the killing unit into just one trigger to save some space. I tried and i failed. :(
 
Last edited by a moderator:
Level 13
Joined
Mar 24, 2013
Messages
1,105
I'm not really following what you're saying...

My last post works for if a regular unit (non-hero) OR a hero dies.
The trigger gets the total XP (to be given) based on the Dying units level * the 100 constant you had chosen.
If there are 2 hero units in range, when a level 5 unit (hero or non-hero) dies it will split the 500xp between these 2 units giving 250 each.

I think if you want to give extra XP for getting the last hit you should just do that separately, but I think you're going to want to make it minimal, and not do some multiple. i.e. Map Initialization set LastHitXp[1] = 15 LastHitXp[2] = 23
And then just check the level of the unit when it dies and give it the flat amount based on your predefined values.
 
Level 4
Joined
Oct 23, 2013
Messages
92
I'm not really following what you're saying...

My last post works for if a regular unit (non-hero) OR a hero dies.
The trigger gets the total XP (to be given) based on the Dying units level * the 100 constant you had chosen.
If there are 2 hero units in range, when a level 5 unit (hero or non-hero) dies it will split the 500xp between these 2 units giving 250 each.

I think if you want to give extra XP for getting the last hit you should just do that separately, but I think you're going to want to make it minimal, and not do some multiple. i.e. Map Initialization set LastHitXp[1] = 15 LastHitXp[2] = 23
And then just check the level of the unit when it dies and give it the flat amount based on your predefined values.

you mean to say that the trigger you created is for hero and non-hero units already? if so, then i'm so stupid and wasted 5 hours trying to make a same trigger for non-hero units.

you mean to say that the trigger you created is for hero and non-hero units already? if so, then i'm so stupid and wasted 5 hours trying to make a same trigger for non-hero units.
yeap i'm stupid, because i didn't see a part in the conditions that tempunit is a hero or not, which means it works for both.
 
Last edited by a moderator:
Status
Not open for further replies.
Top