How do I get my player to shoot?

powerman

New member
I've looked through all the tutorials and don't see anything about how to get my character in a platformer game to shoot a projectile when the "B" button is pressed. Which script do I use? What steps do I take? I don't even know where to start.
 

vanderblade

Active member
Have you checked the community tutorial section?

Use this tutorial: http://www.nesmakers.com/viewtopic.php?f=35&t=1703
 

powerman

New member
Thanks for the reply! I'll be following that tutorial for sure. Is there maybe a final version of that tutorial though? I find the message chain hard to follow. There's so many patches to the code being suggested by so many users that I'm not quite sure what I should be using and where I should be putting it.
 

dale_coop

Moderator
Staff member
The tutorial should work. (Then, some members had particular needs for their own projects... so custom replies)
 

powerman

New member
Awesome, thanks! BTW, it seems that I'm going to have to dig into assembly for a lot of things. Is there a good reference for NES assembly that lists out all the commands and what they do as well as some documentation on the nesmaker engine ( variable names, sub routine names and what they do etc.). I program in a lot of other languages but I can't find anything straight forward for assembly.
 

powerman

New member
Okay. I found a good asm reference so I'm good on that. How about the nesmaker engine. Is there a breakdown of that somewhere?
 

powerman

New member
I tried the tutorial and now my game won't compile. I just get this:

Code:
Routines\Basic\System\Macros\HandleHorisontalInertia.asm(2): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(1): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(39): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(47): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(104): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(139): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(143): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(175): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(181): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(185): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(192): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(207): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(280): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(295): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(298): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(307): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(309): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(310): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(313): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(320): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(328): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(336): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(339): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(347): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(358): Label already defined.
Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer\TileCollisions.asm(363): Label already defined.
demo.txt written.
 

dale_coop

Moderator
Staff member
Looks like you haven't follow strictly yhe tutorial... have you made any extra modification? (maybe you modified a label name? tried to "fix" a typo error or duplicate something?)
 

powerman

New member
Nope. I created the file where the tutorial said to put it and pasted the extra lines of code where the tutorial said to put them. I un-commented the lines it said to un-comment. And I typed in nothing, everything was copied and pasted straight out of the tutorial. I noticed thought that some of the examples said to paste one line but the code to copy was three or more lines. Could that be the issue? If so what line out of those is the one to be copied?
 

powerman

New member
I went through and replaced all the altered scripts with the originals and deleted the new one and it still won't compile and has the same error. It was compiling just fine before I followed that tutorial. Can anyone point me in a direction to fix this? How can I find out what label it's talking about that is already defined? Are the numbers in parenthesis line numbers?
 

powerman

New member
Got it. Lesson learned -- don't edit the scripts inside NESMaker by loading the scripts into the input scripts folder. That makes NESMaker run that code twice. Thus already defined. Using Visual Studio now;)
 

cramske

Member
MAN! I was following this thread as I have the exact same issues. But when I get to the end I dont understand the fix?! I am a newbie non programmer who wants to learn. How are we supposed to edit these scripts?
Thanks!!
 
Top Bottom