ID:179674
 
is it possible, and how would I make a dispenser to give out a item once a day. For example, Bob needs a battery to use his Thermo-Nuclear-Zio-Cannon. He walks up to a battery dispenser but it wont give him one because he already got one to use his flashlight. how would I make it so that would happen (forgetting bob and his cannon and flashlight) along with allowing him toget another the next day. also is there a way to make it so when you log out and come back on you keep all your items? I would use the character saving library but my game actually doesnt need that.
Geo wrote:
is it possible, and how would I make a dispenser to give out a item once a day.

so once he gets a battery he has to wait 24 hours to get another? I suggest using a var or sleep.

also is there a way to make it so when you log out and >come back on you keep all your items?

yes write a savefile like S<<usr.contents
In response to Air _King
It would be better giving S a name also

S["name"]<<src.things_saved
In response to Air _King
so once he gets a battery he has to wait 24 hours to get another? I suggest using a var or sleep.

Yes but the problem is, it goes by 1/10 of a second, and It's going to be rather hard to figure out how many 1/10 of a second are in a day for me.

yes write a savefile like S<<usr.contents

problem #2, I never took the newbies or advanced course of saving :)
In response to Geo
Geo wrote:
so once he gets a battery he has to wait 24 hours to get another? I suggest using a var or sleep.

Yes but the problem is, it goes by 1/10 of a second, and It's going to be rather hard to figure out how many 1/10 of a second are in a day for me.

no 10 ticks = 1 sec 600 ticks= 60 sec = 1 min 600*60= 36000 ticks in one hour 36000*24=864000 ticks in 24 hours.
In response to Air _King
.... thanks! Now to figure out saving inventory.
In response to Geo
Geo wrote:
.... thanks! Now to figure out saving inventory.

here:
mob/verb/save()
var/savefile/S = new(usr.name)
Write(S)
mob/Login()
var/savefile/S = new(usr.name)
Read(S)
return ..()

In response to Air _King
1000 thank yous
In response to Geo
Geo wrote:
1000 thank yous

1000 your welcomes