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

[General] How to make a text only shown to all player except the picker?

Status
Not open for further replies.
Level 4
Joined
Dec 16, 2013
Messages
84
sorry for my english

So how to make a text like dota whenever a player picked a hero?
ofcourse with color too
example:
i pick ursa

then text come out to all players except me
A_Player has chosen Ursa
Blue for player 1, and so on

oh i actually made it, but it gets weird result
Game - Display to (All players matching ((Matching player) Equal to (Owner of Spawnedunit))) the text: ((Text[(Player number of (Owner of Spawnedunit))] + ((Name of (Owner of Spawnedunit)) + (|r + (has choosen + (Name of (Sold unit)))))) + )
 
sorry for my english

So how to make a text like dota whenever a player picked a hero?
ofcourse with color too
example:
i pick ursa

then text come out to all players except me
A_Player has chosen Ursa
Blue for player 1, and so on

oh i actually made it, but it gets weird result
Game - Display to (All players matching ((Matching player) Equal to (Owner of Spawnedunit))) the text: ((Text[(Player number of (Owner of Spawnedunit))] + ((Name of (Owner of Spawnedunit)) + (|r + (has choosen + (Name of (Sold unit)))))) + )

The line ((Matching player) Equal to (Owner of Spawnedunit)) should probably be ((Matching player) Unequal to (Owner of Spawnedunit)), because you want to show it for all players except the picker.

Also, it probably shows up weird because you need to have spaces. "has choosen" should actually be " has choosen " (add a space before and after). When you concatenate strings (add them), they don't automatically space.

Also, (All players matching...) creates a new player group. To prevent leaking, you should probably make a player group variable with it, and then use DestroyForce() at the end of your trigger. See: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/
 
Level 4
Joined
Dec 16, 2013
Messages
84
The line ((Matching player) Equal to (Owner of Spawnedunit)) should probably be ((Matching player) Unequal to (Owner of Spawnedunit)), because you want to show it for all players except the picker.

Also, it probably shows up weird because you need to have spaces. "has choosen" should actually be " has choosen " (add a space before and after). When you concatenate strings (add them), they don't automatically space.

Also, (All players matching...) creates a new player group. To prevent leaking, you should probably make a player group variable with it, and then use DestroyForce() at the end of your trigger. See: http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

bro i just changed equal to not equal and add space
but i still got weird result

the picker of specifiec unit always get this text
(blank space) has chosen (Name hero)
like this
SrdwQ6l.jpg

how to solve this?
btw thanks for the leak article, i am reading it right now

this is my current trigger
Game - Display to (All players matching ((Owner of (Sold unit)) Not equal to (Owner of Spawnedunit))) the text: ((Text[(Player number of (Owner of Spawnedunit))] + ((Name of (Owner of Spawnedunit)) + (|r + ( has chosen + (Name of (Sold unit)))))) + )

oh yes, spawnedunit = sold unit


Additive to what PurgeandFire said, here are color codes. (scroll a bit down to find common ones)

well, i do understand about the color
and make it works on specific player
thanks, probably i need that in the future
 
Level 4
Joined
Dec 16, 2013
Messages
84
So all works now? "Name of ower of unit" will be of course empty if unit variable is not set before.

it is not work yet, only color only that apply to each player

Game - Display to (All players matching ((Owner of (Sold unit)) Not equal to (Owner of Spawnedunit))) the text: ((Text[(Player number of (Owner of Spawnedunit))] + ((Name of (Owner of Spawnedunit)) + (|r + ( has chosen + (Name of (Sold unit)))))) + )

i was just thinking about this: display to all players except the picker of the unit that he/she picked, but i have no idea to make it on trigger
 
Player number of Player = Integer, not a colour code

You can use this as index Set Colour[1] = xxx, Set Colour[2] = xxx ... and later use Colour[Player number of Player]

What is 'owner of Spawnedunit' does this unit even exist?

Pick all players and do actions:
If picked player =! owner of sold unit --> display text message
 
Level 4
Joined
Dec 16, 2013
Messages
84
oh hey, actually the color issue is solved with this trigger

Game - Display to (All players matching ((Matching player) Equal to (Owner of (Buying unit)))) the text: ((Text[(Player number of (Owner of (Buying unit)))] + ((Name of (Owner of (Buying unit))) + (|r + ( has chosen + (Name of (Sold unit)))))) + )

"Text" on the trigger above mean integer = Set Colour[1] = xxx like what you wrote above
i did it before you explain to me hehe

the problem is i want the text like dota, you can read at the first post
hard to explain haha
 
Level 4
Joined
Dec 16, 2013
Messages
84
i tried it

ok it's working now, i changed the equal to not equal

in this trigger
Game - Display to (All players matching ((Matching player) Not equal to (Owner of (Buying unit)))) the text: ((Text[(Player number of (Owner of (Buying unit)))] + ((Name of (Owner of (Buying unit))) + (|r + ( has chosen + (Name of (Sold unit)))))) + )

thank you guys
 
  • PlayerColors
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Player[1] = (|CFFFF0000 + ((Name of Player 1 (Red)) + |r))
Repeat for every player.

[1] = |c00FF0000
[2] = |c000042FF
[3] = |c001CE6B9
[4] = |c00540081
[5] = |c00FFFC01
[6] = |c00FEBA0E
[7] = |c0020C000
[8] = |c00E55BB0
[9] = |c00959697
[10] = |c007EBFF1
[11] = |c00106246
[12] = |c004E2A04

This might help.

Then use.

  • Game - Display to (All players matching ((Matching player) not Equal to (Owner of Spawnedunit))) the text: ((Player[(Player number of (Owner of Spawnedunit))] + (|r + (has chosen + (Name of (Sold unit)))))) + )
This should work.
 
Last edited:
Status
Not open for further replies.
Top