make a while loop something like:


Code:

while X!=H
X+5(X<H-5)+(H-X)(X>H-5)->X
DRAW STUFF HERE
End


?
That's what I was thinking. Just got busy after I made the posts and haven't had time to think of the code to write up yet :p

Thakns.
Awesome Smile
You could try:

Code:
:While X≠H
:min(H,X+5→X
:End
Weregoose wrote:
You could try:

Code:
:While X≠H
:min(H,X+5→X
:End


You're scary sometimes, you know that?



The above screenshot is with Weregoose's code, with the restore value of 147. Now to make this all work in the appvar to be dumped in a program to run.
Looking good! I'm glad you were able to fit in a bit of progress this morning. Smile
Thakns [:\ - Merth], me too. Hopefully I can get it ready to be dropped into the game fairly quickly, but as you've seen, that particular bit of preparation can cause some epic headaches :p

Code:
"|LP"+sub("123456",Z,1)->Str7
4->theta:"ZTMP3"->Str0:prgmZCE
3->theta:prgmZCE
+Str7+"(1)"+sub(str9,1,1)+"X:"
+Str7+"(2)"+sub(Str9,1,1)+"V:
If V-X<200:V-X"+sub(Str9,1,1)+"J:
If V-X>=200:200"+sub(Str9,1,1)+"J:
X+J"+sub(Str9,1,1)+"|N:
For(F,15,30:Line(0,F,94,F,0:End:"0ZBD":
prgmZRS:{94,0,3,27:prgmTEMP:prgmZC1:
Text(47,4,"USED HYPER POTION!":
While X!=|N
min(|N,X+5)"+sub(Str9,1,1)+"X
Text(7+21(Z!=4 and Z>1)+21(Z=3 or Z=6),(2+52(Z>3))+4(2-int(log(X))),X:
iPart((|E2(X/V)).25"+sub(Str9,1,1)+"K:
68-21(Z-3(Z>3))"+sub(Str9,1,1)+"I:
Line(2+52(Z>3),I,2+(52(Z>3))+K,I:
End:
X"+sub(Str9,1,1)+Str7+"(1):
For(F,4,14


This is what I've gotten worked on this morning, converting the code to work from the appvar. Also adding in the texts and such that is needed, though I forgot to do checks to see if the HP even needs increased. I'll add that in later.
I know you've explained this before, but remind me again why everything has to be squashed together on a single line? Smile Other than that, the code looks good to me.
Each item has a number. The item list is in a format of {Item#.Qty,Item#.Qty,etc. I store the code for item usage in an appvar on a single line so it's a simple matter of looking at the item# portion of the selected list element, and using Celtic2 to recall that line of code from the archive appvar and to dump off into a temp program to run.

Also, what was the max size of an appvar again? Something along the lines of 68K, right?
tifreak8x wrote:
Also, what was the max size of an appvar again? Something along the lines of 68K, right?
You should stay a few hundred bytes south of 64K (65536 bytes) to be safe.
Oh, alright. As it stands now, the appvar is at 8530 bytes. Still have a lot of information to get packed into there.
How's this going, tifreak8x? Has the weekend brought you any time to make progress?
I have made some, yes Smile


Code:
"|LP"+sub("123456",Z,1)->Str7:
4->theta:"ZTMP3"->Str0:prgmZCE:
3->theta:prgmZCE:
Str7+"(1)"+sub(str9,1,1)+"X:"
+Str7+"(2)"+sub(Str9,1,1)+"V:
For(F,0,17:Line(0,F,94,F,0:End:"0ZBD":
prgmZRS:{94,0,3,27:prgmTEMP:prgmZC1:
If X=V:Then:
Text(47,4,"+sub(Str9,2,1)+"HYPER POTION"+sub(Str9,2,1)+":
Text(53.4."+sub(Str9,2,1)+"INEFFECTIVE!"+sub(Str9,2,1)+":
1.5"+sub(Str9,1,1)+"W:Return:
End:
If X<V:Then:
If V-X<200:V-X"+sub(Str9,1,1)+"J:
If V-X>=200:200"+sub(Str9,1,1)+"J:
X+J"+sub(Str9,1,1)+"|N:
Text(47,4,"+sub(Str9,2,1)+"USED HYPER POTION!"+sub(Str9,2,1)+":
While X!=|N
min(|N,X+5)"+sub(Str9,1,1)+"X
Text(7+21(Z!=4 and Z>1)+21(Z=3 or Z=6),(2+52(Z>3))+4(2-int(log(X))),X:
iPart((|E2(X/V)).25"+sub(Str9,1,1)+"K:
68-21(Z-3(Z>3))"+sub(Str9,1,1)+"I:
Line(2+52(Z>3),I,2+(52(Z>3))+K,I:
End:
X"+sub(Str9,1,1)+Str7+"(1):
For(F,4,14:Line(4,F,90,F,0:End:
0"+sub(Str9,1,1)+"theta:"+sub(Str9,2,1)+"ZPNA"+sub(Str9,2,1)+sub(Str9,1,1)+"Str0:"+
Str7+"(43):prgmZCE:
Text(47,4,"+Str9+","+sub(Str9,2,1)


I had realized I made a bit of an oops with the code dealing with the Text( functions. Those snippets have been fixed, along with a few more lines of code written out. Writing this code to be all on one line and completely dynamic is a PITA, have I ever mentioned that?
Assuming I/J/K are only temporary variables:

Code:
:If X<V:Then   //Where is the End for this?
:X+min(200,V-X→N
:Text(47,4,"USED HYPER POTION!"
:While X≠N
:min(N,X+5→X
:68-21(Z-3(Z>3→I
:2+52(Z>3
:Text(54-I,Ans+8-4int(log(X)),X
:Line(Ans,I,Ans+iPart(25X/V),I
:End

I'm almost convinced there's a better method than using min( before the While and working around that value.
The code is far from finished as of yet :p

Some nice optimizations, though Smile
tifreak8x wrote:
Writing this code to be all on one line and completely dynamic is a PITA, have I ever mentioned that?
There has to be a better solution than that. Sad One accidental tap of [CLEAR] and you're out of luck.
Well, doing it all on the computer in Tokens does help with that particular problem. I've not done any oncalc dev for quite a while, now.
tifreak8x wrote:
Well, doing it all on the computer in Tokens does help with that particular problem. I've not done any oncalc dev for quite a while, now.
Ah, it's good to hear that you're avoiding that particular headache, at least. Smile
Once I get the kinks worked out on the thing I'm working on right now, that should be a little easier for you to do Smile.
  
Page 2 of 14
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement