Hi
Dilemma time.
For some reason I find below does not give correct shown % when maxchildren is reached (17) it shows 106%.
Correctly the label should read Children times 100 divided by maxchildren
Int maxchildren set at 17.
I thought it was alright some time ago.
Ltotal.Text = String.Format("You have rescued %d%% of the missing children",(Children*100)/maxchildren);
Based on:
Children=(Children+1)
You might have a mistake in program logic.
If you will put Children == 18 into your formula (with maxchildren == 17), you will get 106%.
This means your children count gets larger than maxchildren at some point.
Hi Crimson
Yes, I understand.
The Children Label itself shows 17 (which is maxchildren) so it can't be 18.
Both 17 and lower will show %. 17 being 100% on the Ltotal label.
It must be a room script error. I will have to take the room apart and check.
QuoteI don't believe it!
As Victor Meldrew would say (laugh)
I had amended maxchildren and stupidly forgot you have to play game from start.
This is one part of the compile (variable) system I hate!
Anyhow, guess I'll have to play from start with fingers crossed.
You could make debug functions that would correct your variables at runtime.
Replaying all game from start simply because couple of vars changed is waste of time. :(
For example, a simple GUI window, with buttons to correct (increase/decrease) some important stats.
Label text doesn't automatically update when the variable changes unless it is set each frame in rep_ex.
So I guess the game increased maxchildren to 18, updated the percentage label but didn't update the maxchildren label.
It was Global variable (maxchildren)and not starting game again from scratch.
It seems to be ok now (nod)
cheers