Needing help with javascript popup window

I'm sorry if my explanation is kinda vague, but here we go
So in my game, I want to ask the players if they want to "skip the introduction" or not, similar to that in one of the Quest games I played on the other day. And to do that, I'm trying to make a javascript popup window, a JS.confirm() window, to be precise.

However, I'm having difficulties in getting the input from the popup window (the true/false result). I've tried using variables and used GetInput function but it failed.

I think there is a similar post to this, but I find out that it uses an ask function if I'm not mistaken. But I feel like the code itself is going to be a tough one to type, and I don't really want to use much of the space in the Quest game screen itself because I worry that the screen will get pretty overcrowded with words which is kinda annoying.

I'm sorry for being overly persistent


You can't directly pass the value from a javascript function back to Quest. You need to make a javascript function which calls a Quest function to get your result back.

The reason for this is that Quest generates a bundle of text and javascript, and sends them all to the player's browser in a single bundle. once all Quest scripts have finished. This means that the script that generated the question is no longer alive to return an answer to it.

I'd suggest something like:

JS.eval ("ASLEvent(confirm('Would you like to skip the intro?')?'SkipIntro':'ShowIntro')")

This will call a Quest function named 'SkipIntro' or 'ShowIntro' depending on which option is chosen.


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

Support

Forums