Create Projectile doesn't work in platform module?

Post Reply
User avatar
Nintend0Nerd
Posts: 44
Joined: Tue Sep 25, 2018 4:33 pm
Location: Illinois

Re: Create Projectile doesn't work in platform module?

Post by Nintend0Nerd » Thu Sep 27, 2018 11:42 am

What do you mean by commenting a line?
User avatar
Tishero
Posts: 7
Joined: Tue Sep 18, 2018 6:00 pm

Re: Create Projectile doesn't work in platform module?

Post by Tishero » Thu Sep 27, 2018 12:29 pm

Commenting a line means putting ; before any line of code so nes maker can ignore it
User avatar
Nintend0Nerd
Posts: 44
Joined: Tue Sep 25, 2018 4:33 pm
Location: Illinois

Re: Create Projectile doesn't work in platform module?

Post by Nintend0Nerd » Thu Sep 27, 2018 12:37 pm

Ah, gotcha. Thanks!
User avatar
Nintend0Nerd
Posts: 44
Joined: Tue Sep 25, 2018 4:33 pm
Location: Illinois

Re: Create Projectile doesn't work in platform module?

Post by Nintend0Nerd » Fri Sep 28, 2018 1:24 am

I got a few more questions about the shooting script. Just a few more and I'll be done! :D

1. Is there a way to make it so that the script waits to throw the projectile until the throwing animation is done? I think the Adventure Projectile scripts does this. I took a look, but got kinda confused. Putting learning assembly basics on my to do list soon.

2. Is there a way to make it so that my character stops when throwing? For instance, if he's walking and the throw button is pressed, his speed is set to 0 (and also make it so it doesn't apply when he's in the air).

3. When my character throws right, the projectile spawns at the perfect spot. However, when he throw left, it spawns a few tiles in front of him. Do you know what would be causing that?

Sorry for so many questions. I really appreciate you guys helping me out. I've only been on the forums a few days and it's amazing how friendly and supportive you all are to a newbie like me! Thanks!
User avatar
dale_coop
Posts: 1612
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Create Projectile doesn't work in platform module?

Post by dale_coop » Fri Sep 28, 2018 6:12 am

1/ not easy, I think it would require too much code, than just tweaking the current script.
2/ yeah, it used to be like that. Just in comment or remove my lines:

Code: Select all

CMP #$01
 BEQ continueShooting
(put a « ; » before the line to comment it)
3/ take a look on this topic about the same questions for the adventure module...
http://nesmakers.com/viewtopic.php?f=23&t=836
I suggest you to read, and try to take some parts of that code to adapt your shootingWeapon script.
Doesn’t hesitate if you have issues, I would help you.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
Nintend0Nerd
Posts: 44
Joined: Tue Sep 25, 2018 4:33 pm
Location: Illinois

Re: Create Projectile doesn't work in platform module?

Post by Nintend0Nerd » Fri Sep 28, 2018 2:01 pm

Thanks
User avatar
Nintend0Nerd
Posts: 44
Joined: Tue Sep 25, 2018 4:33 pm
Location: Illinois

Re: Create Projectile doesn't work in platform module?

Post by Nintend0Nerd » Sat Sep 29, 2018 5:38 pm

I got the positioning right! So that's good! However, for the stopping when throwing problem, I don't have

CMP #$01
BEQ continueShooting

in my script. My scripts currently looks like this:

Code: Select all

LDA #$00
STA preventShooting

LDX player1_object

    LDA Object_movement,x
    AND #%00000111
    ORA #%00000010  
    STA temp3
    CMP #%000000010
    BNE notRightForProjShoot
    LDA Object_x_hi,x
    CLC
    ADC #$18
    STA temp
    JMP gotDirForShoot
notRightForProjShoot:
    LDA Object_x_hi,x
    ;;; offset x for creation
    CLC
    ADC #$01    ;;<<-- horizontal offset of your weapon from your player/monster (change the value to adjust)
    STA temp
gotDirForShoot:
    LDA temp3
    TAY
    LDA DirectionMovementTable,y
    ORA temp3
    STA temp3
    

LDA Object_y_hi,x
CLC
ADC #$08  ;; height pixels lower
STA temp1
LDA preventShooting
BNE +
ChangeObjectState #$03, #$08

CreateObject temp,temp1,#$01, #$00
    LDA temp3
    STA Object_movement,x

LDA #$01
STA preventShooting
+
RTS 
User avatar
DanielT1985
Posts: 61
Joined: Sat Sep 01, 2018 7:44 pm

Re: Create Projectile doesn't work in platform module?

Post by DanielT1985 » Fri Oct 05, 2018 6:52 pm

I've gotten my character to shoot the projectile, but like what other people were having a problem with, they can't fix the position of where it throws. And for me, I can't seem to kill enemies with my weapon, even though I set the enemy to be killed via the projectile itself. And also, when I try walking, and then hold the B button to run, my character is stuck in its idle animation. So is there a way to make the player shoot the projectile without changing the player's animations?
User avatar
DanielT1985
Posts: 61
Joined: Sat Sep 01, 2018 7:44 pm

Re: Create Projectile doesn't work in platform module?

Post by DanielT1985 » Fri Oct 05, 2018 6:53 pm

DanielT1985 wrote:
Fri Oct 05, 2018 6:52 pm
I've gotten my character to shoot the projectile, but like what other people were having a problem with, they can't fix the position of where it throws. And for me, I can't seem to kill enemies with my weapon, even though I set the enemy to be killed via the projectile itself. And also, when I try walking, and then hold the B button to run, my character is stuck in its idle animation. So is there a way to make the player shoot the projectile without changing the player's animations?
Also, if you're wondering, I want my character to have the projectile right at the start of the game. Not a powerup, but an actual thing the character can do right from the get-go, which I was able to do, but again, having the problems just like I listed.
User avatar
dale_coop
Posts: 1612
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Create Projectile doesn't work in platform module?

Post by dale_coop » Fri Oct 05, 2018 7:14 pm

The answer is just in this post, on the previous page:
http://nesmakers.com/viewtopic.php?p=6574#p6574

;)
Last edited by dale_coop on Fri Oct 05, 2018 7:22 pm, edited 1 time in total.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
Post Reply