• 🏆 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!

Need help with trigger! +rep to all helpers!

Status
Not open for further replies.

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
  • Events
    • Player - Player 11 (Dark Green) types a chat message containing text as An exact match
  • If - Conditions
    • (Integer A) Not equal to (Player number of Player_Satyr)
  • Then - Actions
    • Set temp_point = (Center of Talents1 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 1 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents2 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 2 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents3 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 3 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents4 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 4 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents5 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 5 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents6 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 6 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents7 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 7 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents8 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 8 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents9 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 9 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents10 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 10 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents11 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 11 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents12 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 12 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents13 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 13 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents14 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 14 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents15 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 15 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents16 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 16 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents17 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 17 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents18 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 18 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents19 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 19 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents20 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 20 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents21 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 21 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents22 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 22 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents23 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 23 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents24 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 24 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents25 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 25 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents26 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 26 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents27 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 27 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents28 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 28 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents29 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 29 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)
    • Set temp_point = (Center of Talents30 <gen>)
    • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Hide (Last created floating text) for (All players)
    • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
    • Floating Text - Show (Last created floating text) for temp_PlayerGroup
    • Custom script: call DestroyForce(udg_temp_PlayerGroup)
    • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of 30 in Hastable_FloatingText
    • Custom script: call RemoveLocation(udg_temp_point)

My problem here is that I am trying to show 30 floating texts for 11 induvidual players for my Fullscreen Talent Tree representing how many points you have spent into each induvidual talent. In GUI you do not create a floating text for a specific player, you create it globally, that will say, for all players and then exclude the player/players which you do not want it to be shown for by using the action Floating Text - Hide for Player()

I've read that the limit for floating texts SHOWN for each induvidual player is ~100.
Whenever I create a floating text for a player the counter towards the limit of floating texts shown to that player is increased by 1 (because the floating text is automatically shown when created). Now, by hiding it for that player I expected the counter to go down by 1 but it seems like I am mistaken since the floating text doesn't appear for player 11 by using this code. (30 x 11 - 0 = 330, I expected it to be 30 x 11 - 300 = 30. Floating Text Limit = ~100).

Is there a way with perhaps Vjass or Jass to create a floating text for a specific player so that it is not counted towards the limit of floating texts shown for all players but rather for the one that the created floating text is suppose to be shown for?

TO CLEARIFY I want to show 30 floating texts for 11 players induvidually. How do I do this without going over the limit of floating texts being shown? What am I doing wrong?


Any helping suggestions and/or fixes will be rewarded with +2 rep!


2b1lqp.png



 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
Level 20
Joined
Jul 6, 2009
Messages
1,885
Creating floating texts within a local player block should do it and is safe (will not desync).
  • Custom script: If GetLocalPlayer(udg_PlayerVariable) then
  • Floating Text - Create... //Insert all floating text related actions here
  • Custom script: endif
It creates the floating text for a player individually so each player can have up to 100 or so different texts.

I'd also suggest you simplify your trigger by using a loop. From what I see, the things that change as the trigger progresses are rects (regions) and hashtable child key. Store the regions in an array and iterate them in a loop.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Creating floating texts within a local player block should do it and is safe (will not desync).
  • Custom script: If GetLocalPlayer(udg_PlayerVariable) then
  • Floating Text - Create... //Insert all floating text related actions here
  • Custom script: endif
It creates the floating text for a player individually so each player can have up to 100 or so different texts.

I'd also suggest you simplify your trigger by using a loop. From what I see, the things that change as the trigger progresses are rects (regions) and hashtable child key. Store the regions in an array and iterate them in a loop.

NO.

Never do this. This will desync instantly.

JASS:
local string s
local texttag text = CreateTextTag()
if GetLocalPlayer() == ? then
    set s = "Your Text"
endif
call SetTextTagText(text, s, 0)
call SetTextTagColor(text, 255, 255, 255, 255)
call SetTextTagVisibility(text, true)

to OP, are you saying each text tag will have its own text per player or each player will have 30 text tags? For the first one, use the code above. For the second one, (bah scumbag laptop decides to go to sleep at 12% battery) use this code

JASS:
local string s
local texttag text = CreateTextTag()
if GetLocalPlayer() == ? then
    set s = "Your Text"
    call SetTextTagPos(text, xValue, yValue, 0)
endif
call SetTextTagText(text, s, 0)
call SetTextTagColor(text, 255, 255, 255, 255)
call SetTextTagVisibility(text, true)

E/ Ill assume you werent the coder in dualism :O just pm me (or your coder o_O) if youd like a system to implement the above vJass into your map
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
@Arthowk
Thank you for replying, you might be able to help me solve this problem. I changed my coding as you requested with a additional loop to optimize my code.

This is my current code:
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Integer A) Not equal to (Player number of Player_Satyr)
          • Then - Actions
            • For each (Integer B) from 1 to 30, do (Actions)
              • Loop - Actions
                • Set temp_point = (Center of Region_DTalents[(Integer B)])
                • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                • Floating Text - Hide (Last created floating text) for (All players)
                • Floating Text - Show (Last created floating text) for temp_PlayerGroup
                • Set temp_PlayerGroup = (Player group((Player((Integer A)))))
                • Custom script: call DestroyForce(udg_temp_PlayerGroup)
                • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of (Integer B) in Hastable_FloatingText
                • Custom script: call RemoveLocation(udg_temp_point)
          • Else - Actions
Now I need to replace the code for creating the floating text with Vjass as you explained. I know close to nothing about Vjass programming tho so I'll need your help. The way that I need this to work is I need the floating text to be created for playerindex(Integer A) at temp_point(Integer B) with the size Real_TextSize and save it into the hashtable variable named Hashtable_FloatingText with the values Integer B, Integer A.

If I did that I guess that I could edit the text by using GUI refering to the floating text saved inside the hashtable.

This is just based on my knowledge about coding. You might not be able to code it the way I just described in which case I am open for listening to what options that would be at hand.

I'll be checking Hive each 15 minutes for your reply. Thanks!
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
@Garfield1337
I am having the same thoughts however I do not have the required knowledge to create them locally with JASS/vJASS and save them within a hashtable as mentioned in my previous comment.

If any coder could help me out I would appreciate it more than greatly!
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
I got it working! Here is the final result:
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Integer A) Not equal to (Player number of Player_Satyr)
          • Then - Actions
            • For each (Integer B) from 1 to 30, do (Actions)
              • Loop - Actions
                • Custom script: if GetLocalPlayer() == Player( bj_forLoopAIndex - 1 ) then
                • Set temp_point = (Center of Region_Talents[(Integer B)])
                • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of (Integer B) in Hastable_FloatingText
                • Custom script: call RemoveLocation(udg_temp_point)
                • Custom script: endif
          • Else - Actions

EDIT: Does this cause a desync?
 

Sverkerman

Hosted Project: BoW
Level 17
Joined
Feb 28, 2010
Messages
1,325
@Lender
Are you sure about that? Check this post made by Arhowk:

NO.

Never do this. This will desync instantly.

JASS:
local string s
local texttag text = CreateTextTag()
if GetLocalPlayer() == ? then
    set s = "Your Text"
endif
call SetTextTagText(text, s, 0)
call SetTextTagColor(text, 255, 255, 255, 255)
call SetTextTagVisibility(text, true)

to OP, are you saying each text tag will have its own text per player or each player will have 30 text tags? For the first one, use the code above. For the second one, (bah scumbag laptop decides to go to sleep at 12% battery) use this code

JASS:
local string s
local texttag text = CreateTextTag()
if GetLocalPlayer() == ? then
    set s = "Your Text"
    call SetTextTagPos(text, xValue, yValue, 0)
endif
call SetTextTagText(text, s, 0)
call SetTextTagColor(text, 255, 255, 255, 255)
call SetTextTagVisibility(text, true)

E/ Ill assume you werent the coder in dualism :O just pm me (or your coder o_O) if youd like a system to implement the above vJass into your map

If I have to do it like that I need to know how to refer to a point variable instead of xValue and yValue when using "call SetTextTagPos" Does any of you know how to do that and if my code indeed does cause desync?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
I got it working! Here is the final result:
  • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Integer A) Not equal to (Player number of Player_Satyr)
          • Then - Actions
            • For each (Integer B) from 1 to 30, do (Actions)
              • Loop - Actions
                • Custom script: if GetLocalPlayer() == Player( bj_forLoopAIndex - 1 ) then
                • Set temp_point = (Center of Region_Talents[(Integer B)])
                • Floating Text - Create floating text that reads 0/3 at temp_point with Z offset 0.00, using font size Real_TextSize, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                • Hashtable - Save Handle Of(Last created floating text) as (Integer A) of (Integer B) in Hastable_FloatingText
                • Custom script: call RemoveLocation(udg_temp_point)
                • Custom script: endif
          • Else - Actions

EDIT: Does this cause a desync?

no it won't. it should work now properly

omfg so much text cant filter through it

again, NO!!!!!!!

If GetLocalPlayer() == # then
If the word "Create" is anywhere in this block, than it will desync. For noobs, creating something allocates a small block of code for the specific object. When you only create something on one computer rather than all, the game will detect hacking and kick you
endif

Just move the "endif" to right after where you set temp_loc

Also, because creating location will also allocate extra memory, set temp_loc to a value before the block than set it again in the temp block.

Oh BTW, from my standpoint, your doing it totally wrong. One second

e/ Ok fixed it up a tad bit

  • Actions
    • For each (Integer Loop_Int[1]) from 1 to 30, do (Actions)
      • Loop - Actions
        • Set TempLoc[Loop_Int[1]] = (Center of (Playable map area))
    • For each (Integer Loop_Int[0]) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Loop_Int[0] Not equal to (Player number of Player_Satyr)
          • Then - Actions
            • Custom script: if GetLocalPlayer() == Player(udg_LoopInt[0] - 1) then
            • Set TempLoc[Loop_Int[1]] = (Center of (Entire map))
            • Custom script: endif
          • Else - Actions
    • For each (Integer Loop_Int[1]) from 1 to 30, do (Actions)
      • Loop - Actions
        • Floating Text - Create floating text that reads 0/3 at TempLoc[Loop_Int[1]] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        • Custom script: call SaveInteger(GetLastCreatedHashtableBJ(), udg_Loop_Int[1], GetPlayerId(GetLocalPlayer()), GetHandleId(GetLastCreatedTextTag()) )
        • Custom script : call RemoveLocation(udg_TempLoc[udg_LoopInt[1]])
On the bottom custom script line, I'd reccommend changing GetPlayerId(GetLocalPlayer()) to 0 to further prevention of desync. To change the text to 1/3, 2/3 or 3/3 (well or Max) just do

custom script : if GetLocalPlayer then
set the text of Load Text Tag # (whatever your algorithm is) of 0 (if you had GetLocalPlayer() this line would have to be custom script) in WhateverHash

2e/ forgot to remove the location in that trigger.. updated

3e/ before i leave this thread, you can probably also set the text in the text tag to a single space locally for PlayerSatyr so he deosnt see a zillion 0/3 text tags in the center of the map

4e/
@Arthowk
Text tags have their own handle stack so it won't desync; this has been tested. Creating them locally is also the only way I can think of to have ~100 texttag limit per player.

Arthowk.... (read above about why creating them locally is B A D)
 
Last edited:
Level 14
Joined
Apr 20, 2009
Messages
1,543
Dear Arhowk,

A desynchronization is caused when the server sends information incorrectly to the client. (or vice versa ofcourse)
First off memory always gets allocated when an object is created.

However if an object is created within a local block this simply means that memory is allocated only for a specific client.
Now this doesn't mean that the server is sending incorrect information as of yet.

This paragraph is wrong ignore it.
However if other clients are abled to change (interact) with the information allocated to one single client, then that is what is causing the server to send information incorrectly to the other clients.
In fact this will cause a player to see things that aren't there or not see things that are there.
In other words, objects that can not be interacted with by other players will not cause a desynchronization.
End of paragraph

If I for example create a destructable locally for player 1, then that player will see the tree and other players will not.
Now when player 2 has a unit that walks against that tree, then that will cause a desynchronization for sure.
Not because the unit of player 2 interacts with the tree, but because the destructable handle does not have it's own index that is used as an individual counter. (hard coded I suppose?)
Causing the game to detect that the handle table that contains all information on the created handles are not the same for both players anymore and thus knows there is a desynchronization.


With floating text this is not the case since other players are not abled to interact with it. <- Wrong, this is not the case because floating texts do have their own index that is used as a counter and starts with 99 counting down to 0
Also, creating a floating text locally will extend the 100 floating text limit as it is only created for one player and thus every player can have 100 local floating texts.

Creating a floating text globally simply means that memory is allocated for every player for a floating text and so 1 floating text can be used less for all players.

Please proof me wrong ;)

EDIT: I must point out now that not all of this information is correct, nestharus gave the propper explenation of how a desynchronization is detected by the game underneath.
I've made some adjustments in smaller sized fonts to my explenation. I hope I've understood nastherus correctly and am now displaying correct information in this post.
 
Last edited:
Level 19
Joined
Aug 8, 2007
Messages
2,765
Dear Arhowk,

A desynchronization is caused when the server sends information incorrectly to the client.
First off memory always gets allocated when an object is created.

However if an object is created within a local block this simply means that memory is allocated only for a specific client.
Now this doesn't mean that the server is sending incorrect information as of yet.

However if other clients are abled to change (interact) with the information allocated to one single client, then that is what is causing the server to send information incorrectly to the other clients.
In fact this will cause a player to see things that aren't there or not see things that are there.
In other words, objects that can not be interacted with by other players will not cause a desynchronization.

If I for example create a destructable locally for player 1, then that player will see the tree and other players will not.
Now when player 2 has a unit that walks against that tree, then that will cause a desynchronization for sure.

With floating text this is not the case since other players are not abled to interact with it.


Please proof me wrong ;)

You got a legit copy of warcraft 3? Ill prove you wrong brother.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
I don't think you have to, look through the posts in this snippet and you'll find your answer:

http://www.hiveworkshop.com/forums/jass-resources-412/snippet-texttag-213488/

Theres a single GetLocalPlayer() command in that, and it prints the player number... ill take a better look at it but your point is?

e/ look im not in the mood for getting into arguments but he does exactly what i suggested doing, except with a more fail-safe method of using GetLocalPlayer()
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Hint:

post #13
post #14
post #17 (confirming)
post #37 (a question on local text tags)
post #39 (answers the question)
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Hint:

post #13
post #14
post #17 (confirming)
post #37 (a question on local text tags)
post #39 (answers the question)

... Im done unless youd actually like me to prove it to you

13 and 14 - Talks about USING text tags in local blocks, not creating them
17 = 135 posts, joined Oct. 11, yellow rep, no proof whatsoever to back what hes saying up. Note = If you made a text tag above 100, it will delete the first text tag. Thats because of the glitch with text tags, which involves the limit of them. Rather than going xxxx98 - xxxx99 - xxx100, it goes xxxx-98 - xxxx99 - xxxxx00

37 and 39 - Thats regarding the library!!!! The library properly makes them by creating one globally and setting all the details locally!!!! UGH
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
No, actually they talk about creating texttags in local blocks... furthermore, there is local code all over that snippet (I'm the one who wrote it).

Any data that is stored in the general handle table (not its own index) can't be local. This includes data like units and so on (agents). Any data that uses its own counter can be local. This includes texttags.


The reason for this should be apparent... when the handle table is no longer the same for 2 players, the game knows that the players have desync'd. There are other causes for desyncs as well, but this is one of the big ones.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
No, actually they talk about creating texttags in local blocks... furthermore, there is local code all over that snippet (I'm the one who wrote it).

Any data that is stored in the general handle table (not its own index) can't be local. This includes data like units and so on (agents). Any data that uses its own counter can be local. This includes texttags.


The reason for this should be apparent... when the handle table is no longer the same for 2 players, the game knows that the players have desync'd. There are other causes for desyncs as well, but this is one of the big ones.

1 more question: has someone already made a list of handles that uses it's own counter? Or should I check by displaying handleID's of each handle individually untill I see one that counts and then create such a list myself :)?
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
there are only a few handles that use their own counters

All handles that can't be created
gamecaches (max of 255)
hashtables (max of 255)
texttags

However, for gamecaches and hashtables, I don't know if they use a handle table id or not. If they do, then they won't be local. To check that, just initialize a gamecache and output the handle id, same with hashtable = P.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
there are only a few handles that use their own counters

All handles that can't be created
gamecaches (max of 255)
hashtables (max of 255)
texttags

However, for gamecaches and hashtables, I don't know if they use a handle table id or not. If they do, then they won't be local. To check that, just initialize a gamecache and output the handle id, same with hashtable = P.

Thanks :) And don't you mean that they can be created locally instead of can't (instead of gamecaches and hashtables, since you're still unsure about them)?
Or do you mean that they can't be created as in: they will not be put inside the general handle table and therefore aren't really created
(or rather: they are created as they are allocated but aren't really defined as handle since they have no actual handle id but their own index)?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
no, they will be created regardless, as either their own thing or as part of the handle table.

I trust that you know what youre doing but this function states otherwise

  • Hashtable - Save Handle Of(Last created floating text) as 0 of 0 in (Last created hashtable)
Either this is correct and your incorrect or what the value its actually retrieving is its "own measuring system". Mind elaborating?

e/ Nope your right. Printed out the handle of a unit and a text tag, unit was 10981324 (or sutin like that) and the tag was 99. Your always right >.>

2e/ regardless of which my suggestion is still better to prevent desyncs in theory. imagine

WC3 Server : OK Everyone, move texttag 55 to Temp_Loc!
Computers 1-3 : Done!
Computer 4: I didnt get texttag 35, so I have no texttag 55!
WC3 Server : error. desynchronization.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
no, they will be created regardless, as either their own thing or as part of the handle table.
I understand.

WC3 Server : OK Everyone, move texttag 55 to Temp_Loc!
Computers 1-3 : Done!
Computer 4: I didnt get texttag 35, so I have no texttag 55!
WC3 Server : error. desynchronization.

No it doesn't cause a desynchronization in any way (at least, that's what the game thinks), texttags have no Handle ID appointed to them from the general handle table, which is used to check whether the game desynchronized by checking if all players have the same handle tables. Texttags simply have their own custom index counter apointed as their Handle ID. (Which I suppose is hardcoded by blizzard) If I understood correctly...

In logical terms you would say: yes the server is desynchronized from the client since not all information is the same on both the server and client.
And this is correct, however since the texttags are not inside the handle tables that are used to check if the game is desynchronized, it gets ignored.
And this is a good thing IMO since text tags can then exist locally for each player.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Is it possible to show or hide a unit locally or create a unit locally? Basically I want to show a unit to only 1 player. If its impossible is there any other alternative to show a mdx graphic to only 1 player?

You can do it through abilities like ghost or via SetUnitX/SetUnitY locally, but if you do that (#2) then you can't interact with the unit at all, you can only view it.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Is it possible to show or hide a unit locally or create a unit locally? Basically I want to show a unit to only 1 player. If its impossible is there any other alternative to show a mdx graphic to only 1 player?

Nestharus is semi-correct. Im not sure about units, but I've made a system that uses GetLocalPlayer() to hide items for all players except 1 so everyone has their own drops and basically all u can do is select it or right click it. If you physically try to pick it up, it will desync so you have to put the item in the units inventory on order issue.

So if your going to do it, put Hide (unit) inside of a GLP() block. Make sure the unit has locust though, as having it interact with other units will desync. Nestharus also had a good suggestion of giving the unit "Ghost" inside of a GLP() block, but im not sure if adding abilities via GLP() will desync but its worth a test
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
I didn't say add ghost locally, lol... =p

I'm 100% correct as far as units go (which was the question, it wasn't about items)

And if you attempt to do ShowUnit(u, false) in a local bock, you will get an immediate desync, so you are incorrect. Items may work (although I've never tried them with it), but units most certainly do not. The only options are to move the unit for every player but 1 or to use a ghost ability.
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
I didn't say add ghost locally, lol... =p

I'm 100% correct as far as units go (which was the question, it wasn't about items)

And if you attempt to do ShowUnit(u, false) in a local bock, you will get an immediate desync, so you are incorrect. Items may work (although I've never tried them with it), but units most certainly do not. The only options are to move the unit for every player but 1 or to use a ghost ability.

Wouldnt a ghost still show the unit to allies though?

(and yes, ShowItem(i, false) doesnt desync as i said)
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
@Nestharus
Thank you kind sir. Me and Hashjie had a good laugh yesterday when we tried it. Moving a unit for players locally is hysterically ironical in my opinion and the funniest part about it is that it works.

No, no it does not.

Again, it might not instantly desync, but when units are issued to/from the unit, desync..
 
Level 17
Joined
Apr 27, 2008
Messages
2,455
I've tried it in the past, and IIRC indeed it didn't desync instantly and even not immediatly when an order was issued on it.
But when the order becomes effective, like if you order to attack the unit, until the unit is attacked (attack range of the attacker >= distance between the target and the attacker) there will be no desync.

Ofc there are plently of other cases you need to care like using the coordinates values in triggers, unit collision ...

Also if you bother to test it i've always wondered if opening a thread in a local block did desycn by itself, like using a ForForce to display a text message (just a silly example).
 
Status
Not open for further replies.
Top