ID:268044
 
    Orange
icon_state="orange"
used(var/mob/M)
M<<"You have ate an Orange"
M.hunger+=10
if(M.hunger>100)
M.hunger=100

proc
hungerdrop()
sleep(10)
for(var/mob/M in world)
if(M.hunger==0)
M<<"You Die because of your hunger."
M.powerlevel=0
M.DeathCheck()
else
M.hunger-=1
if(M.hunger==0)
M<<"You are starving."
hungerdrop()


But the hungerdrop wont ever start up any help?
you could make it so it affects a single mob and turn it on at log-in and make it a mob/proc/hungerdrop().

Login()
src.hungerdrop()
..()

In response to EGUY
EGUY wrote:
you could make it so it affects a single mob and turn it on at log-in and make it a mob/proc/hungerdrop().

Login()
src.hungerdrop()
..()


that still does not work!
In response to Vash_616
proc
hungerdrop()
sleep(10)
for(var/mob/M in world)
if(M.hunger==0)
M<<"You Die because of your hunger."
M.powerlevel=0
M.DeathCheck()
else
M.hunger-=1
if(M.hunger==0)
M<<"You are starving."
spawn() hungerdrop()
world
New()
..()
spawn() hungerdrop()

You are using this as a global proc, and need to start it in world/New(). You also should spawn() off the new call so that the previous hungerdrops ends(), or it ends up looking like because each proc is waiting for the next one to be finished:

hungerdrop
hungerdrop<--called by first hungerdrop()
hungerdrop<--called by second hungerdrop()

This will keep going and going until the game eventually crashes. With spawn() it will call the proc, then move on (but because there is nothing else after it, the proc will have finished):

hungerdrop
hungerdrop<--spawned by first hungerdrop()
hungerdrop<--spawned by second hungerdrop()
In response to Nick231


proc
hungerdrop()
sleep(10)
for(var/mob/M in world)
if(M.hunger==0)
M<<"You Die because of your hunger."
M.powerlevel=0
M.DeathCheck()
else
M.hunger-=1
if(M.hunger==0)
M<<"You are starving."
hungerdrop()



world
New()
..()
spawn() hungerdrop()


It still isnt doing anything.
In response to Vash_616
You need to have spawn()hungerdrop() at the end of hungerdrop aswell. My guess as to why it isn't working is that you have world/New() overriden elsewhere in your code; change the following

world
New()
..()
spawn() hungerdrop()


to

world
New()
..()
world.name="Not a problem"
spawn() hungerdrop()


Compile and run the game, then look at the top of dreamseeker, if it says "Not a problem" then it is not the problem, you can delete the world.name="Not a problem". If it does not say "Not a problem" Go through your code for every other instance of world/New() and make sure that they each have ..() somewhere in them, if they do not, put it in.
In response to Nick231
that worked,thanks
In response to Vash_616
proc
hungerdrop()
spawn(400)
for(var/mob/M in world)
if(M.hunger==0)
M<<"You Are Starving..You Die from no food"
M.hp=-4
M.Deathcheck()
M.hunger=100
else
M.hunger-=1
if(M.hunger==0)
M<<"You are starving."
hungerdrop()



world
New()
..()
spawn() hungerdrop()



but it never calls the deathcheck proc and the person does not die it just spams ds
In response to Vash_616
That's a very poor way to loop a proc. I'd suggest making it an individual mob proc. Then, instead of spawn() hungerdrop() make a while() loop and set a timer of sleep(400). It'll reduce lag greatly, and it'll do more to what you want.
mob
proc
hungerdrop()
while(src.hunger>=1)
src.hunger-=4
sleep(400)
spawn(1)
src.Deathcheck()
spawn(5)
src.hungerdrop()
if(!src.hunger)
src<<"You die from no food."