HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Game text question

06-23-2006, 05:08 AM#1
Hemlock
Is there a custom script call to centerize game text, cause there doesn't seem to be a effective one in the GUI.

thanks in advance
06-23-2006, 05:13 AM#2
PipeDream
DisplayTimedTextToPlayer(toPlayer,x,y,duration,message) with x,y = 0.5 or so. But... well you have to see for yourself.
06-23-2006, 05:36 AM#3
Hemlock
hmm, I am not the expert with jass, so a little more help would come in handy, so far I got

Trigger:
Custom script: call DisplayTimedTextToPlayer (player1, 1.0, udg_first_text[textnumber])

but this does not work, it gives me an error

Not sure, weather it was allowed to display the array like that in custom script
06-23-2006, 05:40 AM#4
Jacek
1. I don't see the y value

2. you meant Player(1)
06-23-2006, 05:44 AM#5
Hemlock
not sure what the X and Y represent compared to where it will appear on the screen, so could someone explain that to me.

the custom script now looks like this but apperently I did something wrong cause I still have a script error.

Trigger:
Custom script: call DisplayTimedTextToPlayer (player(1), 1.0, 1.0, udg_first_text[textnumber])
06-23-2006, 05:49 AM#6
harshateja
Note a problem with that function though, when you call it, it will center all previous game text to that location as well. So if you some other game text on the screen, it will move too.
06-23-2006, 05:51 AM#7
PipeDream
- JASS is case sensitive
- You're probably Player(0)
If you want to broadcast the message, use "GetLocalPlayer()"
- 0,0 is lower left, 1,1 is upper right
06-23-2006, 05:58 AM#8
Hemlock
harshateja: that won't be a problem.

PipeDream: I checked the case sensitivities but I can't find a problem with that, I also replaced player(1) with player(0), but that did not seem to reslove it.
06-23-2006, 07:06 AM#9
PipeDream
Player
06-23-2006, 10:09 AM#10
Rising_Dusk
Emphasis on the capital 'P' in case you were wondering. :P
06-23-2006, 03:17 PM#11
The)TideHunter(
Yea, just try

Collapse JASS:
call DisplayTextToPlayer(Player(0), 0.5, 0.5, udg_first_text[textnumber])

If that dosent work then its your variables that are making a problem

EDIT:
Unless 'textnumber' is a custom global or a local, that will cause errors, it needs to be udg_.
So if its not custom global or local, use:
Collapse JASS:
call DisplayTextToPlayer(Player(0), 0.5, 0.5, udg_first_text[udg_textnumber])
06-23-2006, 04:48 PM#12
Freakazoid
Well I did it with a bunch of spaces
06-23-2006, 05:06 PM#13
blu_da_noob
Quote:
Originally Posted by PipeDream
- 0,0 is lower left, 1,1 is upper right

That is incorrect. I tested a while ago and ended up with about 2 for upper right, but I hear it varies depending on resolution.
06-24-2006, 02:06 AM#14
PipeDream
Pfff... I got the sign and order of magnitude.
06-24-2006, 06:03 AM#15
Hemlock
well capatalizing the (p) from player(0) did not remove the error either.

the script now looks like this
Trigger:
Custom script: call DisplayTimedTextToPlayer (Player(0), 1.0, 1.0, udg_first_text[textnumber])

and the [textnumber] is an array that I use a interger to increase.