Food and Drink

example.How do I count the amount of whiskeys drunk ,then print a message to say "that's enough".
same with chocolates etc


Are you using Quest?


Yes .i want to keep track of how many whiskeys.When reaching "x " amount text should read something like "your'e too drunk to continue ,take a rest" or "the bottle is empty"


This is for the web version of Quest. The desktop/computer version is similar, but you can change it.

Putting a variable as "x" does not work unless it's a stringlist or dictionary or something like that. Don't ask me why.

Here's the code.

Put this in the game -> script -> start script

game.x = 4

Put this anywhere there is code. The room description is the simplest, but I'm lazy.

if (game.x > 4) {
  msg ("You're too drunk to continue, take a rest.")
}
else if (game.x > 2 and game.x < 5) {
  msg ("You have enough.")
}
else if (game.x = 2) {
  msg ("There is half of it left.")
}
else if (game.x = 1) {
  msg ("There is a little bit of it left.")
}
else {
  msg ("The bottle is empty.")
}

These are some pictures I took. These should show how I did it.

https://imgur.com/g0MGCuF
https://imgur.com/LKvAyxQ
https://imgur.com/uqWmrzE
https://imgur.com/mteNpyA


Thanks for sharing this knowledgeable info.


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

Support

Forums