HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Strange question: not the real unit's position?

05-26-2006, 08:05 PM#1
StockBreak
Hi all, normally I use a floating text function such as:

Collapse JASS:
function CriticalStrike takes string s, unit u returns nothing
    local texttag tt = CreateTextTagLocBJ( s, GetUnitLoc( u ), 0, 10, 100, 0.00, 0.00, 0 )
    call SetTextTagVelocityBJ( tt, 72.11, 90 )
    call SetTextTagPermanentBJ( tt, false )
    call SetTextTagLifespanBJ( tt, 5 )
    call SetTextTagFadepointBJ( tt, 2.00 )
    set tt = null
    call RemoveLocation( GetUnitLoc( u ) )
endfunction

The unit used in the trigger has also a Critical Strike ability which strikes with a 100% chance. Using that function I noticed that the "real" Critical Strike floating text it's not shown on the same position of mine text, why? The "real" is offset by a value, is there a way to get its exact location? When using the unit location point, the text seems to be a bit right offset and not at all centered on the unit position, why? Using the function which shows the text overhead the unit is even worse. Any help will be appreciated. Thanks.

P.S: I know, the question is a bit weird ^^

EDIT: i corrected the code a bit
EDIT: again
05-26-2006, 09:43 PM#2
Captain Griffen
Do you mean that the y offset is off, or the x, or what?

Also, I hope those aren't your actual triggers...leaky, and inefficient.
05-26-2006, 10:47 PM#3
StockBreak
I know well it is not very efficient, actually it's just an example to show the function I used: CreateTextTagLocBJ. My problem is that if I have this trigger and Critical Strike starting together, the floating texts doesn't appear to be perfectly overrided, but the original one it's offset by a value (it's a -x value) which changes from unit to unit, how to solve it? Thanks.
05-26-2006, 11:36 PM#4
The)TideHunter(
The data for it should be in Ability.slk file, not totaly sure, iv never really scanned through the .slk files.

Anyways, iv heard the .slk files is where ability data is stored
05-27-2006, 12:15 PM#5
blu_da_noob
The data for Critical Strike floating text (and all others, gold, bounty etc) is found in MiscData.txt.
05-27-2006, 12:29 PM#6
iNfraNe
Quote:
Originally Posted by Captain Griffen
Do you mean that the y offset is off, or the x, or what?

Also, I hope those aren't your actual triggers...leaky, and inefficient.
They dont leak, much, floating texts do destroy themselves after lifespan, the only leak here is the not setting to null.
05-27-2006, 12:40 PM#7
StockBreak
Quote:
Originally Posted by The)TideHunter(
The data for it should be in Ability.slk file, not totaly sure, iv never really scanned through the .slk files.

Anyways, iv heard the .slk files is where ability data is stored
I checked this file, but i couldn't find any useful information about text tags. Thanks anyway.

Quote:
Originally Posted by blu_da_noob
The data for Critical Strike floating text (and all others, gold, bounty etc) is found in MiscData.txt.
Yes, I knew the existance of that file and I used it a lot, but I think there are no informations about the "location" of the text. Here is its contenent:

Code:
// CriticalStrike text tag data
CriticalStrikeTextColor=255,255,0,0
CriticalStrikeTextVelocity=0,0.04,100
CriticalStrikeTextLifetime=5
CriticalStrikeTextFadeStart=2
05-27-2006, 01:04 PM#8
Captain Griffen
Quote:
Originally Posted by iNfraNe
They dont leak, much, floating texts do destroy themselves after lifespan, the only leak here is the not setting to null.

GetUnitLoc(gg_unit_hsor_0002)

As well as not nullifying.

I seem to remember that the crit message is created offset towards where the unit is facing. I'm not completely sure, but should be easy to check by looking.
05-27-2006, 01:08 PM#9
StockBreak
Actually, the custom critical text WORKS ON HEROES, but not on units (mine text it's yellow to show you the difference):

Hero


Unit


Any ideas?
05-27-2006, 01:23 PM#10
Captain Griffen
Test if it is getting the unit's location correctly. Maybe try GetUnitX and GetUnitY (not sure those are the exact names).
05-27-2006, 01:46 PM#11
StockBreak
Thanks for the idea, but I tried it and it gives the same results...
05-27-2006, 02:52 PM#12
weaaddar
Its not terribly offset, but as I remember the units location is given by its center of its boundry circle (don't remember what its called). Try setting the radius of its boundry circle to the same size as that of a hero and see if it works then. I believe units are mostly set to 32, while hero's are all 64.
05-27-2006, 03:37 PM#13
iNfraNe
Quote:
Originally Posted by Captain Griffen
GetUnitLoc(gg_unit_hsor_0002)

As well as not nullifying.

I seem to remember that the crit message is created offset towards where the unit is facing. I'm not completely sure, but should be easy to check by looking.
Missed that one :) my bad.

Anyway, if its offset, just move it some to the left? It's offset on the hero too, but its less noticable since the hero is bigger.

The problem with floating texts is that they dont center, they write from the point they were created, the left side of the message will be in the center, not the middle of the text.
05-28-2006, 07:13 PM#14
StockBreak
Is my code leak corrected now (I have been using JASS only for 2/3 weeks)? Thanks.
05-28-2006, 08:32 PM#15
Captain Griffen
GetUnitLoc( u ) still there, and I believe you have to nullify 'u' as well, but I'm not 100% certain.