WatchNon-threaded

Forums » Advanced Editor Forum » Read Message

Talk about it. Ask for help on it. Compliment it.

Running into problems scripting a puzzle

23 days ago

This is a bit complicated, so I'll try my best to explain.  At one point in my current storygame, the player is given a puzzle box they're supposed to open in order to progress.  It has six buttons which each have to be pushed a certain number of times.  The catch is, each button can only be pressed after certain other buttons have been pressed, (unless it's the first one to be pressed).  For example, button A can only be pressed right after button B or C has been pressed, or else the puzzle resets.  I've been using variables to track how many times each button has been pressed, but for some reason they're not working.  They just sit there at zero, no matter what link is pressed.  

As if that wasn't enough, when I try to put the box away it just gives an error message.  (It uses a LASTPAGEID variable and sets the DEST to it when the back link is pressed).

Any suggestions?  If need be I can paste the scripting into this post, but I'd rather not if I can avoid it.  (There's a lot of it).

Running into problems scripting a puzzle

23 days ago
So first question: What is actually deciding what buttons can show? I'd assume it's variable restrictions on the link, but you haven't said. And how do you tell the variable a button has been pressed?

You'd have to tell us what the actual error message is for us to be able to help you with the second part.

Running into problems scripting a puzzle

23 days ago

The variable is only supposed to be restricted if the button has been pressed the required amount of times, but if the wrong one is pressed, the puzzle should reset.  I just set the link to add one to the variable each time it is pressed, then used conditional statements in the scripting to tell it to reset if certain buttons hadn't been pressed before.  Now that I'm putting it in writing I realize it might just be a problem with the fact that I'm not scripting the whole thing.  Before I go test that, do you know if that might be a problem?  

As for the error, it says "object reference not set to an instance of an object." 

Running into problems scripting a puzzle

23 days ago
Are you adding the @ when you set the DEST variable? You can't just set it to the value of the lastpageid.

You can use variable restrictions to control if the buttons appear and scripting to control their value just fine. For troubleshooting I'd recommending showing the values on the page right now to make sure the basic logic (like increasing a variable if a button is pressed) is working at all.

Running into problems scripting a puzzle

23 days ago

Where would I put the @ in that script?

Running into problems scripting a puzzle

23 days ago
I'll take as a no then.

Use @P in front of the page number.

http://chooseyourstory.com/help/articles/article.aspx?ArticleId=48

Can't help with much else without more specifics, you can tell us you're taking things with variables but someone will need to see the actual script to figure out what's wrong.

Running into problems scripting a puzzle

22 days ago

The link script looks something like this:

$DEST := %LASTPAGEID

I tried putting the @P in front of the variable, but that didn't work.  Sorry I couldn't explain it a bit better, it's hard to articulate. 

Running into problems scripting a puzzle

22 days ago
The link I posted has an example of what it needs to look like.

Running into problems scripting a puzzle

22 days ago

...

Oops, sorry.  I'm a total idiot.  i put it as  $DEST := @P%LASTPAGEID.  Thanks for all the help!

Next time I should actually re-read the article instead of relying on memory, lol

Running into problems scripting a puzzle

22 days ago
I mean, we just told you that way doesn't work. Saying "that didn't work" to our solution is wrong, as we already know it works. Show us what you actually did so we can tell you why it didn't work.