ID:149724
 
Ok, its me again. I have a question or two. Ok, I am making a game called Chippie Pets. I wanna know this! How do you make something loop forever??

set time += 1
if(time = 24)
set time = 1
world<<"The time is now [time]:00!"
usr.Hunger -= 1
usr.Thirst -= 1
if(usr.Hunger = 0)
usr.Strength -= 2
if(usr.Thirst = 0)
usr.Strength -= 2

HOW DO I MAKE IT LOOP!?!
You can tell its an RP code.
Second. is this correct?

usr.Strength -= 2
if(usr.Hunger = 0 for 3000//Is that the correct way for saying if user hunger is 0 for 300 seconds?
del(src)
world<< "[usr] dies of hunger!"
if(usr.Thirst = 0 for 3000
del (src)
world<< "[usr] dies of thirst"

Sorry, GTG!
-Watabou
P.S. I know a lawyer! So don't insult my game!
the for proc at the begining of the loop
In response to Scoobert
so.......


for set time += 1
if(time = 24)
set time = 1
world<<"The time is now [time]:00!"
usr.Hunger -= 1
usr.Thirst -= 1
if(usr.Hunger = 0)
usr.Strength -= 2
if(usr.Thirst = 0)
usr.Strength -= 2
In response to Watabou
close but i think
for
set time += 1
if(time = 24)
set time = 1
world<<"The time is now [time]:00!"
usr.Hunger -= 1
usr.Thirst -= 1
if(usr.Hunger = 0)
usr.Strength -= 2
if(usr.Thirst = 0)
usr.Strength -= 2
more like that
In response to Scoobert
Scoobert, I think that worked. Now I have this error!

loading Chippie Pets.dme
Foods.dm:4:error: missing condition

Chippie Pets.dmb - 1 error, 0 warnings (double-click on an error to jump to it)

Foods.dm:4: is this:
set time = 1
so. uhmm how do I fix it?
In response to Watabou
set isn't used to set vars you just need varname = value.
In response to Nadrew
Ok Nadrew! NOW I GOT INCONSISTENT INDENTATION!
In response to Watabou
That means you need to indent to look up for because Scoobert doesn't know it's a proc.
In response to Nadrew
Ok. Now its still a missing condition!
In response to Watabou
Which line?
In response to Nadrew
mob/var/time = 12

for
time = 1
if(time = 24)
time += 1
world<<"The time is now [time]:00!"
usr.Hunger -= 1
usr.Thirst -= 1
if(usr.Hunger = 0)
usr.Strength -= 2
if(usr.Thirst = 0)
usr.Strength -= 2

loading Chippie Pets.dme
Foods.dm:4:error: missing condition

Chippie Pets.dmb - 1 error, 0 warnings (double-click on an error to jump to it)
In response to Watabou
You're still using for wrong, and it should be if(conditionone == conditiontwo)
In response to Nadrew
he he i just read the for thing in another post today and saw this and i thought it would aplay(and it does) but im not clear how to use for. Its one of thouse oddball proc like !, they mess with my head.
In response to Nadrew
ok

time == 1

izzat good? It still wont work!
In response to Watabou
Nope, you're getting the error from your if() proc.
In response to Watabou
all you if's have 2 = in them.
In response to Nadrew
Can you just right down the complete code FIXED? So we dont flood the entire Forum with MY thingymajiggy?! :D
In response to Watabou
No but I'll give you some hints:

mob/proc/loopedone()
var/loop = 1
world << "Looped!"
while(loop)//while loop is one
src.somevar +=1//do this

client/New()
mob.loopedone()
In response to Nadrew
Quote from Ed,Edd,n Eddy
I have no Idea What you just said Double D!
I dont need help for a loop! I need help to fix the bug!
In response to Watabou
Your first post stated you needed help looping things, I don't recall seeing anything about a "bug".
Page: 1 2