Basic Melee Weapon Issues

Having trouble compiling code? Getting an unexpected error? Player not appearing on screen? Seeking answers on how to do a particular thing? This is the forum you're looking for, to ask other NESmaker users for assistance.
User avatar
stevenshepherd
Posts: 236
Joined: Sun Feb 18, 2018 5:25 pm

Basic Melee Weapon Issues

Post by stevenshepherd » Sat Jan 12, 2019 7:12 am

Sorry, but what video explains setting up a melee weapon? The adventure tutorial doesn't really explain everything, and the getting started one's don't seem to (input management video just covers walking). When I try to add it based on what I remember from beta, it crashes because of this:

Routines\Basic\ModuleScripts\InputScripts\Adventure\b_create_melee.asm(26): Label already defined.
Routines\Basic\ModuleScripts\InputScripts\Adventure\b_create_melee.asm(40): Label already defined.
Routines\Basic\ModuleScripts\InputScripts\Adventure\b_create_melee.asm(45): Label already defined.
demo.txt written.
User avatar
dale_coop
Posts: 3725
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Basic Melee Weapon Issues

Post by dale_coop » Sat Jan 12, 2019 10:22 am

The message seems to indicate you already assign another melee script? (check your "Scripts > Input Scripts", and remove if another one there)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
stevenshepherd
Posts: 236
Joined: Sun Feb 18, 2018 5:25 pm

Re: Basic Melee Weapon Issues

Post by stevenshepherd » Sat Jan 12, 2019 2:47 pm

I wondered if that was it. I loaded the text box script but i wanted it to be assigned to the A button. I knew "b button" was in the name of the script but figured i would try it,and it worked assigning it to A.

So I went and deleted the text box script from input and also scripts and put back in the script for B melee. Game loads now, although the melee doesn't work (which makes sense given that I am probably missing something or several things; not sure where it is found in the tutorials)

Then there is the question of how do I change the code so that I can make A for text boxes, not B.

Also, in looking at my "b melee" script, a lot of it appears to be about text boxes and a lot appears the same as the text box script?

I'm really confused because in the adventure tutorial there doesn't seem to be a text box script loaded, just melee and projectile. But in the #9 getting started video, he does load the b text box script.
User avatar
dale_coop
Posts: 3725
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Basic Melee Weapon Issues

Post by dale_coop » Sat Jan 12, 2019 3:53 pm

The NPC textbox in basic modules of 4.1 are create with the b_melee script.
But yes, you could separate them and have 3 scripts: one for textbox, one for melee, one for projectile.

If you want, I can make you those scripts...
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
stevenshepherd
Posts: 236
Joined: Sun Feb 18, 2018 5:25 pm

Re: Basic Melee Weapon Issues

Post by stevenshepherd » Sat Jan 12, 2019 3:59 pm

Ok I was wondering that, except that the text boxes don't seem to work with the b melee script loaded. Only works with the text script loaded. I'll double check though and try to figure it out, thanks!

Thanks very much for the offer! I don't think I am there yet (I am not sure how I want to handle weapons yet) so I would hate for you to do the work for nothing.
User avatar
stevenshepherd
Posts: 236
Joined: Sun Feb 18, 2018 5:25 pm

Re: Basic Melee Weapon Issues

Post by stevenshepherd » Sat Jan 12, 2019 4:04 pm

Ok got the text with the melee script behaving (made a silly mistake). Now just to figure out the melee weapon
User avatar
dale_coop
Posts: 3725
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Basic Melee Weapon Issues

Post by dale_coop » Sat Jan 12, 2019 4:06 pm

Glad you fixed it ;)
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
stevenshepherd
Posts: 236
Joined: Sun Feb 18, 2018 5:25 pm

Re: Basic Melee Weapon Issues

Post by stevenshepherd » Sat Jan 12, 2019 5:07 pm

I got the melee working in a basic form, but the problem I am having is that changing the "melee" under game object doesn't seem to do anything (also it appears that "melee" under game object in the menu isn't actually the melee? in the adventure tutorial he loads the projectile under melee, as opposed to projectile, which I find very confusing). My melee weapon on screen appears to be the 10th tile on the top row of my player tileset (which corresponds to the same place as his sword in the adventure tutorial). I don't know how to change this. intuitively I would click on melee under game objects, and instead of it being the first tile in my player tileset, I would change it to whatever I want. In the adventure tutorial, I never see the sword sprite loaded anywhere under the game objects.

I also wanted my melee to have an animation but I am unsure how this would work if it is just loading a single 8x8 sprite from the 10th row of my player's tileset.

I am not sure what I am missing. It seems like some important information is not in the videos but again I could be completely missing something.
User avatar
dale_coop
Posts: 3725
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Basic Melee Weapon Issues

Post by dale_coop » Sat Jan 12, 2019 5:31 pm

Yep, the basic modules use a sprite based sword. That means, basically, when you press the "A" button, the player changes his state, he become to Attacking (action step and a flag). The pre-draw routines (that literally draw on the screen) check if the player is in attacking state, then it draws the weapon tile next to the player.
You can change the index of the tile used in your "Project Settings > User Constants":

Image

It would be doable to change for object based weapon (like in the 4.0) but would required to deactivate some (or maybe a lot of ?) code in the Pre Draw and maybe Extra Controll Read control scripts.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
User avatar
stevenshepherd
Posts: 236
Joined: Sun Feb 18, 2018 5:25 pm

Re: Basic Melee Weapon Issues

Post by stevenshepherd » Sat Jan 12, 2019 5:52 pm

ok thanks very much :)
Post Reply