Author Topic: Choice Endurance Help  (Read 6484 times)

0 Members and 2 Guests are viewing this topic.

Offline adamac16

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 141
  • Rating: +2/-0
    • View Profile
Choice Endurance Help
« on: January 24, 2011, 02:12:29 pm »
Im working on a game called Choice Endurance (CE for short), and im trying to add 500 health after every battle. I had something, but it only reset the 2nd battles health to 500 instead of 538 or something. Heres the code.....

First battle:
Code: [Select]
:ClrHome
:AxesOff
:ZStandard
:ClrDraw
:Text(25,35,"LOADING")
:Shade({-}3,{-}1
:ClrHome
:ClrDraw
:1000→A:1000→B
:DelVar CDelVar DWhile A>0 and B>0
:Text(1,1,Str2+":",A)
:Text(16,1,"BRIGGS:",B)
:Text(32,1,"HIT WHERE?")
:Text(40,1,"LOW=1 MID=2 HI=3")
:DelVar Z:Repeat Z=92 or Z=93 or Z=94
:randInt(1,3→D
:getKey→Z
:End
:ClrDraw
:If Z=92 and D=1
:Text(48,1,"BLOCKED")
:If Z=92 and D=2
:Then
:randInt(1,20→E
:A-E→A
:Text(48,1,"BRIGGS HITS")
:End
:If Z=92 and D=3
:Then
:randInt(1,20→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=1
:Then
:randInt(1,15→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=2
:Text(48,1,"BLOCKED")
:If Z=93 and D=3
:Then
:randInt(1,15→E
:A-E→A
:Text(48,1,"BRIGGS HITS")
:End
:If Z=94 and D=1
:Then
:randInt(1,10→E
:A-E→A
:Text(48,1,"BRIGGS HITS")
:End
:If Z=94 and D=2
:Then
:randInt(1,10→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=94 and D=3
:Text(48,1,"BLOCKED")
:End
:ClrHome
:If A≤0 and B≥0
:Then
:"BRIGGS WINS        GAME OVER
:prgmA
:ClrDraw
:AxesOn:Goto A
:End
:If B≤0 and A≥0
:Then
:"YOU WIN   CONGRATS!
:prgmA
:ClrDraw
:AxesOn
:End

Second Battle:
Code: [Select]
:ClrHome
:AxesOff
:ZStandard
:Text(25,35,"LOADING")
:Shade({-}3,{-}1
:ClrHome
:ClrDraw
:A+500→A:1000→B
:DelVar CDelVar DWhile A>0 and B>0
:Text(1,1,Str2+":",A)
:Text(16,1,"TANK:",B)
:Text(32,1,"HIT WHERE?")
:Text(40,1,"LOW=1 MID=2 HI=3")
:DelVar Z:Repeat Z=92 or Z=93 or Z=94
:randInt(1,3→D
:getKey→Z
:End
:ClrDraw
:If Z=92 and D=1
:Text(48,1,"BLOCKED")
:If Z=92 and D=2
:Then
:randInt(1,20→E
:A-E→A
:Text(48,1,"TANK HITS")
:End
:If Z=92 and D=3
:Then
:randInt(1,20→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=1
:Then
:randInt(1,15→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=2
:Text(48,1,"BLOCKED")
:If Z=93 and D=3
:Then
:randInt(1,15→E
:A-E→A
:Text(48,1,"TANK HITS")
:End
:If Z=94 and D=1
:Then
:randInt(1,10→E
:A-E→A
:Text(48,1,"TANK HITS")
:End
:If Z=94 and D=2
:Then
:randInt(1,10→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=94 and D=3
:Text(48,1,"BLOCKED")
:End
:If A≤0 and B≥0
:Then
:"TANK WINS          GAME OVER
:prgmA
:ClrDraw
:AxesOn:Goto A
:End
:If B≤0 and A≥0
:Then
:"YOU WIN   CONGRATS!
:prgmA
:ClrDraw
:AxesOn
:End
:Goto θθ
:Lbl H
:ClrHome
:AxesOff
:ZStandard
:Text(25,35,"LOADING")
:Shade({-}3,{-}1
:ClrHome
:ClrDraw
:1000→A:1000→B
:DelVar CDelVar DWhile A>0 and B>0
:Text(1,1,Str2+":",A)
:Text(16,1,"SPIDER:",B)
:Text(32,1,"HIT WHERE?")
:Text(40,1,"LOW=1 MID=2 HI=3")
:DelVar Z:Repeat Z=92 or Z=93 or Z=94
:randInt(1,3→D
:getKey→Z
:End
:ClrDraw
:If Z=92 and D=1
:Text(48,1,"BLOCKED")
:If Z=92 and D=2
:Then
:randInt(1,20→E
:A-E→A
:Text(48,1,"SPIDER HITS")
:End
:If Z=92 and D=3
:Then
:randInt(1,20→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=1
:Then
:randInt(1,15→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=93 and D=2
:Text(48,1,"BLOCKED")
:If Z=93 and D=3
:Then
:randInt(1,15→E
:A-E→A
:Text(48,1,"SPIDER HITS")
:End
:If Z=94 and D=1
:Then
:randInt(1,10→E
:A-E→A
:Text(48,1,"SPIDER HITS")
:End
:If Z=94 and D=2
:Then
:randInt(1,10→E
:B-E→B
:Text(48,1,Str2+" HITS")
:End
:If Z=94 and D=3
:Text(48,1,"BLOCKED")
:End
:If A≤0 and B≥0
:Then
:"SPIDER WINS        GAME OVER
:prgmA
:ClrDraw
:AxesOn:Goto A
:End
:If B≤0 and A≥0
:Then
:"YOU WIN   CONGRATS!
:prgmA
:ClrDraw
:End

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Choice Endurance Help
« Reply #1 on: January 24, 2011, 04:36:00 pm »
Could you upload any files or anything? It would be helpful to see exactly what's going on. I kind of went over the code but not entirely but didn't see anything unless prgmA resets the value of A or something.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline adamac16

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 141
  • Rating: +2/-0
    • View Profile
Re: Choice Endurance Help
« Reply #2 on: January 24, 2011, 08:15:13 pm »
It won't let me upload anything... it keeps saying "theres already a file with the same name" no matter what i name it.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Choice Endurance Help
« Reply #3 on: January 24, 2011, 08:54:01 pm »
What names have you tried? Have you tried just punching in a bunch of random crap and testing?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline adamac16

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 141
  • Rating: +2/-0
    • View Profile
Re: Choice Endurance Help
« Reply #4 on: January 25, 2011, 05:16:17 pm »
Ive tried copying them, just putting CE, S1, etc. and it still said it.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Choice Endurance Help
« Reply #5 on: January 25, 2011, 05:51:48 pm »
Well try just typing in random characters like CElskdjfslkj or something like that. When you get down to stuff like two or three letters then there is a good chance it's been taken already. Or common things like A, B, C, etc. those have been taken too already.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline adamac16

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 141
  • Rating: +2/-0
    • View Profile
Re: Choice Endurance Help
« Reply #6 on: January 25, 2011, 06:33:27 pm »
Here you go...just put all the files in Wabbitemu and youre set.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Choice Endurance Help
« Reply #7 on: January 25, 2011, 11:48:29 pm »
Ok, I'll take a look ASAP. Could you tell maybe what each one does or which needs to be run first or something?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline adamac16

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 141
  • Rating: +2/-0
    • View Profile
Re: Choice Endurance Help
« Reply #8 on: January 26, 2011, 05:06:53 pm »
The first link, prgmA, is a wordwrap program.
The second link, prgmCHOICEEN (CE), is the main program.
Third-Fifth link, Str1,Str2,Str3, is needed to run CE.
Just run them all at the same time.

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Re: Choice Endurance Help
« Reply #9 on: January 26, 2011, 07:39:11 pm »
It would be helpful if you could provide a list of the variables used, as what do they contain (used for).

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Choice Endurance Help
« Reply #10 on: January 26, 2011, 07:41:33 pm »
Ok, thanks. I'll try to get to it when I get some time.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline adamac16

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 141
  • Rating: +2/-0
    • View Profile
Re: Choice Endurance Help
« Reply #11 on: January 27, 2011, 06:53:14 pm »
WOOOOOOOO!!!!! Finally fixed. Now i can continue and finish Choice Endurance.

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Choice Endurance Help
« Reply #12 on: January 27, 2011, 08:02:01 pm »
Oh, ok. What was the problem?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Online DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Choice Endurance Help
« Reply #13 on: January 27, 2011, 08:18:45 pm »
Glad to hear you fixed it, but it would be cool if you shared what you did to fix it with us, in case someone else might run into a similar problem in the future. :)

Offline kalan_vod

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2715
  • Rating: +10/-0
    • View Profile
    • kalanrock.us
Re: Choice Endurance Help
« Reply #14 on: January 27, 2011, 11:01:05 pm »
I was going through the code, but there are many occurrences of redundancies which made it difficult to pinpoint the issue. After the first battle I went from 1 Life to 500 Life, but never could make it further than that. Glad you figured it out, it is always harder for someone to figure out someones code :P