The error wasn't caused by your code at all, it was a whole different problem that's now resolved.
But while testing this I encountered another error, when enabling "Treat uninitialized variables as value 0",
an error related to the following code in the "Draw" action of the NPC object, shows up about this code:
if answer[num,0] != "" then
Saying it cannot compare arguments here. Can you try enabling "Treat uninitialized variables as value 0" yourself and see if there's a way to fix that, I tried already using similar code but it didn't work well, I guess I still don't exactly know your code. Maybe you can help?
This could be really useful to me if we manage to make it working with the "Treat uninitialized variables as value 0" enabled...
I'm not sure what was causing the error but I've found a way to fix it.
In the draw event of the dialog replace this part:
repeat(global.max_answers)
{
if answer[num,0]!="" then
with this:
repeat(global.max_answers)
{
if is_string(answer[num,0])
if answer[num,0]!="" then
Basically the difference is that it will check if the answer[num,0] is a string. (Since for a reason when you enable "Treat uninitialized variables as value 0"
an answer has the value of 0.