Finding and Removing Text

This forum is currently in read-only mode.
From the Asset Store
Change delay, create new lines, "backspace" the text
  • Hey all,

    I'm currently trying to put together a simple dialogue engine. Text is read in from an .ini file and written to the screen, which is fairly simple. But I also wanted to alter another text object that would change its string to the name of the current speaker and colour that text appropriately. So I added a "tag" to each line which could be read to get those values and then discarded. Like this (in the .ini):

    0=<bob>Hello world, from Bob!
    1=<sue>Hello again, from Sue![/code:bl5lnuti]
    
    After reading a line from the ini, I load that line into a variable and then use the [i]find [/i] expression to locate these tags. After changing the colour and speaker on the second text object, I use [i]remove[/i] to take away those tags and print to the main text object.
    
    This doesn't seem to exactly work! It looks like it is at first, but the character name is not consistently changed (try adding some more lines in the .ini, if you want). So I'm not sure if I'm misunderstanding how the find expression works or what. The tags seem to be removed correctly though. (It would also be nice to get the lines from the .ini to load immediately, so there's no need for the default "Text" string that appears when the cap first starts.)
    
    What I have so far (.cap and .ini) can be downloaded [url=http://dl.dropbox.com/u/557718/findremove.zip]here.[/url]
    
    Thanks in advance!
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)