HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Text offset

12-18-2006, 03:25 AM#1
Pyrogasm
In WEU there is a function
Trigger:
Game - Display to (Player Group), at offset (x, y) for x seconds the text: Text
Or something of that sort. What is the code for this in JASS so that I can implement it in regular WE with a custom script? I'm making an invalid cast error message for a spell.

On a related note, is there a way (in custom script or through GUI) to play a sound for a specific player? I need to use the error sound.
12-18-2006, 04:30 AM#2
MercyfulJester
Can't you convert it into JASS?

Edit: Ah yes, pardon me.
12-18-2006, 04:51 AM#3
Pyrogasm
I don't have WEU, nor can I get it because I'm on a Mac. All I need is for someone to take all of two seconds to open up WEU, make that action, convert it to custom text, and post it here. Or, if someone who knows JASS well can just post it off the top of their head, that would work.
12-18-2006, 08:05 AM#4
Anitarf
You could just try converting the regular GUI action without the coordinates and see where that gets you. It gets you here, and it's easy to modify this function to also take the x and y coordinate as parameters.
12-18-2006, 11:58 AM#5
Vexorian
You can get WEU...
12-18-2006, 01:30 PM#6
ArchWorm
Pyrogasm, when you want to play a sound for a specific player, you must perform
Collapse JASS:
GetLocalPlayer()==p //p is an argument
GLP is an ugly func, it leads to desyncs
But not that way.
For this one, it's safe.
~AW
12-18-2006, 08:04 PM#7
Anopob
Collapse JASS:
function Trig_Test_Actions takes nothing returns nothing
    call DisplayTextToPlayer( Player(0), 0, 0, "TRIGSTR_002" )
endfunction

//===========================================================================
function InitTrig_Test takes nothing returns nothing
    set gg_trg_Test = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Test, function Trig_Test_Actions )
endfunction

It's what I got...I just download WEU to test it out yesterday

Just edit the TRIGSTR_002 to your text message, the offset stuff and the player. I didn't find a player_group display message action though.
12-19-2006, 12:16 AM#8
Pyrogasm
Quote:
Originally Posted by Vexorian
You can get WEU...
True, I can get it, but I can't run it without a halfway decent Windows Emulator. Find me a link to a mac version, and I will worship you forever, though.

I would have tried to convert just a regular message and then decipher it, but honestly understand very little JASS, so I thought I would have been in way over my head. Next time I'll try something of that sort first.
12-19-2006, 12:55 AM#9
Anopob
So...does the converted JASS script I gave work or no?
12-19-2006, 01:10 AM#10
Pyrogasm
Sort of. The problem was that I needed to display it to TriggerPlayer(), not Player(whatever the player number is), so I had to tweak it. I ended up using this:
Collapse JASS:
call DisplayTimedTextToPlayer(GetTriggerPlayer(), 0, 0, 3.00, "|cffffcc00Invalid Cast.")

Archworm, I don't get what you're saying. I tried things similar to this:
Collapse JASS:
call PlaySoundBJ( GetLocalPlayer(GetTriggerPlayer()) gg_snd_Error )
Am I on the right track? Can you explain more clearly please?

EDIT: I've run into a problem: If I set the x offset to be anything more than 2, the text doesn't show. If I set it to 2, the text shows on the far right of the screen, and if I set it to 1, it displays on the left. Also, if I show a new message directly after it without an offset (just using the GUI action), it will be displayed at the offset of the previous message. Odd.
12-19-2006, 02:43 AM#11
wyrmlord
The x and y values are real values, not integers. That's why the offsets are bigger than you'd expect. Even when you move the text, it's still a text message so it will get moved up when you display another. If you don't want it to move, you'd probably have to figure out some system where whenever you probably want to display text that you would clear the screen, display the text, and then display another text message in the spot you want it to be in. If that fails, you can always get the target X/Y of the screen and create floating text accordingly.
12-19-2006, 05:19 AM#12
Pyrogasm
Ok, so the text works fine now. The problem still remains with the sound, though. If someone could please explain it to me (or add on to what Wyrmlord said), I would greatly appreciate it. I'm trying to play the Error.wav sound for only the triggering player, not all players.
12-19-2006, 06:00 AM#13
PipeDream
Collapse JASS:
if GetLocalPlayer() == desiredplayer then
    call StartSound(sound)
endif
Have to be careful to create the sound for everyone no matter who actually needs to hear it.. Typically you only need one handle which you can create at start up.
12-19-2006, 12:02 PM#14
Vexorian
Quote:
Originally Posted by Pyrogasm
True, I can get it, but I can't run it without a halfway decent Windows Emulator. Find me a link to a mac version, and I will worship you forever, though.

I would have tried to convert just a regular message and then decipher it, but honestly understand very little JASS, so I thought I would have been in way over my head. Next time I'll try something of that sort first.
You can't use the mpqdraft patcher, but you can surelly use WEU. Just extract WEU.exe 's contents using an mpq editor and extract it to warcraft III's folder. I am sure you have ways to extract it if not I can post the contents
12-20-2006, 04:02 AM#15
Pyrogasm
Sorry Vex, I can't get the files from WEU.exe because the only WEU downloads are the installer for it (weusetup120.exe), which I can't extract files from. If you could please post those files here, PM them to me, or email them to me at [email protected] I would greatly appreciate it. Hopefully I can figure it out from there.

Question: Can I really extract files from .exe's with an MPQ extractor? I'm using Diablo MPQ Tools. I also tried using MPQ2K, but it couldn't extract it either.