puppydrum64
Active member
I noticed when doing the Brawler module this peculiar situation, where each time a bad guy attacked he cloned himself. I eventually fixed it but in doing so raised even more questions.
A little background info: I wanted to create a second type of bad guy that uses a gun instead of punching. I found that duplicating the original monster and changing its palette for every frame of every animation would take more time than just manually creating a new monster with the same object details and drawing it again with the new palette. So my monsters section looks like this.
My understanding is that badGuy is #$10, badGuyFist is #$11, GunGuy is #$12, GunGuy_Gun is #$13, and badGuy-Copy is #$14.
Next I went into bank 18 where the punching logic is located.
This is the part of the code that tells the game to put the fist in front of the bad guy.
So I copied and pasted the entire "doEnemyPunch" routine, replacing #$11 with #$13. As stated before, #$13 should be the gun. Emphasis on should. After creating the necessary AI behaviors to call this new routine, dubbed "doEnemyShoot", I playtested the game and found that instead of a the gun spawning in Gun Guy's hand, another Gun Guy was spawning! (index #$12)
Confused, I created a copy of the original badGuy except his AI is the same as Gun Guy's (he goes to doEnemyShoot instead of doEnemyPunch), thinking that I made a mistake somewhere when creating Gun Guy as described in the first paragraph. I chose to leave his palette pink out of laziness, because I just wanted to see if a gun would appear in his hand, not caring that the gun was green and the monster was pink. This ended up working in my favor because I understood precisely what was going on after playtesting. The pink badGuy-Copy was spawning green Gun Guy with every punch! So I determined that the error was coming from the code I showed earlier. I changed the number from #$13 to #$14 just to see what would happen. The pink badGuy-copy was creating more copies of himself, which were pink. I finally got the gun to appear by changing the number to #$12, even though based on the order of my monster section it should be #$13.
TL;DR: in my Monsters section 12 is 13 and vice versa, all others are correct.
EDIT: Something similar is happening when I followed the intermediate tutorial. Despite having only 2 monsters (bad guy and fist) the bad guy creates more bad guys when punching instead of using his fist. The script in bank 18 still calls for object 11.
A little background info: I wanted to create a second type of bad guy that uses a gun instead of punching. I found that duplicating the original monster and changing its palette for every frame of every animation would take more time than just manually creating a new monster with the same object details and drawing it again with the new palette. So my monsters section looks like this.
My understanding is that badGuy is #$10, badGuyFist is #$11, GunGuy is #$12, GunGuy_Gun is #$13, and badGuy-Copy is #$14.
Next I went into bank 18 where the punching logic is located.
Code:
LDA #$11
STA tempC ;; the object that should appear.
This is the part of the code that tells the game to put the fist in front of the bad guy.
So I copied and pasted the entire "doEnemyPunch" routine, replacing #$11 with #$13. As stated before, #$13 should be the gun. Emphasis on should. After creating the necessary AI behaviors to call this new routine, dubbed "doEnemyShoot", I playtested the game and found that instead of a the gun spawning in Gun Guy's hand, another Gun Guy was spawning! (index #$12)
Confused, I created a copy of the original badGuy except his AI is the same as Gun Guy's (he goes to doEnemyShoot instead of doEnemyPunch), thinking that I made a mistake somewhere when creating Gun Guy as described in the first paragraph. I chose to leave his palette pink out of laziness, because I just wanted to see if a gun would appear in his hand, not caring that the gun was green and the monster was pink. This ended up working in my favor because I understood precisely what was going on after playtesting. The pink badGuy-Copy was spawning green Gun Guy with every punch! So I determined that the error was coming from the code I showed earlier. I changed the number from #$13 to #$14 just to see what would happen. The pink badGuy-copy was creating more copies of himself, which were pink. I finally got the gun to appear by changing the number to #$12, even though based on the order of my monster section it should be #$13.
TL;DR: in my Monsters section 12 is 13 and vice versa, all others are correct.
EDIT: Something similar is happening when I followed the intermediate tutorial. Despite having only 2 monsters (bad guy and fist) the bad guy creates more bad guys when punching instead of using his fist. The script in bank 18 still calls for object 11.