• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] character limit

Status
Not open for further replies.

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
My question is simple. Is there some kind of limit on how many characters a string variable can have? Basically I got a huge string that I want to display with floating text. However it breaks 278 characters and 50 words.

edit: made another string, it breaks at 46 words and 263 characters. Does it have to do with the number of allowed 'rows' or something?
 
Level 10
Joined
Feb 22, 2008
Messages
619
According to the Jass page on Wikipedia, string variables have a limit closer to 1k-2k. I could only find one other thread related to floating text limit, but someone had a problem with it stopping at around 100 characters. Is the variable breaking down, or is it your floating text? Maybe there's some other way you could check if the variable is intact, to see if the problem resides in the floating text and not the variable.
 
Level 10
Joined
Feb 22, 2008
Messages
619
Do something like this:
  • Floating Text - Create floating text that reads 0 at (Center of (Entire map)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
  • Floating Text - Change the lifespan of (Last created floating text) to 0.00 seconds
  • Floating Text - Change text of (Last created floating text) to (really long) using font size 10.00
Change "(really long)" to your long string, and the character limit should be removed. (It's setting the lifespan to 0 that allows for this).

(I'm sure you know to clean up leaks and all)
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
That is what I am doing. But it just ends randomly.
JASS:
		call SetTextTagText(this.tag, SubString(this.text,0,this.counter), TextTagSize2Height(12))
		call SetTextTagPos(this.tag, GetRectCenterX(gg_rct_Start), GetRectCenterY(gg_rct_Start), 0)
		call SetTextTagColor(this.tag, 255,255,255, 255)

edit: The substring is not the issue, it doesn't work even if I set 0-999, it still only displays 90% of the string.
 
Last edited:
Level 23
Joined
Apr 16, 2012
Messages
4,041
this is not problem with string, check http://www.hiveworkshop.com/forums/lab-715/documentation-string-type-240473/ to see more, mainly my find on strings.

This is most likely problem with texttag, where it tries to fit the text into some predefined box and it just is too long so it either cuts the string off, or it doesnt render the remaining, because only so much of the real text tag is rendered and the rest is abandoned
 
Status
Not open for further replies.
Top