Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Quiz makin'

12 years ago
I just went back to school and got into an educational mood, and noticed that there aren't many educational storygames, so I figured it would be neat and helpful to make a simple quiz storygame to help the schoolchildrens memorize some of the elements of the periodic table. I want it to present questions in a random order, but that keeps trippin' me up. And I know it's probably easier to refer to the chapter ID that contains the questions rather than putting in a short equation, but I guess I'll put that in later...maybe.

All of the four question links have the default link location of 'Game Over!', for when you've answered 25 questions, correctly or not. I have this in the global link script:

IF $PAGEID = "@P" + (1D2 + 3) THEN BEGIN
%TURN := %TURN + 1
IF %TURN < 25 THEN $DEST := "@P" + (1D2 + 3)
END

Clicking on correct answer links just adds one point to the score, which doesn't affect anything at this point, and other added variables haven't been reused yet, so I'm pretty incredibly sure the problem's in this part somewhere.

Quiz makin'

12 years ago

Pretty sure the comparison doesn't work with the @P there. It only can compare numbers.

Not sure why  you have the "@P" + (1D2 + 3) part anyways. It's a static comparison, so you're always checking if the page ID is either 4 or 5, and doing nothing else with it.

Quiz makin'

12 years ago

Yeah, you need to take "@P" out and just have:

IF $PAGEID = (1D2 + 3) THEN BEGIN

(you do need @P for $DEST := statements though)

Quiz makin'

12 years ago
Thanks, y'all two. Now it's totally fixed! The only problem is...there's only two questions, so it's not very informative. Oh well. See you later, sometime.