• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Text messages position.

Status
Not open for further replies.

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
543
Is there a way to change the position of where text messages appear?

(Messages that are generated via this action)
[trigger=""]Game - Display to (All players) the text: Message.[/trigger]

Thanks in advance!

JASS:
native DisplayTextToPlayer takes player toPlayer, real x, real y, string message returns nothing
native DisplayTimedTextToPlayer takes player toPlayer, real x, real y, real duration, string message returns nothing
 
Level 7
Joined
Nov 15, 2009
Messages
225
Jass is the world editor script language.

The triggers you can click is called GUI, upon playing the map the GUI code is converted into JASS.

If you want to add a single line of JASS code into a GUI trigger you can use the action:
Custom Script

for example:

  • Your Trigger Name
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Custom script: call DisplayTextToPlayer(Player(0), 0, 0, "Surprise message")
will display a message for player 1 (it's 0 in JASS).
Play around with both 0 integers to move the text.
 

SpasMaster

Hosted Project: SC
Level 24
Joined
Jan 29, 2010
Messages
1,986
@SeriousEnemy

Thanks for your reply. I will try that tommorow, but first I have one question: I do not want to define the player by his number, but with this (Owner of Buying Unit)

[trigger=""]Game - Display to (Player group((Owner of (Buying unit)))) for 10.00 seconds the text: Message
[/trigger]

How do I do it? Thanks.
 
Level 7
Joined
Nov 15, 2009
Messages
225
  • Game - Display to (Player group((Owner of (Buying unit)))) for 10.00 seconds the text: Message
How do I do it? Thanks.

Copy and paste it into your custom script action.

1st: showing Bought: UnitName
call DisplayTimedTextToPlayer(GetOwningPlayer(GetSoldUnit()), 0, 0, 10, "Bought: " + GetUnitName(GetSoldUnit()))

2nd: showing Success
call DisplayTimedTextToPlayer(GetOwningPlayer(GetSoldUnit()), 0, 0, 10, "Success")


Will work with the "unit sells a unit" event.
 
Alternatively if you are ever stuck and can't find the JASS equivalents, just assign it to a variable and then plug in the variable as input. As long as the variable is the correct type and you wrote the name out correctly (including the udg_ prefix), it will work.
  • Set TempPlayer = (Owner of (Buying unit))
  • Custom script: call DisplayTimedTextToPlayer(udg_TempPlayer, 0, 0, "Example")
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
Appear? You mean sometimes it appears in the middle or left or right or such... I mean the text messages. Well with the usages of spaces and such that is quite possible if that is your case btw.

If not please elaborate more and Ill try to help.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Appear? You mean sometimes it appears in the middle or left or right or such... I mean the text messages. Well with the usages of spaces and such that is quite possible if that is your case btw.

Adjusting the parameters in the jass function is a good solution. I would not add spaces to do that.

Note that the offset is resolution dependent if I remember correctly, so the text might not appear at the same place on all resolutions.

You can add line changes before or after the text to make it appear higher/lower. The line break is "/n" I think.
 
Status
Not open for further replies.
Top