• 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.

[Solved] DisplayTextToPlayer to owner of specific unit?

Status
Not open for further replies.

Deleted member 231919

D

Deleted member 231919

Hi, I have been using GUI for a good 10+ years and have finally been trying to move onto using jass with Sharpcraft/WEX.

I had a question about this certain line of code:

JASS:
call DisplayTextToPlayer(GetOwningPlayer('Hpal'), 0, 0, "Hello World")

I want this line of code to show that text to the owners of whoever owns Hpal, which is the Paladin hero.


But I get this error:

"Cannot convert integer to unit in parameter whichUnit in call to GetOwningPlayer"

I don't understand. Hpal is an integer? How can I make this work? Convert Hpal to a unit? What would the function for converting it be? I am totally new at jass so I don't know a lot about it but I have a good understanding of basic programming.


Thank you for your time in reading/helping.
 

Deleted member 231919

D

Deleted member 231919

Ahh, okay. I came up with this and it works:

JASS:
call DisplayTextToPlayer(GetOwningPlayer(gg_unit_Hpal_0000), 0, 0, "Hello World")

That's for that specific paladin hero and not for all paladin heroes. If I wanted to show that text to all owners of the Paladin hero, I would do it like in GUI and do: "Pick Every Unit in Unit Group...", convert it to custom text and so on I am assuming. (I am learning jass by converting GUI to custom text).

Thank you for helping me understand, KILLCIDE. :)
 
Last edited by a moderator:
Status
Not open for further replies.
Top