SC2Mapster Forums

Development > Triggers

Count characters in text variable?

  • 7 posts
    #1 Feb 01, 2013 at 00:20 UTC - 0 likes

    Is there any way to get as an integer, the number of characters in a piece of text?

    So for example, "Example" would be 7.

    #2 Feb 01, 2013 at 01:05 UTC - 0 likes
    Quote from rtschutter: Go

    Is there any way to get as an integer, the number of characters in a piece of text?

    So for example, "Example" would be 7.

    Unfortunately no... you can only count the length of a string, and I'm pretty sure you can't convert text to string.

    My Projects:
    Malum Ruina: SC2Mapster
    Eternal Exile: SC2Mapster
    Spine Crawler Madness: SC2Mapster
    Xeno Crisis: SC2Mapster

    #3 Feb 01, 2013 at 02:11 UTC - 0 likes

    That's unfortunate. Oh well.

    #4 Feb 04, 2013 at 14:49 UTC - 0 likes

    @rtschutter: Go

    What did you want to know for? I feel like this probably has something to do with centering text? If that's the case, you can make text center itself by creating a font style with center alignment, and using that font style.

    Last edited Feb 04, 2013 by MasterWrath

    Trigger, layout, interface specialist for Aeon of Storms.

    #5 Feb 04, 2013 at 15:13 UTC - 0 likes

    For his scrolling dialog. i should probably mention that players write in string so he can count that.

    #6 Feb 04, 2013 at 22:41 UTC - 0 likes

    Counting characters was for the player name of the player for the fake chat window I have created. If I was able to count the characters I could do something like this.

    rtschutter - hello world!

    But now instead I have to do this:

    rtschutter -

    hello world!

    This is because I do not know how many characters there are in a player's name to change the number of characters required in the chat entry before it creates a new line.

    Last edited Feb 04, 2013 by rtschutter
    #7 Mar 22, 2013 at 17:16 UTC - 0 likes

    im trying to do same thing

    if blizzard is trying to prevent blacklists then why do they have (get player handle) which returns that players unique player handle as a string ex. 1-S1-2345-34564, so you would save the blacklist and compare the 2 handles

    Last edited Mar 22, 2013 by xXdRaGoNrIdDeRXx
  • 7 posts

You must login to post a comment. Don't have an account? Register to get one!