• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

How can you send Game Messages to only one player.

Status
Not open for further replies.
Oddly enough, there's no GUI action for this, but in JASS there's a function DisplayTextToPlayer() and its timed counterpart DisplayTimedTextToPlayer().

However, I'm pretty sure the GUI action that sends text to a player force has options for sending it to individual players (but not positive on this, since I haven't used the GUI action in a while and I can't check right now). If this does work, you don't have to worry about leaking a force since I'm pretty sure the action uses a set of bj globals instead of creating a new force.
 
If you need a more specific way of doing this (rather than needing a preset player), you can use Jass:

JASS:
call DisplayTextToPlayer(thePlayer,0.,0.,theText)
call DisplayTimedTextToPlayer(thePlayer,0.,0.,theTime,theText)

//for example

call DisplayTimedTextToPlayer(GetOwningPlayer(GetTriggerUnit()),0.,0.,5.,"Our town is under attack! " + GetUnitName(GetTriggerUnit()) + " was just targeted!")
 
I think this is solved now man :)

But well, if you want the best way of doing this, here's the trigger:
  • Player Message
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set MessagePlayer = (All players matching (((Matching player) Equal to (Your Wanted Player (Color)) and (((Matching player) slot status) Equal to Is playing)))
      • Player Group - Pick every player in MessagePlayer and do (Actions)
        • Loop - Actions
          • Game - Display to (Player group((Picked player))) the text: Your Text
      • Custom script: call DestroyForce(udg_MessagePlayer)
 
Status
Not open for further replies.
Back
Top