| 05-26-2006, 08:05 PM | #1 |
Hi all, normally I use a floating text function such as: 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 |
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 |
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 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 |
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 | |
Quote:
|
| 05-27-2006, 12:40 PM | #7 | ||
Quote:
Quote:
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 | |
Quote:
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 |
| 05-27-2006, 01:23 PM | #10 |
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 |
Thanks for the idea, but I tried it and it gives the same results... |
| 05-27-2006, 02:52 PM | #12 |
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 | |
Quote:
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 |
Is my code leak corrected now (I have been using JASS only for 2/3 weeks)? Thanks. |
| 05-28-2006, 08:32 PM | #15 |
GetUnitLoc( u ) still there, and I believe you have to nullify 'u' as well, but I'm not 100% certain. |
