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

I have a small problem...

Status
Not open for further replies.
Level 2
Joined
Dec 18, 2011
Messages
17
I'm currently working on a game in which each player only has one unit, that unit is basically their player, now, I'm trying to implement something which has this effect;
any message they post comes up as a message above their head... I encountered two problems;
1. the text never disappeared, not unless I use the 'destroy' function, but I wanted it to fade... not to, well, blow up.
2. The message still appeared as a chat message, so what the heck was the point of getting it to appear over somebodies head, I mean you could just read on the chat log... you don't need to be anywhere near them... (To clarify, this one is more important than the first one, not that the first one isn't important, but I don't need the first one, my game just feels less professional without it... on the other hand, without this one, my game is pointless.... especially as you could just send Private messages to one of the other players over distance...)

(BTW, what I'm asking for in the second one is a Action that stops an entered chat message from showing up...)
 
Floating texts are permanent by default.
You should make them non-permanent, give them a lifespan and a fading age:

  • Floating Text - Change TEXTTAG: Disable permanence
  • Floating Text - Change the lifespan of TEXTTAG to LIFE_SPAN seconds
  • Floating Text - Change the fading age of TEXTTAG to FADING_AGE seconds
 
Level 2
Joined
Dec 18, 2011
Messages
17
@magtheridon96: your floating text function works, even if it took me a little fooling round to get it working properly.

@Overcold_ice: Your link was very helpful, though I swear I wouldn't have broken something if that example map wasn't there...:p

(Will + rep both of you.)

Aaaaaaand I have another problem... two actually...
1.(the most important one...) How do I get it so that the floating text only comes up for people close-ish to the unit 'talking'? because right now you could be sitting over the other side of the map, and if you happen to have your screen in the right place, you get to see this floating text in the middle of the darkness.... not cool....
2. Errr... this one's just for aesthetic purposes... but how do you colour text...? I mean, the character says whatever, and their name is on the beginning of whatever, but the name isn't coloured... it's white, which isn't really cool... And I have figured out how to change the colour of the entire floating text, just not particular bits of it, which is what I want...
 
Level 7
Joined
Apr 30, 2011
Messages
359
1. well . . . i'm sure this can be done

(after you make the floating text)
pick all players and do:
- if it can see the player can see the player that chats then do:
-- show that floty text
- else
-- hide it

i'm sure it will do . . . .

2. i'm not sure about this, but try to use:
"|cAARRGGBB< your string >|r"
|c is the code start block
AA is transparency value, 00 = invisible
RR is red tinting value
GG is green
BB is blue
then enter your string . . .
|r to close the code block

i haven't tested it, so i don't know . . .

offtopic: it's the first time my name isn't mis-spelled . . . .
peoples oftenly wrote overlord instead of overcold . . .
 
Level 7
Joined
Apr 30, 2011
Messages
359
1.
  • Custom script: call SetTextTagVisibility(bj_lastCreatedTextTag, IsUnitVisible(unit, GetLocalPlayer()))
2.
  • Floating Text - Change the color of (Last created floating text) to (100.00%, 100.00%, 100.00%) with 0.00% transparency

for num 1, use it instead . . .
for num 2, s/he asked a way to color only specific string inside the floty text
 
Level 2
Joined
Dec 18, 2011
Messages
17
1. well . . . i'm sure this can be done

(after you make the floating text)
pick all players and do:
- if it can see the player can see the player that chats then do:
-- show that floty text
- else
-- hide it

i'm sure it will do . . . .

Yeah, that was my general idea too... but I couldn't figure out how to input that a player could see a player, I even tried to set a boolean variable which switched to true whenever a player came into the sight of another player, and switched to false whenever a player left the sight of that player... but I can't seem to get the commands working.:\

2. i'm not sure about this, but try to use:
"|cAARRGGBB< your string >|r"
|c is the code start block
AA is transparency value, 00 = invisible
RR is red tinting value
GG is green
BB is blue
then enter your string . . .
|r to close the code block

i haven't tested it, so i don't know . . .

Hmmm... yeah, this is likely to work... not that I've tried it or anything, but it looks suspiciously like the text in the unit descriptions in the object editor... (which just happened to work...) I'll let you know when I've tried it.;)

offtopic: it's the first time my name isn't mis-spelled . . . .
peoples oftenly wrote overlord instead of overcold . . .

Lol... I tend to be a grammar fantasist, I really don't like getting anything wrong... (Something to do with doing C++ in my spare time...) (BTW... oftenly? I don't think that word exists...:p)

1.
  • Custom script: call SetTextTagVisibility(bj_[lastCreatedTextTag, IsUnitVisible(unit, GetLocalPlayer()))

Err... I haven't actually been doing this very long, and I haven't found the button to write/import custom scripts...XD

2.
  • Floating Text - Change the color of (Last created floating text) to (100.00%, 100.00%, 100.00%) with 0.00% transparency

Urm, yeah, what Overcold_ice said, I want to change a substring of the text, not the entire text... I could already change the lot... it isn't like I'm that bad at map making.:p
 
WAIT- What? I could've sworn it was overlord_ice and not overcold_ice >:O

---

Err... I haven't actually been doing this very long, and I haven't found the button to write/import custom scripts...XD

It's at the top :p
Right under "Comment" (I think)

Basically, what GetLocalPlayer() does is give the handle of the player on his own computer, so if you were Player 4, and you displayed the player number of the GetLocalPlayer() on the screen, you would see 4, while Player 3 would see 3 :D

This function is also pretty useful when handling player-specific multiboards and stuff ^.^
 
Level 2
Joined
Dec 18, 2011
Messages
17
offtopic:
what should 'oftenly' replaced with ?_?
usually?

off topic; You can say "frequently".

Yeah, kind of what bribe said, but it isn't that fixed, you could use 'typically', 'frequently', 'habitually' or 'generally'... but yes, usually, I would use usually, considering it's an extremely simple word that fits perfectly into that position.

if you don't get what GetLocalPlayer() means, see this:
GetLocalPlayer()

i think you know what it means, since you can code C++ . . . .

Hurm, yeah, now I definitely know exactly what it does, I was pretty darn sure I knew what it did before this, now I know exactly.... or more to the point, before I knew basically what it would do, know I know how it would do it.XD (The reason for my last post was because I hadn't found the import/write function for triggers in the editor...XD)

WAIT- What? I could've sworn it was overlord_ice and not overcold_ice >:O

---



It's at the top :p
Right under "Comment" (I think)

Basically, what GetLocalPlayer() does is give the handle of the player on his own computer, so if you were Player 4, and you displayed the player number of the GetLocalPlayer() on the screen, you would see 4, while Player 3 would see 3 :D

This function is also pretty useful when handling player-specific multiboards and stuff ^.^

I'm probably looking pretty silly right now.XD
Though it's actually going to be a lot easier to cope with some of the bugs I'm hitting now that I know it's location... even if I should have been able to find it myself...XD
(Going to +rep Overcold_Ice, Magtheridon96 and maker.EDIT: Did I do something wrong...? Because it won't let me +rep any of you, even maker, who I'm pretty sure I haven't given a +rep to before this...*is confused*.)

EDIT: I tried Overcold_ice's colour coding, and it works like a charm... though did I ever say I hate hex...? (So hard to think in hex...XD( I mean, in the use it has in that code is fairly simple, but five digit hex numbers make my head explode...XD)
 
Last edited:
Level 2
Joined
Dec 18, 2011
Messages
17
Errr... yeah, I've just encountered another problem, this being that I don't happen to know JASS, and therefore can't actually write my own custom scripts, so, unfortunately, I'll need another pointer, this is probably going to be the last... hopefully...

Anyways, I want these buildings that players 'heroes' can build called 'listening devices', now these 'listening devices' can hear what people say, but they can't tell who is saying them...(They have a sight of 0.00, but I want them to be able to pick up what people's 'heroes' who are close to them are saying, by displaying in the in-game chat log(only to the player who owns it), but unfortunately considering the way they are set up a player cannot 'see' a player, but would still be able to 'hear' them... which means that maker's last custom script which is so useful doesn't actually work here....)

Help would be rather appreciated... again...:\
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
When the floating text should pop up, you pick all units in range of the supposed text tag. You check the owner of each unit. For each player that is close to the floating text location, display the floating text.

Does the listening device have locust? Because units with locust won't be picked by Pick all units in range. You must use Pick all units of player...
 
Level 2
Joined
Dec 18, 2011
Messages
17
Err.. I'm not exactly sure what you mean by locust, but I don't think it's got that... no. But it does have the... spectre? gah, why can't I remember the name of the undead teams spy thing.... probably because I prefer to play humans and barely ever play undead... meh, anyway, it's permanently invisible... could you write up that trigger if it would still work? :\
 
Status
Not open for further replies.
Top