puppydrum64
Active member
So I re-built my shooter game, most of the scripts are tweaked slightly but other than overhauling the draw sprites subroutine using the RTS trick and the method in the advanced tutorial, not too much has changed. I did remove the draw hud portions of the subroutines since this game uses a sprite hud and those sections seemed to do nothing anyway. But now my monsters won't shoot. They are programmed exactly as they are in the intermediate tutorial but they never fire any bullets. I set a break point for when the "Shoot At Player" action is triggered but it never reaches that part of the code. Both player characters can shoot no problem so it doesn't have anything to do with the change in the draw sprite routine. What's going on? I know asking a question like this will probably get me nowhere so I'll just include my demo.txt as a pastebin. Since it's so large I'll leave out anything that doesn't have to do with the game logic (such as sound, text, and other things that don't matter.)
EDIT: See the post below. This seems to affect all my games and not just the one I'm working on right now, which suggests a problem with the original scripts that I must have inadvertently created.
EDIT 2: I figured out what I did wrong. In the reply to this post I had said the following:
In my attempt to fix this, I had followed the error messages when compiling to the Update Action Timer script. I saw the following code:
Not knowing what EndAnimAndActions were, I had added them as variables into my project just to get the code to run. Which caused the game to compile correctly but it crashed immediately. I went back and commented out everything in the section starting with "JSR doEndActionTrampoline" and it worked. I thought "Well my game doesn't use trampolines for the player to jump on so I don't need this" when it was actually referring to the JMP statement being a "trampoline" to the next part of code.
Moral of the story: Don't modify the scripts that come with NESmaker (unless it's for fixing a bug that came with them). Always save a copy and edit the copy!
demo.txt - Pastebin.com
EDIT: See the post below. This seems to affect all my games and not just the one I'm working on right now, which suggests a problem with the original scripts that I must have inadvertently created.
EDIT 2: I figured out what I did wrong. In the reply to this post I had said the following:
I would like to point out that at some point I had actually removed one of the .include statements for one of these in bank 1C but I have since changed it back, and I think after that I had the problem of them not loading. Even though they should by now.
In my attempt to fix this, I had followed the error messages when compiling to the Update Action Timer script. I saw the following code:
Code:
LDA EndAnimAndActions_Lo,y
STA temp16
LDA EndAnimAndActions_Hi,y
STA temp16+1
JSR doEndActionTrampoline
JMP pastEndActionTrampoline
doEndActionTrampoline:
JMP (temp16)
; ;;; make sure that the behavior ends in an RTS, and then it will
; ;;; slide right back to this part of the code.
pastEndActionTrampoline:
Not knowing what EndAnimAndActions were, I had added them as variables into my project just to get the code to run. Which caused the game to compile correctly but it crashed immediately. I went back and commented out everything in the section starting with "JSR doEndActionTrampoline" and it worked. I thought "Well my game doesn't use trampolines for the player to jump on so I don't need this" when it was actually referring to the JMP statement being a "trampoline" to the next part of code.
Moral of the story: Don't modify the scripts that come with NESmaker (unless it's for fixing a bug that came with them). Always save a copy and edit the copy!
demo.txt - Pastebin.com
Last edited: