| 07-14-2004, 04:00 AM | #1 |
Hey guys, Im wondering if theres a way to create floating text to follow a unit. Well I know there is, it is a question of how. It is supposed to be modeled after DoBRP's hero command which when typed as such will create floating text above the unit and follow it around. Example: hero bob would make a unit have the text: bob float around over his head no matter where he went ;) So far I have this: Events: Player - Player 1 (Red) types a chat message containing hero as A substring Conditions: Substring (Entered Chat Message) 1,4 = "hero" Actions: Unit Group - Pick every unit in (Units currently selected by (Triggering player)) and do (Actions) Loop - Actions Floating Text - Create floating text that reads (|cffFF0000 + (Substring((Entered chat string), 6, 20))) above (Picked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency Please help, I am not the best with variables, so any help is appreciated. |
| 07-14-2004, 02:44 PM | #2 |
The only way to do ths is to constantly destroy and recreate the floating text. It causes lag, tends to leak locations if you're not careful and is typically more pain than it's worth. Floating text on units was the MAIN contributor to the lag that killed Sentry III's Battleship Command. |
| 07-14-2004, 06:04 PM | #3 |
Thankyou for telling me! |
| 07-16-2004, 07:07 AM | #4 |
couldn't u just move the floating text, having less lag |
| 07-16-2004, 07:15 AM | #5 |
Unfortunately, moving the text is difficult, since you'd have to completely stop it and give it a new velocity every time the unit under it moved, which is a tricky and imprecise science. Also, I believe the floating text might exist on a flat plane above the modelled area of the map, so if the user changes camera angles, it might go way off where the unit is. Isn't it a little silly that Blizzard made two functions, one to attach the text to a location and the other to attach it to a unit, but effectively the unit-function only attaches it to the location of the unit? Silly Blizzard. |
| 07-16-2004, 01:18 PM | #6 |
They made it for silly people, which is basically understandable :) Hell I still use GUI because its simpler and theres really no compelling need to be a code nazi since I do rather small one-off projects :) |
