Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.


Discussion in 'Requests' started by ANdROnIQ, Jul 19, 2009.

  1. ANdROnIQ


    Jul 24, 2007

    I need a function that retrieves string data from the wts file (you know, "TRIGSTR_####"). I used this one:

    Code (vJASS):
    function Sweep takes integer i returns string
        call SetPlayerName(Player(12), "TRIGSTR_"+I2S(i))
        return GetPlayerName(Player(12))

    (supposed i>99) but it fails on long strings. The "TRIGSTR_####" string must contact with user interface to turn into its wts data - be displayed or set into such place where user can see it. QuestSetTitle, LeaderboardSetLabel etc. Tried to set/get leaderboard and multiboard titles, but they also fail. If I could get quest description, or what... Maybe I can use something like GetObjectName or GetLocalizedString in some special way? And, saving into gamecache also didn't work... Help please.

    EDIT: Sorry. This function actually works for all strings. The problem was the way I modified the .wts file, so I'll tell how to do it properly to avoid wasting time by other dudes like me.

    So, to add a string to your wts file, you do the following.
    1. In WE, File > Export text and save it as wts file.
    2. Open this file with a text editor (notepad, wordPad, word or whatever you like).
    3. The file consists of such data:
    Code (Text):
    STRING 1234
    Scroll to the end of file and add a string to it, with the number equal to number of last found string + 1. Save the file.
    4. In WE, File > Import text and select your modified file.
    5. IMPORTANT! If you save your map just now, the added string may disappear because you didn't use it anywhere. So, add somewhere a commented text like this:
    Code (vJASS):
     // TRIGSTR_1235

    where 1235 is the number of added string.

    My function Sweep allows me to avoid typing "TRIGSTR_####" in the map script, so WE doesn't know whether I use the triggerstring of a certain number.
    Last edited: Jul 19, 2009