I want to customize the system messages with some colour, but if the user enters any particular syntax symbols, it glitches out the colour coding part. For example, you can have a simple game with just the following:
Now if I enter a word that isn’t recognized ( asdf ), I get a proper error message with: (?) Unknown verb - asdf
…and the text is coloured how I want it to be.
However, if I enter a command with < or [ characters ( <asdf] ), I get a message that looks like: <(?) Unknown verb -<#da2>> <asdf]
I tried using dynamic strings, but any inclusion of certain characters glitches out the colour code. Is there something I’m missing or do I need to strip out those characters manually myself from all inputted commands somehow?
Do I need to submit this as a bug on the Adventuron Issue Tracker?
The issue (I guess, knowing nothing about Adventuron) is that < is used by HTML to indicate the start of a tag. You need to replace it with <. I do not know how to do that, but perhaps that is enough for you to work it out? You should also replace " with ".
I don’t think that will work with Adventuron as the souce code is compiled before it gets to html. The compiled code is just a mass of binary data (or maybe JSON data, who knows?), somewhat like z-code. You can’t identify any html within the game itself.
It is the incoming command string you need to handle, if I understand this right?
If you can get to the string before it gets printed to screen and do the substitution of < for < it may sort it.
That said, a very quick look at the docs does not indicate any way to access the string. If that is the case, submit to the issue tracker as Hal9000 said.
I appreciate the suggestion and your logic is sound. You even looked into the documentation on a program that you don’t even use! Thank you!
I still think there might be a way to intercept either the error output and strip out the bad characters (using a subroutine perhaps?) or intercept the command to strip out the “illegal” characters (they will never be needed anyway) before a command is processed.
I saw something called set_sentence that might produce some fruit in the on_command { } event handler. I’m stubborn.
However, I will still submit a bug report over the weekend because it should work either way, I feel.
That’s generally true. There is more activity on Discord. That’s why the Adventuron activity has become quiet here. It’s not that nobody is using Adventuron any more, it’s just that they chat and ask questions in a different place. The disadvantage of that is that it’s a social media platform, not a forum, so it’s here today, gone tomorrow.
I had wondered about that. It soon became evident when I saw the time stamps and the number of responses happening. To Chris’ defense, he does have the Discord link prominent on the main page and available in the right-click menu in the editor.