Toggle navigation
Play
Create
Forums
Help!
Register
Log in
Forums
Squiffy
{if attribute1=attribute2:The two attributes match.}
{if attribute1=attribute2:The two attributes match.}
Jump to last post
IFforClassroom
06 Dec 2015 02:28
Does anyone know how to use an attribute on the right side of an IF statement? For example, the player sets a password and uses it later:
@title How to create a password?
Before visiting the ATM, please set your [passcode].
[ATM]
[passcode]:
squiffy.set("setpasscode", prompt("Set your passcode:”));
[ATM]:
squiffy.set("typepasscode", prompt("Type your passcode:"));
{if setpasscode={typepasscode}:You may now make a withdrawal.}
Thanks.
IFforClassroom
25 Jan 2016 12:22
That's what I get for trying to use Squiffy instead of learning to code.
[[Start]]
[[Start]]:
[Set your PIN]
[Enter your PIN]
[[Withdraw]]
[Set your PIN]:
squiffy.set("PIN", prompt("Please set your PIN number.",""));
Your PIN Number is {PIN}.
[Enter your PIN]:
squiffy.set("ENTERPIN", prompt("Please enter your PIN number.",""));
You have entered {ENTERPIN}.
[[Withdraw]]:
var ENTERPIN = squiffy.get("ENTERPIN")
var PIN = squiffy.get("PIN")
if(PIN == ENTERPIN){
squiffy.story.go ("Match");
}
else{
squiffy.story.go ("Nomatch");
}
[[Match]]:
Your PIN is correct. You are now free to make a withdrawal. [Restart](Start)
[[Nomatch]]:
We are sorry. Your PIN is incorrect. Please wait while we ignite the explosives planted beneath you.
Back to top
This topic is now closed.
Topics are closed after 180 days of inactivity.
Forums
Squiffy
{if attribute1=attribute2:The two attributes match.}
Products
Quest
Squiffy
ActiveLit
Resources
Documentation
Blog
GitHub
Support
Forums
An error has ocurred.
Close