[4.1] Use the real Melee object weapon in the Platformer module

User avatar
yellow nail
Posts: 3
Joined: Thu Jul 11, 2019 9:22 am

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by yellow nail » Thu Jul 11, 2019 9:50 am

Heya! I'm sorta new to nesmaker and I did everything as followed, except I got an error saying:

Routines\Basic\ModuleScripts\InputScripts\b_create_melee_weapon.asm(65):CreateObject(26): Unknown label.
demo.txt written.

Is it something I did wrong, or am I supposed to add some sort of value? I'm not sure what to do there but I'll show the line of code the error might be pointing out

CreateObject temp, temp1, #OBJECT_PLAYER_MELEE, #&00, temp3


Thanks for the help!
How the HECK am I gonna work this out?
User avatar
Mugi
Posts: 552
Joined: Thu Dec 27, 2018 8:30 pm

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by Mugi » Thu Jul 11, 2019 11:21 am

well for starters, it should be #$00, not #&00
sans that, does the #OBJECT_PLAYER_MELEE constant exist ?
User avatar
yellow nail
Posts: 3
Joined: Thu Jul 11, 2019 9:22 am

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by yellow nail » Thu Jul 11, 2019 6:17 pm

Mugi wrote:
Thu Jul 11, 2019 11:21 am
well for starters, it should be #$00, not #&00
sans that, does the #OBJECT_PLAYER_MELEE constant exist ?

Okay so I changed the sign and tested it, didn't work but other than that. what do you mean by constant, Did I miss a step?
How the HECK am I gonna work this out?
User avatar
dale_coop
Posts: 3710
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by dale_coop » Thu Jul 11, 2019 6:29 pm

Which version of NESmaker are you? 4.1.5? What module are you using? Platformer? Adventure?
For the "OBJECT_PLAYER_MELEE" constant... check the 1/ of my tutorial.
-----
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
yellow nail
Posts: 3
Joined: Thu Jul 11, 2019 9:22 am

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by yellow nail » Fri Jul 12, 2019 2:49 am

dale_coop wrote:
Thu Jul 11, 2019 6:29 pm
Which version of NESmaker are you? 4.1.5? What module are you using? Platformer? Adventure?
For the "OBJECT_PLAYER_MELEE" constant... check the 1/ of my tutorial.
I'm on version 4.1.5, and i tried being a little sneaky using the platformer module assuming it'll be the same thing as the scrolling platformer module, but I have a slight feeling that it might not be the same.




Edit: Turns out the "enable" button wasn't clicked enough times, sorry for causing trouble ~.~


Also thanks!
How the HECK am I gonna work this out?
User avatar
dale_coop
Posts: 3710
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by dale_coop » Fri Jul 12, 2019 7:04 am

No problem, yellow nail... The Simple Platformer module is very close from the Scrolling Plaformer one. You can use the same scripts, same fixes,... ;)
-----
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
rimoJO
Posts: 200
Joined: Sat Jan 12, 2019 2:23 am

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by rimoJO » Sat Jul 13, 2019 3:20 pm

I've already said this before, but i think the post is lost forever, so i'll say it again:
The attack animation doesn't work.

Code: Select all

    LDA gameHandler
    AND #%00100000
    BEQ notNPCstate_attack
    JMP doneAttacking
notNPCstate_attack:
     LDA weaponsUnlocked
     AND #%00000001
     BNE canAttack
     JMP doneAttacking
canAttack:
    LDX player1_object
    GetCurrentActionType player1_object
    CMP #$03
    BNE notAlreadyAttacking 
    JMP doneAttacking
    
notAlreadyAttacking:
    ;;; don't attack if already attacking.
    ;;; do we have to check for hurt here?
    ;;;;; Here, we WOULD create melee
    ChangeObjectState #$00, #$03
    LDA Object_movement,x
    AND #%00001111
    STA Object_movement,x
    LDA #$00
    STA Object_h_speed_hi,x
    STA Object_h_speed_lo,x
    STA Object_v_speed_hi,x
    STA Object_v_speed_lo,x

    LDA Object_x_hi,x
    STA temp
    LDA Object_y_hi,x
    STA temp1

    LDA Object_movement,x
    AND #%00000111
    STA temp2
    TAY

    LDA Object_x_hi,x
    SEC 
    SBC #$10 ;; width of melee weapon (="16" in decimal = 2 tiles) 
    STA temp
    LDA Object_scroll,x
    SBC #$00
    STA temp3

    LDA temp
    ;;; offset x for creation
    CLC
    ADC weaponOffsetTableX,y
    STA temp
    LDA temp3
    ADC #$00
    STA temp3

    LDA Object_y_hi,x
    CLC
    ADC weaponOffsetTableY,y
    SEC
    SBC #$10 ;; height of melee weapon (1 tile)
    STA temp1   
    
    CreateObject temp, temp1, #OBJECT_PLAYER_MELEE, #$00, temp3
    
meleeCreated:
    ;;;; x is now the newly created object's x.
    LDA Object_movement,x
    ORA temp2
    STA Object_movement,x
    
    ;;;    PlaySound #sfx_slash
    
doneAttacking:
    RTS
Mystery Game status: Currently at least one in development. Stay tuned!
User avatar
CGdfc
Posts: 11
Joined: Sat Jun 08, 2019 12:40 am

Re: [4.1] Use the real Melee object weapon in the Platformer module

Post by CGdfc » Mon Jul 15, 2019 3:26 pm

Does anyone know how to change weapons? for example by pressing select button change from melee to projectile and vice versa.

Dale's two tutorials work very very well (melee and projectile on platforms) but both I want to use B button (A is for jump).
when I press button B it makes the 2 attack at the same time (logical)

I have also noticed that the projectile is always active, it does not matter if unlock or not in Project INFO

any ideas?
Post Reply