mob
New()
while(1)
spawn
Hunger()
return ..()
mob
proc
Hunger()
if(src.Hunger == 1)
src.Hunger = 1
sleep(360000)
src << "You're getting hungry."
sleep(360000)
src << "You're need for food increases."
sleep(120000)
src << "You need food!"
sleep(120000)
src << "You begin to starve!"
sleep(120000)
src << "You're starving... Better eat something soon!"
src.Hunger = 0
src << "You die of starvation!"
src.deathcheck()
else
src.deathcheck()
ID:261391
Feb 18 2002, 1:43 am
|
|
No errors but the dream seeker freezes.
|
In response to LordJR
|
|
How would you classify Kemet? What genre I mean. Because I am working on a project in which the users control the world. They control the government, religion, shops, inns, everything. I want it to be original though. I guess im just gonna have to play it.
|
In response to Canar
|
|
This isn't a code problem.
|
In response to Nadrew
|
|
Give me a break, I saw that and didn't feel like going to the creations forum.
|
The reason why that doesn't work is because it's an infinite loop.
while will continue to loop until the test statement evaluates to false (or zero). By having the test statment simply be 1 your telling it to ALWAYS evaluate to true which means it will continue to loop forever. The only way you could stop it in this situation would be to use the break command. |
In response to LordJR
|
|
If I'm correct, that will crash your game in approximately 64 hours (Yeah like that matters).
I got bored and revamped it. <FONT COLOR=silver> mob/pc/proc/Food_Drink_Check() |
Since Kemet has grown in popularity as of late, I've noticed many of my features being used in other people's game, not that I was the first person to ever do it, just a resurge in the kinda game I'm trying to convey! Good Luck!!!
Here LS since I take it you want your code similar to that of Kemet's I'll just post my hunger code. Understand that the variables need to be pre-defined under the mob/pc
of course.
LJR
This code will start the code below
mob/pc/New()
Food_Drink_Check()
..()
mob/pc/proc
Food_Drink_Check()
if(GM == 1)
return
hunger -= 1
thirst -= 1
spawn(18000)
Food_Drink_Check()
if (hunger < 0)
hunger = 0
if (thirst < 0)
thirst = 0
if (hunger > 5)
hungerc = "Full"
if (thirst > 5)
thirstc = "Full"
if (hunger < 6 && hunger > 0)
hungerc = "Hungry"
if (thirst < 6 && thirst > 0)
thirstc = "Thirsty"
if (hunger == 0)
hungerc = "Starving"
if (thirst == 0)
thirstc = "Dehydrated"
if (hunger == 0 || thirst == 0)
health -= 1
usr << "You loose 1 heath point."
if (hunger == 0)
usr << "You need to eat something soon."
if (thirst == 0)
usr << "You need to drink something soon."
if (health <= 0)
world << "<font color=red>[usr] has died from poor health!</font>"
Death(usr)