Popup Command Erorr Mesage [SOLVED]

Hello,

I want to use popups as a glossary entries, to explain meaning of the word that has been used and may not make sense to the player. I used the {popup:text:long text} command but it always shows this error message when running the game:

Error running script: Error compiling expression 'JSSafe(s1) + GetRandomInt(0, 999999999)': FunctionCallElement: Could find not function 'JSSafe(String)'

I have found one old thread regarding this, (https://textadventures.co.uk/forum/quest/topic/vjhlospayegd530pdbkknw/collapsibles-in-gamebook-mode) but it makes no sense to me.

Anyone can help, please?


I assume you're using gamebook mode? There's a function in the Text Adventure library which is needed for popups.

There's a bunch of discussion in that thread about other questionable design choices in the way popup works; but you don't need to worry about that. Just follow the first instruction and it should work fine.

Create a function with the name JSSafe, parameter s, and type string.
For its script, in code view put:

    s = Replace(s, "\"", "")
    s = Replace(s, "\'", "")
    s = Replace(s, " ", "")
    s = Replace(s, ".", "")
    s = Replace(s, ",", "")
    s = Replace(s, "!", "")
    s = Replace(s, "?", "")
    s = Replace(s, "-", "")
    s = Replace(s, "/", "")
    s = Replace(s, "(", "")
    s = Replace(s, ")", "")
    s = Replace(s, "$", "")
    s = Replace(s, "%", "")
    s = Replace(s, "&", "")
    s = Replace(s, "*", "")
    s = Replace(s, "@", "")
    return (s)

I do use Gamebook mode, but there is no Text Adventure Library button, no option to create function, etc. All this makes no sense to me.

Or is this function available only for text adventures?


I do use Gamebook mode, but there is no Text Adventure Library button

No, there won't be. The text adventure library is all the stuff that comes built in when you create a text adventure.

That's why you need to add the function manually.

no option to create function

Click on "Functions" in the sidebar.

Then click "Add".

If it's not there, you might have it disabled. I'm not sure if that can happen; but someone can probably tell you how to get it back.


Alright, it took me couple of minutes, but I have found it!

I had to get out of Simple mode to get the Functions and stuff being shown and properly working.

My Quest looks differently though, but close enough to follow the instructions.

Thank you very much for the help! :)


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums