is it just me or are these boards playing up alot lately. I just spent over 1/2 an hour typing a message only to have the page dissapear when i hit post.
Anyway, to my dilema.
In my project, when a person is in a house, he grows to a point where he spawns another person. At this point it calls a function and finds the first avaliable person and brings them to life.
But the problem is, sometimes the person wont spawn and the house char's health is reset as if they did. Sometimes it might take 2 runs or 20. So im wondering if someone can pick up where the problem is.
` person in a dwelling grows.
if goodstate(char)=4 :` mans a tent
goodlife(char)=goodlife(char)+1
if goodlife(char)>2100 then goodlife(char)=2000
if goodlife(char)>2000
man=gfreeperson(maxpeople)
`gosub gfreeperson
if man>0 :`and gtotalpeeps<=maxpeople
goodlife(man)=100
goodlife(char)=10
goodposx(man)=goodposx(char)
goodposz(man)=goodposz(char)
distance=rnd(6)+1
gooddist(man)=distance
goodangle(man)=goodangle(char)
goodstate(man)=2
inc ppl_born
endif
endif
if update=1
tent=1 : gosub gchecktent
if tent=0
goodstate(char)=2 : if gdscreen(char)=1 then update=1
endif
endif
endif
`check for the first free person and return his number
function gfreeperson(maxpeople)
`
for tempppl=1 to maxpeople
if goodstate(tempppl)=-10 then exitfunction tempppl
next tempppl
if tempppl>maxpeople then tempppl=0
`
endfunction tempppl
As u can see i also tryed it with out the function, calling just a normal gosub instead, but it still has the same result. And its not all the time, 99.9% of the time it works, but that .1% pops up to frequently for my liking.
Anyway thanks in advance.
crighton
Why are the forgotten always remembered? But no-one remembers me?!