Finding and Removing Text

For questions about using Classic.

Post » Wed Dec 16, 2009 12:31 am

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 find expression to locate these tags. After changing the colour and speaker on the second text object, I use remove 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 here.

Thanks in advance! :)
Posts: 2
Reputation: 829

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests