How to create more than 100 floating texts?

Status
Not open for further replies.

Tzi

Tzi

Level 4
Joined
Jan 7, 2009
Messages
57
Hi!

Is there any possible solution to avoid the floating text limit which lets just 100 FT's shown at a time?
A solution for aprox. 70 FT's for each player would be the best (if possible of course)
 
Last edited:

Tzi

Tzi

Level 4
Joined
Jan 7, 2009
Messages
57
Okay, cause I've tried is this way, but it doesn't work properly.
So where have I to use GetLocalPlayer?
- Just while creating?
- When I'm configuring the style, too?
- Can I save the floating text in a Variable / Hashtable without any problem?
 
Okay, cause I've tried is this way, but it doesn't work properly.
So where have I to use GetLocalPlayer?
- Just while creating?
- When I'm configuring the style, too?
- Can I save the floating text in a Variable / Hashtable without any problem?

1. Yes
2. Yes
3. Explain what you want to do with them first, before I just give you a yes or no because there are some issues that could happen.

To use GetLocalPlayer:

  • -------- Protocol to do actions for just one player --------
  • Set TempPlayer = (Triggering player)
  • Custom script: if GetLocalPlayer() == udg_TempPlayer then
  • Text Tag - Create ...
  • Custom script: endif
 

Tzi

Tzi

Level 4
Joined
Jan 7, 2009
Messages
57
3. Explain what you want to do with them first, before I just give you a yes or no because there are some issues that could happen.


That's the trigger how it looks like at the moment. (Tried to translate everything in english)

So I'm using hashtables, integers and floating text variables for destroying some floating texts if it would happen that more than 100 FT's can be shown for one player. (There are more triggers that are using the same)

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Conditions
      • IntegerXXX[(Player number of (Owner of GDD_DamageSource))] Equal to 1
    • 'THEN'-Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • (FT_Max[(Player number of (Owner of GDD_DamageSource))] - FT_Min[(Player number of (Owner of GDD_DamageSource))]) Greater equal to 100
        • 'THEN'-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • (FT_Max[(Player number of (Owner of GDD_DamageSource))] - FT_Min[(Player number of (Owner of GDD_DamageSource))]) Equal to 7000
            • 'THEN'-Actions
              • Custom script: if(GetLocalPlayer() == Player(GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource)))) then
              • Floating Text - Destroy (Load FT_Min[(Player number of (Owner of GDD_DamageSource))] of FTInteger[(Player number of (Owner of GDD_DamageSource))] in HT_FT[(Player number of (Owner of GDD_DamageSource))]If the label is not found, this function returns NULL.)
              • Custom script: endif
              • Set FTInteger[(Player number of (Owner of GDD_DamageSource))] = (FTInteger[(Player number of (Owner of GDD_DamageSource))] + 1)
              • Set FT_Max[(Player number of (Owner of GDD_DamageSource))] = 0
              • Set FT_Min[(Player number of (Owner of GDD_DamageSource))] = 0
            • 'ELSE'-Actions
              • Custom script: if(GetLocalPlayer() == Player(GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource)))) then
              • Floating Text - Destroy (Load FT_Min[(Player number of (Owner of GDD_DamageSource))] of FTInteger[(Player number of (Owner of GDD_DamageSource))] in HT_FT[(Player number of (Owner of GDD_DamageSource))]If the label is not found, this function returns NULL.)
              • Custom script: endif
              • Set FT_Min[(Player number of (Owner of GDD_DamageSource))] = (FT_Min[(Player number of (Owner of GDD_DamageSource))] + 1)
        • 'ELSE'-Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • FTInteger[(Player number of (Owner of GDD_DamageSource))] Greater equal to 0
            • 'THEN'-Actions
              • Custom script: if(GetLocalPlayer() == Player(GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource)))) then
              • Floating Text - Destroy (Load (FT_Min[(Player number of (Owner of GDD_DamageSource))] + 6900) of (FTInteger[(Player number of (Owner of GDD_DamageSource))] - 1) in HT_FT[(Player number of (Owner of GDD_DamageSource))]If the label is not found, this function returns NULL.)
              • Custom script: endif
              • Set FT_Min[(Player number of (Owner of GDD_DamageSource))] = (FT_Min[(Player number of (Owner of GDD_DamageSource))] + 1)
            • 'ELSE'-Actions
      • Custom script: if(GetLocalPlayer() == Player(GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource)))) then
      • Floating Text - Create floating text that reads ((|cffff0000 + (String(I[733]))) + !|r) above GDD_DamagedUnit with Z offset (Random real number between -40.00 and 40.00), using font size OpKT_Size[(Player number of (Owner of GDD_DamageSource))], color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • IntegerXXY[(Player number of (Owner of GDD_DamageSource))] Gleich 2
        • 'THEN'-Aktionen
          • Custom script: if(GetLocalPlayer() == Player(GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource)))) then
          • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
          • Custom script: endif
        • 'ELSE'-Actions
          • Custom script: if(GetLocalPlayer() == Player(GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource)))) then
          • Floating Text - Change (Last created floating text): Deactivate permanence
          • Custom script: endif
      • Custom script: if(GetLocalPlayer() == Player(GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource)))) then
      • Floating Text - Change the lifespan of (Last created floating text) to IntegerXXZ[(Player number of (Owner of GDD_DamageSource))] seconds
      • Custom script: endif
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • IntegerXYX[(Player number of (Owner of GDD_DamageSource))] Equal to 2
        • 'THEN'-Actions
          • Custom script: if(GetLocalPlayer() == Player(GetConvertedPlayerId(GetOwningPlayer(udg_GDD_DamageSource)))) then
          • Floating Text - Change the fading age of (Last created floating text) to (IntegerXXZ[(Player number of (Owner of GDD_DamageSource))] x 0.65) seconds
          • Custom script: endif
        • 'ELSE'-Actions
      • Set FT_Max[(Player number of (Owner of GDD_DamageSource))] = (FT_Max[(Player number of (Owner of GDD_DamageSource))] + 1)
      • Hashtabelle - Save Handle Of(Last created floating text) as FT_Max[(Player number of (Owner of GDD_DamageSource))] of FTInteger[(Player number of (Owner of GDD_DamageSource))] in HT_FT[(Player number of (Owner of GDD_DamageSource))]
    • 'ELSE'-Actions
Seems to be senseless why using hashtables, but I've tried it so many times with normal integers (low maximum number of 10 - 50 and correctly maximum number 99 or 100). Many times the FT's bugged and no more FT's where shown (just sometimes for a very little moment)
That was the only way it worked
 

Tzi

Tzi

Level 4
Joined
Jan 7, 2009
Messages
57
Thx. I've nearly no knowledge in Jass and just converted the trigger into text and copied the part ;-)

Back to topic: Will it work with the way I made it properly?^^ (No desyncs or anything else?)


€dit: Question is still relevant ;-)
 
Last edited:

Tzi

Tzi

Level 4
Joined
Jan 7, 2009
Messages
57
Well...

would my method work as like as I posted it or have I to add the "GetLocalPlayer()" to the Hashtable saving of the last created floating text?

I've tried with a friend the GetLocalPlayer thingi...

It doesn't work properly. Then I made a Test Map. I just added an additional player slot and created a trigger that just sets a player in a Variable while when the player presses the Left Button. Then it would create a local floating text.
While pressing the left button it desyncs...

Are you sure that floating texts can get created local?

I'm really confused and sad about this annoying problem.
 
Last edited by a moderator:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,243
It is impossible to make more than 100 floating texts in any client of a game session. If you must then I advise finding a game engine that does support that or making your own game.

You could try using GetLocalPlayer() which returns the player belonging to the client (different value for each client) to generate floating text locally for only certain players. Be aware that you need to allocate the strings for all players unless you want the game to split due to a syncronization error. I believe floating text is one of the few handles one can make for only certain clients without causing a split.
 
Status
Not open for further replies.
Top