Non-threaded

Forums » Writing Workshop » Read Thread

Find proofreaders here, useful resources, and share opinions and advice on story crafting.

Scripting

10 years ago

  Hey guys, I'm working on an update for my 1960's quiz game and I need a little help with scripting. Basically I have a variable that can either be 1 or 0 and I want it to, on the last page, list whether the question was answered correctly or incorrectly. EX:

  Q1RW=0

  You got question 1 wrong.

  Q1RW=1

  You got question 1 right.

  This is a very simple script, I know, but I don't really know the language on here yet.

 

Scripting

10 years ago
%%Q1RW%=%1%You got question 1 right.%%%%Q1RW%=%0%You got question 1 wrong.%%

You put this on the page itself, and the script will be replaced by the result. Let me know if you need me to explain how the script works or if you can understand it.

Scripting

10 years ago

@Killa_Robot (does this tag thing even work? I have no idea. Nobody tags me.)

  I understand what it's doing, but I think it's odd that there is no IF statement going on here... It's just two strings right on top of each other.

  Thanks, though.

Scripting

10 years ago

It's essentially an IF statement shorthand.

Scripting

10 years ago
The tag does work (I just got it).

@skillfulljack

It's there, like Bradin points out.

%%Q1RW%=%1%You got question 1 right.%%

Means: IF Q1RW = 1 THEN You got question 1 right.

The syntax just looks different.

Scripting

10 years ago

 Alright. The scripting is very odd here. The first thing I learned (besides DOS) was the CoG script, so you can probably see why I was confused.