HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Local Floating Text

07-19-2006, 07:40 AM#1
Pheonix-IV
I'm doing some triggering for an RP map, one of the things RP maps use is a 'setname' system, this allows you to set a bunch of custom names and then talk with them, using Game Text as a method of showing the whole talkingness.

However, using game text like this causes memory leaks, not much, but over time the leaks can build up like mad since often there will be well over a thousand strings per game. I'm looking for a way to fix this, and since it appears there is no way to stop strings leaking, i decided on using floating text instead.

The concept behind it is to create floating text in the correct location corresponding to the location of the players current screen, then move the floating text around to follow the players screen around and move up when the next lot of text comes through. It should work fine, but the problem i thought of is with multiple players that you can see each players text, so if a players view floats across yours, you'd see the text float across.

So, i'm asking a pair of questions:
1: Is there another way to display text without causing leaks
2: If not, can i make Floating Text local to each player, so that a player can only see the text meant for him?

--EDIT--

And try not to throw big lumps of JASS at me, it doesn't help (me at any rate)
07-19-2006, 07:47 AM#2
Captain Griffen
Floating text will in now way fix the problem, as it will still be using strings, and so still generating them.
07-19-2006, 08:17 AM#3
PipeDream
This is where it would help to learn JASS-the abstraction has fooled you into thinking that floating text does not incur string leaks.
---
One thousand strings is no problem. If tight timer loops become problematic late game, convert them from game cache to dynamic array.
Alternatively, if you were really masochistic, you could use one floating text per character.
07-19-2006, 09:03 AM#4
Captain Griffen
Quote:
Alternatively, if you were really masochistic, you could use one floating text per character.

And how do you get each string? Oh, yes, you have to use a substring of...the string itself. So it would actually create more strings, for a hell of a lot of complication.
07-19-2006, 09:06 AM#5
PipeDream
Presumably he has a subset of strings that the bigger ones are built out of.
07-19-2006, 10:23 AM#6
Pheonix-IV
Hmm, never considered that, annoying. I thought strings only leaked when you displayed them as game text because you can't 'null' or remove the text once it's up.

Vexing, i guess i'll just have to hope that the string stuff won't cause any noticable lag, which it probably wont, but annoying none the less.
07-19-2006, 02:35 PM#7
The)TideHunter(
Strings give a VERY minor leak, once.
If you dont have a ton of strings, and i mean a ton, then you wont even get a MS lag.

Theirs nothing you can do about it anyway, if you want text to display, 1 string must be leaked atleast.

Really, if you do make the texttag's, with alot of text, ou will not see any difference in quality whatsoever.