HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Floating text looking diff on diff computers

04-10-2006, 02:33 AM#1
Moss
I have created this trigger to display a constant "mana bar" over certain units in my map, I tried doing something like the progress bars in Bomber Command. It recently came to my attention that this effect looks different on different computers and doesn't work at all on some. I am used to seeing something like |||||||||| on my computer, except closer together. On my friends computer it actually displays as a solid bar (same thing with Bomber command) and on three other computers I've seen it doesn't show up at all. Does anybody know what is up with this?

Trigger:
Actions
Collapse Unit Group - Pick every unit in powernodes and do (Actions)
Collapse Loop - Actions
Set temp_bar = <Empty String>
Set temp_bar_length = ((Mana of (Picked unit)) / (Max mana of (Picked unit)))
Set temp_bar_length = (temp_bar_length x 100.00)
Collapse For each (Integer A) from 1 to (Integer(temp_bar_length)), do (Actions)
Collapse Loop - Actions
Set temp_bar = (temp_bar + |)
Set p = (Position of (Picked unit))
Set p2 = (p offset by (-80.00, 0.00))
Floating Text - Create floating text that reads temp_bar at p2 with Z offset -200.00, using font size 5.00, color (0.00%, 30.00%, 100.00%), and 10.00% transparency
Set pg = (All players matching (((Picked unit) is visible to (Matching player)) Equal to False))
Floating Text - Hide (Last created floating text) for pg
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 0.55 seconds
Custom script: call DestroyForce(udg_pg)
Custom script: call RemoveLocation(udg_p)
Custom script: call RemoveLocation(udg_p2)
04-10-2006, 02:52 AM#2
Naakaloh
I believe that the issue is a result of using different resolutions or possibly some other video-related setting or hardware problem. The functions should not be doing two different things on different computers.
04-10-2006, 04:21 AM#3
Vuen
You may want to use a global string array that you build beforehand, rather than generating the string every .55 seconds, especially since you iterate it in a loop. This probably leaks strings like crazy.
04-10-2006, 07:15 AM#4
Anitarf
Strings only leak the first time a unique string is generated. As long as he keeps making the same strings over and over again, it's not a problem.
04-10-2006, 08:32 AM#5
Captain Griffen
Try " |" instead. "|" tends to format oddly as a character (not just in War3), so that might be the problem.
04-10-2006, 09:15 AM#6
Jacek
If you are running War3 in OpenGL mode, text looks strange...
04-10-2006, 10:22 AM#7
Rao Dao Zao
It's resolution. I used to run on a 640x480 or whatever the lowest setting is, and the text goes to pot. Works fine anywhere above that, though, I think.
04-10-2006, 08:57 PM#8
Moss
Thanks, for the info guys. I'm not too worried about it looking a little different on different machines but I do want it to be visible in some shape or form. I guess there is no way to do things so that it will be visible for sure on any normal computer regardless of Warcraft game settings? Is there a better way to achieve the effect I want of a floating indicator bar showing the mana of a unit?