Floating txt problem

ultimate11

Active Member
Reaction score
25
Trigger:
  • Creep Bounty
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to False
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
          • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Creep[1]
              • (Unit-type of (Triggering unit)) Equal to Creep[2]
        • Then - Actions
          • Set Gold = (Random integer number between 45 and 55)
          • Player - Add Gold to (Owner of (Killing unit)) Current gold
          • Floating Text - Create floating text that reads (|CFFFFFF01+ + ((String(Gold)) + |R)) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 64.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 3.00 seconds
          • Floating Text - Hide (Last created floating text) for (All players)
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
          • Floating Text - Show (Last created floating text) for (Player group((Owner of (Killing unit))))
        • Else - Actions

oky this work fine except one thing.I want to show last created floating txt only to owner of kiling unit but it`s show to all players. :(
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
i think you can limit the floating text only through JASS, not sure though

EDIT: correction, there is a "show/hide" command
 

ultimate11

Active Member
Reaction score
25
that show/hide command work only on players group as i know so far.So anyone have another ideea?
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
Trigger:
  • Floating Text - Show (Last created floating text) for (Player group((Player 1 (Red))))
 

Ashlebede

New Member
Reaction score
43
Trigger:
  • Floating Text - Show (Last created floating text) for (Player group((Player 1 (Red))))

Trigger:
  • Floating Text - Show (Last created floating text) for (Player group((Owner of (Killing unit))))


Was in the original trigger... :rolleyes:
 

Bankde

Member
Reaction score
20
Use this function at start:
Trigger:
  • Custom script: if GetLocalPlayer() != GetOwningPlayer(GetKillingUnit()) then

And
Trigger:
  • Custom script: endif

At end
 

ultimate11

Active Member
Reaction score
25
solved,it work with this
Trigger:
  • Floating Text - Hide (Last created floating text) for (All players matching ((Owner of (Killing unit)) Not equal to (Matching player)))
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Why don't you just hide it for (All players) and show it for (Player group((Owner of (Killing unit)))) ?
No leaks ;)
(Well one... XD)
 

ultimate11

Active Member
Reaction score
25
honestlly i tried by first time but amazing don`t work at all.Crazy it`s show for all ppl even enemy ones.
 

Bankde

Member
Reaction score
20
Here the full code (example);

Trigger:
  • Floating Text Example
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script: if GetLocalPlayer() == GetOwningPlayer( GetKillingUnit() ) then
      • Set Point1 = (Position of (Triggering unit))
      • Floating Text - Create floating text that reads Hello at Point1 with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.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 2.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 0.60 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 90.00 degrees
      • Custom script: call RemoveLocation (udg_Point1)
      • Custom script: endif


This function
Trigger:
  • Custom script: if GetLocalPlayer() == GetOwningPlayer( GetKillingUnit() ) then

mean only effect (Owner of killing unit) and will not effect others which means other can't see floating text.

Use == to show floating text to that player and use != to show to all players except that one.

For more information; http://www.thehelper.net/forums/showthread.php?t=89207

Edit: Apologize for first code, I have made some mistake ( It should be == instead of != )
 

ultimate11

Active Member
Reaction score
25
it will be most easy for me if i know Jass but seem to be so hard learning it.BTW why doesn`t this good
Trigger:
  • Floating Text - Hide (Last created floating text) for (All players matching ((Owner of (Killing unit)) Not equal to (Matching player)))

leak?
it works this way :D
 

Komaqtion

You can change this now in User CP.
Reaction score
469
@ Bankde: That will never works actually (Online at least) as it will desync because you're creating a handle (Floating Text) for one playr only, and that will not work...

@ ultimate11: Yes, that leaks but it can be fixed:

Trigger:
  • Set Temp_Force = (All player matching ((Ower of (Killing unit)) Not equal to (Matching player))
    • Floating Text - Hide (Last created floating text) for Temp_Force
    • Custom script: call DestroyForce( udg_Temp_Force )


Note: Freehanded ! And also, the variable "Temp_Force" is of the type "Player Group" ;)
 

W!†A_cRaft

Ultra Cool Member
Reaction score
28
so in conclusion, we should make a text, hide it for everyone then show it to the player we need it to be shown?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top