Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / Checking for quotes with the mid command

Author
Message
Laughing Coyote Software
5
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 19th Mar 2022 21:59
Hello, I'm working on a way to make the player sound more stupid with low Education for Warlordocracy (Link: https://store.steampowered.com/app/1748160/Warlordocracy/)

I want a function to parse a string and find each word, then replace some of them or remove some of them (change all "I" to "me", remove to-be verbs, etc.). That way, "I want to buy some beer" would be converted into "Me want buy some beer." Unfortunately, I use quotations in the TXT dialogue scripts to denote dialogue, so I need to be able to use the mid command to detect quotes (as well as spaces, periods, etc.). Unfortunately, it doesn't seem that you can detect quotes, because it would be if stringMid$ = """. That would give an error. Any way around this? Thanks.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 19th Mar 2022 23:54 Edited at: 20th Mar 2022 00:08
for MID() usage, you could:
...where CHR(34) = " (quotation mark) - see the ascii chart for more.

similar is valid for delimiters if using tokens to parse a string:

ie, LEN(Delims$) = 6 (note the " " (space) included as a delimiter above)
Laughing Coyote Software
5
Years of Service
User Offline
Joined: 30th Jun 2018
Playing: Pillars of Eternity 2
Posted: 20th Mar 2022 01:10
Sweet! Thank you.

Login to post a reply

Server time is: 2024-04-25 05:49:43
Your offset time is: 2024-04-25 05:49:43