Hey guys, working on the next version of PMS. Going to make a big? change to the main loop, but not sure about how to go about doing it...
Currently, I have something like this (Shortened)
SCAR Code:
If (TimeFromMark(WeMined) > 90000) Then
Begin
Players[CurrentPlayer].Loc:='Cant Find Rock :(';
StatsGuise('NP:Cnt.Fnd.Rock');
Logout;
Break;
End;
So, If the time between mining rocks is over 1 minute and 30 seconds, then Log Out.
And then later in the loop I have
SCAR Code:
Players[CurrentPlayer].Active := LoggedIn;
PlayerCurTime := GetSystemTime;
Players[CurrentPlayer].Worked := Players[CurrentPlayer].Worked + (PlayerCurTime - PlayerStartTime);
Logout;
This sets the current players true/false status to true if logged in, false if logged out.
The problem is, sometimes the script gives the "can't find rock for 1 minute 30 seconds" error, and sets a character to false, yet the character is just fine, outside of a random, and near rocks (weird huh?)
So what I want to do instead is allow a character to get the "can't find rock for 1 minute 30 seconds" error THREE TIMES before setting it to false.
I was thinking of something like, if the error occurs, log out (BUT KEEP THE PLAYER STATUS TRUE), and continue on looping the characters like normal, if the error happens again (and totals 3 times eventually) THEN set the character to false.
That's the best I can explain it for now
hopefully you all understand, ask for clarification if needed!
Thanks A Bunch!
YoHoJo
Edit:
Hmm Maybe something like
Players[CurrentPlayer].Integers[84] Can be the error counter
Each time the problem happens Inc Integer84
And do something like
SCAR Code:
If Players[CurrentPlayer].Integers[84] < 3 Then
Players[CurrentPlayer].Active := True;
else
Players[CurrentPlayer].Active := LoggedIn;
Would that do it?
!