An item that has only a limited number of uses?

RavynCrescent
Basically, this character has a flashlight, with 2 batteries. Every time she uses it to kill something, it drains a battery.

So, each battery has 1 use, and each flashlight can be used twice before having to seek out more batteries.

How do we do this? Sorry, I'm new here and have high hopes for the game my friend and I are making.

No replies? :( Is this not possible to do? We played a game, Things That Go Bump In The Night (http://www.textadventures.co.uk/review.php?game=346), that had a fire extinguisher that had only so many uses.

Is need-be, we could break the flashlight after 2 uses, so they have to find a new one, if that is easier?

Alex
You can use a numeric variable. Every time the object is used, check the value of the variable - if it's less than 2, increment the value of the variable and do whatever happens when you use the object. In the "else" part of your "if", print a message like "The batteries have run out".

sherlock
How do oyu make a Numeric Variable?? Do you just right a new one in the numeric variable box?

Alex
You create a numeric variable by just setting its value in a script. So in the "Set a numeric variable" command, if you enter a new variable name, that's all you need to do to create it.

RavynCrescent
thanks, Alex :)

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

Support

Forums