• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Different floating texts for each buff on multiple units

Status
Not open for further replies.
Level 4
Joined
Dec 5, 2011
Messages
75
Sorry for the big trigger, so my skills gives a random buff on random units in area and it is working but now i need a floating text for each buff(4buffs) but the only idea that came from my mind(im new on this) is the 4th trigger which is not good and working very bad.Can someone help me?Thanks!
EDIT:Dont mind the special effects yet, i didnt fixed it.

  • NAMELESS START
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Nameless Song
    • Actions
      • Set Bard_Loc = (Position of (Casting unit))
      • Set Bard_Unit = (Casting unit)
      • Set BardAreaDamage = (Units within 700.00 of Bard_Loc matching ((((Matching unit) belongs to an ally of (Owner of (Casting unit))) Equal to (==) True) and (((Matching unit) is alive) Equal to (==) True)))
      • Set SongBuff[1] = rejuvination
      • Set SongBuff[2] = frostarmor
      • Set SongBuff[3] = innerfire
      • Set SongBuff[4] = unholyfrenzy
      • Trigger - Turn on NAMELESS SONG <gen>
  • NAMELESS SONG
    • Events
      • Time - Every 5.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Random (Random integer number between 1 and 3) units from BardAreaDamage) and do (Actions)
        • Loop - Actions
          • Set BardPickedUnits = (Position of (Picked unit))
          • Set Inter_Var = (Random integer number between 1 and 4)
          • Unit - Create 1 bSongDummy for (Owner of (Picked unit)) at BardPickedUnits facing Default building facing (270.0) degrees
          • Unit - Order (Last created unit) to SongBuff[Inter_Var] (Picked unit)
          • Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
          • Special Effect - Create a special effect at BardPickedUnits using Abilities\Spells\NightElf\TargetArtLumber\TargetArtLumber.mdl
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation (udg_BardPickedUnits)
  • NAMELESS STOP
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Nameless Song
    • Actions
      • Custom script: call DestroyGroup (udg_BardAreaDamage)
      • Custom script: call RemoveLocation (udg_Bard_Loc)
      • Trigger - Turn off NAMELESS SONG <gen>
  • NAMELESS BUFF NAME
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to (==) Shell Protect
        • Then - Actions
          • Floating Text - Create floating text that reads Shell and Protect! at BardPickedUnits with Z offset 2.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 10.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 25.00 towards 90.00 degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 2.50 seconds
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to (==) Haste
        • Then - Actions
          • Floating Text - Create floating text that reads Haste! at BardPickedUnits with Z offset 2.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 10.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 25.00 towards 90.00 degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 2.50 seconds
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to (==) Regeneration
        • Then - Actions
          • Floating Text - Create floating text that reads Regeneration! at (Position of (Target unit of ability being cast)) with Z offset 2.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 10.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 25.00 towards 90.00 degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 2.50 seconds
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to (==) Reraise
        • Then - Actions
          • Floating Text - Create floating text that reads Reraise! at BardPickedUnits with Z offset 2.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 10.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 25.00 towards 90.00 degrees
          • Floating Text - Change the lifespan of (Last created floating text) to 2.50 seconds
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds
        • Else - Actions
 
Level 4
Joined
Dec 5, 2011
Messages
75
Sorry, the trigger is not working with multiples units, if there is more than 1 unit, it only shows on 1 unit and not others or the floating text stacks on 1 unit
(My only problem is with floating texts)
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
In your 4th trigger, you should Pick All Unit Group first before calling those actions;
  • Unit Group - Pick every unit in BardAreaDamage and do (Actions)
    • Loop - Actions
Put those Floating Text inside the Loop - Actions
 
Level 4
Joined
Dec 5, 2011
Messages
75
The stacking floating text on 1 unit problem is resolved but now some floating texts are not moving or disappearing. I think the floating texts are overlaping because of Last created Floating Text
Should i make a New trigger creating the 4x Floating text buffs in a hidden place and setting them into variables?
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Oh you have to do a little bit advance triggering for that, to save into hashtable and what not.
Just browse my Rank System if you want to know what I meant by that (on how to move Floating Text and keeping them intact with the units)

But I advice you, it's an advanced triggering (for you perhaps?)

Simply to move Floating Text, do this;
  • Floating Text - Change the position of (Last created floating text) to (Picked unit) with Z offset 0.00
To make it disappear, do this;
  • Floating Text - Destroy (Last created floating text)
 
Level 4
Joined
Dec 5, 2011
Messages
75
Yes, i havent learn hashtables yet.I tried with the MUI hashtable tutorial we got here but couldnt understand at all haha.. i guess i will check more, thanks though
 
Status
Not open for further replies.
Top