• 🏆 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] Game Text Loc.

Status
Not open for further replies.
You'll have to use the JASS equivalents. Typically you'll use:
JASS:
native DisplayTimedTextToPlayer     takes player toPlayer, real x, real y, real duration, string message returns nothing

I'll explain the arguments real quick:
  • player toPlayer - The player you want to display the text to. A nice trick to display the message to all players is to input GetLocalPlayer(). Be careful when using that in other scenarios though--it only works well here because it is just a visual message (doesn't impact gameplay).
  • real x - The x-coordinate on the screen in which the message should start.
  • real y - The y-coordinate on the screen in which the message should start.
  • real duration - How long you want the message to last.
  • string message - The message you want to display.

For example, let's say I want to display a message reading "Hello world!" at the coordinates (0.5, 0.5) to all players, for 60 seconds. I would write:
  • Custom script: call DisplayTimedTextToPlayer(GetLocalPlayer(), 0.5, 0.5, 60, "Hello world!")
You may be asking, what do the coordinates correspond to? Where exactly is (0.5, 0.5)? Well, from memory the coordinates range from 0.0 to 2.5. But I don't remember exactly. The best way to find out is to test it out! The default coordinates are (0.0, 0.0) if that gives you perspective (the bottom left area of the screen, above the UI).

A few notes:
  • When you move one game message, it'll automatically move all the other messages as well. So if you are displaying a message on a particular area on the screen, it is a good idea to clear text messages before doing so. Otherwise it may look weird.
  • Don't use too large values. It might end up off-screen.
  • Be careful when you display a message on map initialization. It might end up in a different position there than if you created it during the map's gameplay.

For more information, check this out:
http://www.wc3c.net/showthread.php?t=90599
 
Status
Not open for further replies.
Top