Jump to content

Photo

Game won't compile, can't figure out issue II: the electric boogaling


13 replies to this topic

#1 8-bit_d-boy OFFLINE  

8-bit_d-boy

    Star Raider

  • 53 posts

Posted Sun Jul 23, 2017 6:46 PM

Same issue as before, syntax error, can't figure out what's wrong, losing hair.

 

So this issue started when I added my win state code which goes as follows:

	rem red win state
	;goto _skip_win_state
	if scoring < 62 then goto _skip_win_state
		AUDV0 = 0
		AUDV1 = 0
		if scoring < 123 && scoring + 1 <= 122 then scoring = scoring + 1 : goto _skip_win_state
			scoring = 62
			if pfc + 2 > 78 then pfc = 64 : goto _skip_win_state
				pfcolors:
				pfc
 				end
				pfc = pfc + 2
	
		if scoring > 122 && scoring + 1 <= 182 then scoring = scoring + 1 : goto _skip_win_state
			scoring = 123
			if pfc + 2 > 158 then pfc = 144 : goto _skip_win_state
				pfcolors:
				pfc
 				end
				pfc = pfc + 2

Please ask any questions you'd need.

Attached Files



#2 kdgarris OFFLINE  

kdgarris

    Chopper Commander

  • 210 posts

Posted Sun Jul 23, 2017 7:20 PM

Edit: As noted by RT below, the intermediate calculations were not part of the problem - it was only the indentation of the end statements.

 

You need to do intermediate calculations separately and not as part of your if statements.  Also, the "end" statement always needs to not be indented.  Here's the relevant section of code.  I commented out your if statements, and put my broken-up version of the same in the lines below.  It at least compiles for me with these changes.

	if scoring < 62 then goto _skip_win_state
		AUDV0 = 0
		AUDV1 = 0
;		if scoring < 123 && scoring + 1 <= 122 then scoring = scoring + 1 : goto _skip_win_state
                temp1 = scoring + 1
		if scoring < 123 && temp1 <= 122 then scoring = scoring + 1 : goto _skip_win_state
			scoring = 62
;			if pfc + 2 > 78 then pfc = 64 : goto _skip_win_state
                        temp2 = pfc + 2
			if temp2 > 78 then pfc = 64 : goto _skip_win_state
				pfcolors:
				pfc
end
				pfc = pfc + 2
	
;		if scoring > 122 && scoring + 1 <= 182 then scoring = scoring + 1 : goto _skip_win_state
        temp1 = scoring + 1
		if scoring > 122 && temp1 <= 182 then scoring = scoring + 1 : goto _skip_win_state
			scoring = 123
			if pfc + 2 > 158 then pfc = 144 : goto _skip_win_state
				pfcolors:
				pfc
end
				pfc = pfc + 2

Edited by kdgarris, Mon Jul 24, 2017 6:01 AM.


#3 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,235 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Jul 23, 2017 7:42 PM

Your program will compile if you just get rid of the indentations before end.

 

Make sure that you have the latest version of batari Basic and bblint and you will get error messages like these:

 

warning(299):    The "end" command appears to be indented.
warning(297):    missing matching end to "   pfcolors:"
warning():    Found 8 commands that use end,  and 7 "end" commands.


#4 8-bit_d-boy OFFLINE  

8-bit_d-boy

    Star Raider

  • Topic Starter
  • 53 posts

Posted Sun Jul 23, 2017 8:31 PM

Hey thanks for the help, guys! It works now thanks to de-indenting the end statements, and it seems to work fine with intermediate calculations in the if-statements, but I'm wondering if that wouldn't work on real atari hardware.

 

But now how do I get the Playfield to chage color? Does pfcolors not work with variables? The ball is black for me

 

Also the Install batch file says I need setX.


Edited by 8-bit_d-boy, Sun Jul 23, 2017 9:35 PM.


#5 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,235 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Jul 23, 2017 10:56 PM

Hey thanks for the help, guys! It works now thanks to de-indenting the end statements, and it seems to work fine with intermediate calculations in the if-statements, but I'm wondering if that wouldn't work on real atari hardware.


At one time, batari Basic wouldn't let us do any kind of math in if…then statements. That was changed over the years, but you still have to keep an eye on it.


 

But now how do I get the Playfield to change color? Does pfcolors not work with variables? The ball is black for me


I don't see any variables used here:

randomterrain.com/atari-2600-memories-batari-basic-commands.html#kernop_pfcolors

 

Be sure to check out the warning at the bottom of that section.

 
 

Also the Install batch file says I need setX.


RevEng said "install_win.bat requires SETX, which comes with Windows XP SP2 and later versions of Windows. If you don't have SETX on the system, the batch file will let you know and explain the situation."



#6 8-bit_d-boy OFFLINE  

8-bit_d-boy

    Star Raider

  • Topic Starter
  • 53 posts

Posted Mon Jul 24, 2017 12:23 AM

Thanks for the help

 

I don't see any variables used here:

randomterrain.com/atari-2600-memories-batari-basic-commands.html#kernop_pfcolors

 

Be sure to check out the warning at the bottom of that section.

Tried it without pfheights, same issue, oh well. I wanted it to change the playfield to the winner's color and cycle through the lumas, but guess not.

 

 

 

RevEng said "install_win.bat requires SETX, which comes with Windows XP SP2 and later versions of Windows. If you don't have SETX on the system, the batch file will let you know and explain the situation."

 

I'm aware of this, but I'm not sure where to get it.

 

Thanks again.



#7 8-bit_d-boy OFFLINE  

8-bit_d-boy

    Star Raider

  • Topic Starter
  • 53 posts

Posted Mon Jul 24, 2017 10:09 PM

So I decided to change the background color to match the winner and have it cycle thru that color's luminances by one color every second similar to combat, but it seems to just stick to the one luminance value and I can't figure out why.

Any pointers would be helpful.

	rem -------------------------

	rem        WIN STATE

	rem -------------------------

	;goto _skip_win_state
	if scoring < 62 then goto _skip_win_state
		AUDV0 = 0
		AUDV1 = 0
		COLUBK = pfc
		scoring = scoring + 1
		pfc = pfc + 2
		if missile0x > 110 then gosub red_win		
		if missile1x > 110 then gosub blu_win

_skip_win_state
red_win
	if scoring > 122 then scoring = 62
	if pfc > 78 then pfc = 64
	return

blu_win
	if scoring > 182 then scoring = 123
	if pfc > 158 then pfc = 144
	return

Attached Files



#8 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,235 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Mon Jul 24, 2017 11:59 PM

If I stick in "scoring = 62", the background flashes like crazy, not once every second.



#9 8-bit_d-boy OFFLINE  

8-bit_d-boy

    Star Raider

  • Topic Starter
  • 53 posts

Posted Tue Jul 25, 2017 11:00 AM

Where did you put that? I tried putting that in line 301, but I'm not getting that result.



#10 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,235 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Jul 27, 2017 6:07 AM

Where did you put that? I tried putting that in line 301, but I'm not getting that result.


I either put it right before the if then that checks for that or I put it in the main loop.

#11 Tony The 2600 OFFLINE  

Tony The 2600

    Moonsweeper

  • 356 posts
  • 1.19 MHz
  • Location:Adelaide, Australia

Posted Fri Aug 4, 2017 7:13 AM

By the looks of it to me the first instruction is a 'goto' statement "_skip_win_state" so basically any code following is ignored until the _skip_win_state label.


Edited by Tony The 2600, Fri Aug 4, 2017 7:59 AM.


#12 8-bit_d-boy OFFLINE  

8-bit_d-boy

    Star Raider

  • Topic Starter
  • 53 posts

Posted Fri Aug 4, 2017 10:55 AM

You're a little late to this thread, pal.



#13 RevEng OFFLINE  

RevEng

    River Patroller

  • 4,704 posts
  • Bitnik
  • Location:Canada

Posted Fri Aug 4, 2017 11:04 AM

You're a little late to this thread, pal.
Even though I didn't say so, I'm all set with this issue. Thanks anyway!

Fixed that for you.

#14 8-bit_d-boy OFFLINE  

8-bit_d-boy

    Star Raider

  • Topic Starter
  • 53 posts

Posted Fri Aug 4, 2017 12:15 PM

Fixed that for you.

That's what I meant to say, thanks dude!






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users