In response to Flying1ace
ok, that didn't work to well. I got the code done but the Drink action wont show up in command box in-game.

Oh I see what you are coding. Yeah, I already have bottle'o'water in game, its just i'm not sure how to subtract thirst from player. And have it stop at 0
Drink action wont show up

Under the verb, put "set src in usr", this says only give my verb to whoever I am in.

i'm not sure how to subtract thirst from player. And have it stop at 0

An easy way to 'snap' between a range is to use the max/min procedures. You can run the code below after changing the value and it will always stop between 0 and 100.

var/max_value = 100
var/min_value = 0
var/current_value = 150

current_value = min(max(current_value,min_value),max_value)
yes i understand that, but I don't get how to add or remove thirst from teh player. is the code usr.Thirst-=100?
Pretty much, yeah. Make sure you're using src if it is better suited.
But its not working.
This doesn't really help but I made my own dynamic Food system in my computer that does all of this xD.

Unfortunately I can't just paste it as I have no internet on my pc atm, which should be getting fixed later on today(Getting a USB network adapter for my desktop which doesn't take wireless..)

Anyways, I'll post it as soon as that gets fixed.Should be of help, it's a really flexible system that adds the Energy Amount each food/Drink is set up to give every second until you are full/no longer thirsty.

It works like the following:
obj/Drinks
Water
icon='Water_bottle.dmi'
Energy = 10
Juice
icon='Juice.dmi'
Energy = 15
cool!
All I really want is to know how to get a bottle to add thirst var for the player.
Give your bottle a verb that adds to the thirst variable.
Shouldn't be all too difficult, and if it is, there's quite some tutorials out there.
HOW?!?!?!?!?!?!?!
lol sorry.
bottle/verb/Drink()
set src in usr
usr.Thirst += 10
Wow. I see, I mustn't have been putting the space between Thirst and + lol. Thanks
Nope STILL not working. Do I have to define usr as a world charictor or something??!?!?!?!!?!
I have this in my code, does it mean anything?:
world
mob = /mob/Player
You need to typecast to access a non-mob variable on usr.

bottle/verb/Drink()
set src in usr
var/mob/Player/P = usr //this tells the compiler that P is a /mob/Player
P.Thirst += 10
wow. ok thanks
Page: 1 2