What im trying to do is set a hunger level. I want it set up so that the hunger level slowly is reduced. say like it drops 1 every 10 secs. i had it going like...
mob
proc/hunger
var/mob/M
for(M in world)
M.hunger--
sleep(100)
M.hunger--
and so on but i want to know how that can be called without me having to do taht a thousand times.
ID:148905
![]() Aug 20 2002, 1:12 am
|
|
![]() Aug 20 2002, 1:15 am
|
|
Hey nadrew can you re check waht i originally wrote because i edited what i originally posted and im wondering how to call the hunger proc oveer and over without having to rewrite that again and again
|
Use the proc I gave you and you only have to call it once, and it will decrease the hunger proc every second until it reaches 0.
|
help me out on this one of them goes down and the other doesnt ... why?
mob Login() thirst(src) hunger(src) proc hunger() while(src.hunger) sleep(100) src.hunger-- if(src.hunger == 20) src << "You had better eat soon your getting hungery!" if(src.hunger == 10) src << "You had better eat your starving" if(src.hunger <= 0) src << "You have died from starvation!" src.hunger = src.fhunger src.loc = locate(1,1,1) hunger(src) thirst() while(src.thirst) sleep(100) src.thirst-- if(src.thirst == 20) src << "You had better drink soon you are getting thirsty!" if(src.thirst == 10) src << "You had better drink your dehydrating" if(src.thirst <= 0) src << "You have died from dehydration!" src.thirst = src.fthirst src.loc = locate(1,1,1) thirst(src) var hunger = 100 fhunger = 100 thirst = 100 fthirst = 100 |
Because you're really only calling one of the procs, you need to add ..() somewhere in your Login() proc to make it return the parent of the proc, or you can make them into one proc.
|