An item that has only a limited number of uses?

For help with creating games using Quest

Moderators: Pertex, Alex, sgreig, Cryophile

An item that has only a limited number of uses?

Postby RavynCrescent » Thu Feb 10, 2011 7:33 pm

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?
RavynCrescent
 
Posts: 5
Joined: Thu Feb 10, 2011 6:38 pm
Location: Arizona

Re: An item that has only a limited number of uses?

Postby Alex » Fri Feb 11, 2011 8:10 pm

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".
User avatar
Alex
Site Admin
 
Posts: 2077
Joined: Fri Jun 27, 2003 11:06 pm
Location: London, UK

Re: An item that has only a limited number of uses?

Postby sherlock » Fri Feb 11, 2011 9:04 pm

How do oyu make a Numeric Variable?? Do you just right a new one in the numeric variable box?
User avatar
sherlock
 
Posts: 50
Joined: Thu Feb 03, 2011 10:14 pm

Re: An item that has only a limited number of uses?

Postby Alex » Fri Feb 11, 2011 9:36 pm

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.
User avatar
Alex
Site Admin
 
Posts: 2077
Joined: Fri Jun 27, 2003 11:06 pm
Location: London, UK

Re: An item that has only a limited number of uses?

Postby RavynCrescent » Mon Feb 14, 2011 12:42 am

thanks, Alex :)
RavynCrescent
 
Posts: 5
Joined: Thu Feb 10, 2011 6:38 pm
Location: Arizona


Return to Quest Forum

Who is online

Users browsing this forum: Bing [Bot] and 2 guests