Function not parsing parameter properly?

I'm attempting to feed a parameter into a script to move the player to a specified room.

Essentially, load(next) will perform a little timer thing for aesthetic reasons and then move the player to whichever room takes the place of next. However, I am getting an error. Below are screenshots. I also have a rudimentary knowledge of the language behind Quest's interface and can understand any help given via code. :)






maybe try:

move object [OBJECT] [player] to [EXPRESSION] next.name

otherwise... make sure for your two 'nexts', you don't accidentally have a space character in front or after it... these are the worst typos or copy and paste mistakes... so hard to spot/realize you got an accidental space character... !!!!


or, maybe you want to rename your Function, as 'load' is probably the built-in name of something for the loading of a game, and it might be causing issues


or, you can try not having a space for your Page names, as while quest is programmed to handle spaces well... outside of quest, is not so much, so it's a good habit to get into, in not having spaces in your names (having a space in your 'alias' String Attribute is fine, but the 'name' String Attribute is special because it acts as the 'ID' for quest)


I think this is because the inner script of After x seconds command is kind of running on its own, outside the context of the function, and so has no access to the parameters sent to it.

To test this, add a print statement right at the start of the function, and have it print the value of next. I think you will find that next does indeed have a value at that point.

What you would need o do is set an attribute of the game object to the value of next before the timer, and inside the time block, use that instead of next. Does that make sense? I could do the code, if it helps.


Thanks for the help, HK! Sadly, it didn't quite work.

I was actually about to explain that it works when unnested from the timeout script before I saw your post, Pixie. :P That's a clever idea and I can definitely do it myself. :)

EDIT: Success! Thank you both very much!

Side note: Is it at all possible to use milliseconds instead of seconds for a timer interval or timeout script? Quest can handle them in the typing/unscramble scripts :/


Have you tried writing it as a decimal? I would guess it will not work, but it is probably your best shot.

Most people play games on line, and there is a significant lag, so a delay of 50 ms may turn out to be a second anyway. If you want split second timing, you would need to do that locally, which means doing it in JavaScript, which is what the unscramble does behind the scenes.

It is not simple, but is doable. These threads might help get you started:
http://textadventures.co.uk/forum/samples/topic/gz1msne3k0_mjvoj8vpubw/countdown
http://textadventures.co.uk/forum/samples/topic/adupwc_plesslkxkrotnfa/revised-lightning-effect


What was the fix/problem? How did you get it to work?


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

Support

Forums