Create Projectile doesn't work in platform module?

dale_coop

Moderator
Staff member
Because it’s using the preventShooting variable.
Either comment the lines related to "preventShooting" (means comment lines 27, 28 and lines 35, 36), in the original script.
Or add at the beginning the script:
Code:
  LDA #$00
  STA preventShooting
 

Nintend0Nerd

New member
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!
 

dale_coop

Moderator
Staff member
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:
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.
 

Nintend0Nerd

New member
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:
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
 

DanielT1985

Member
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?
 

DanielT1985

Member
DanielT1985 said:
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.
 

dale_coop

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

;)
 

dale_coop

Moderator
Staff member
And to give your player the weapons, from the beginning, just check in the Project > Infos,to have them by default (cf the adventure tutorial).

Can I ask you... did you watch the tutorial videos? ;)
 

DanielT1985

Member
dale_coop said:
And to give your player the weapons, from the beginning, just check in the Project > Infos,to have them by default (cf the adventure tutorial).

Can I ask you... did you watch the tutorial videos? ;)

I have. I tried following what they did for the Melee weapon in the Adven. Tutorial, but nothing seemed to work. I have him shooting, the weapon is going in the direction my character's pointing at, but it doesn't seem to kill the enemy I placed. Also, I tried to look through the thread to see what to do, position wise on the item, but I can't find a clear answer on that.
 

DanielT1985

Member
dale_coop said:
And to give your player the weapons, from the beginning, just check in the Project > Infos,to have them by default (cf the adventure tutorial).

Can I ask you... did you watch the tutorial videos? ;)

Okay, so one thing I now know is that Monster Weapon, which is what I had it set to, will not let you kill the enemy with the Projectile. So having it set to just Monster and not turning on Jump On Kills will make it so you need the projectile to kill the enemy. Now all I need to learn is positioning the projectile.
 

DanielT1985

Member
DanielT1985 said:
dale_coop said:
And to give your player the weapons, from the beginning, just check in the Project > Infos,to have them by default (cf the adventure tutorial).

Can I ask you... did you watch the tutorial videos? ;)

Okay, so one thing I now know is that Monster Weapon, which is what I had it set to, will not let you kill the enemy with the Projectile. So having it set to just Monster and not turning on Jump On Kills will make it so you need the projectile to kill the enemy. Now all I need to learn is positioning the projectile.

Another thing weird is that the enemy will both turn into my health pickup AND produce a fireball. IDK what to do with that.
 

dale_coop

Moderator
Staff member
So one thing I now know is that Monster Weapon, which is what I had it set to, will not let you kill the enemy with the Projectile
Might be your mistake, your player's projectile object needs to be a "Player Weapon" ("Player Weapon" type objects will hurt monsters, as "Monster weapon" ones will hurt the player).

So having it set to just Monster and not turning on Jump On Kills will make it so you need the projectile to kill the enemy
When you set the "Jump On Kills" flag for your monsters, it just means your monster will be killed if the player jumps on it (like in super mario bros).

Another thing weird is that the enemy will both turn into my health pickup AND produce a fireball. IDK what to do with that.
When you kill a monster, it gives you a "Health object" or a "Currency object" or nothing. And it will create a "Effect 1" object (for example, in the tutorial, a pow! when it dies).
Currenlty, in your project, it seems you haven't configured yet those objects ("Health object", "Currency object" and "Effect 1").
Note: the head (the first tile of your tileset) is the empty tile. When not configured and object is just an empty tile.
 

DanielT1985

Member
dale_coop said:
So one thing I now know is that Monster Weapon, which is what I had it set to, will not let you kill the enemy with the Projectile
Might be your mistake, your player's projectile object needs to be a "Player Weapon" ("Player Weapon" type objects will hurt monsters, as "Monster weapon" ones will hurt the player).

So having it set to just Monster and not turning on Jump On Kills will make it so you need the projectile to kill the enemy
When you set the "Jump On Kills" flag for your monsters, it just means your monster will be killed if the player jumps on it (like in super mario bros).

Another thing weird is that the enemy will both turn into my health pickup AND produce a fireball. IDK what to do with that.
When you kill a monster, it gives you a "Health object" or a "Currency object" or nothing. And it will create a "Effect 1" object (for example, in the tutorial, a pow! when it dies).
Currenlty, in your project, it seems you haven't configured yet those objects ("Health object", "Currency object" and "Effect 1").
Note: the head (the first tile of your tileset) is the empty tile. When not configured and object is just an empty tile.

Well knowing that it will always spawn Effect 1, and since I followed the platform tutorial, Effect 1 is the Fireball producer entity. So I Exported that and imported it as Effect 3, made Effect 1 blank (Which I was able to use to my advantage by making a "poof" effect that was also shown in the Platform tutorial) and there we go, that problem is solved. So how do I configure the health and currency objects to make them stop appearing?
 

dale_coop

Moderator
Staff member
You could comment the related (« createobject ») lines in the handlemonsterdrops.asm script :p
 

DanielT1985

Member
dale_coop said:
You could comment the related (« createobject ») lines in the handlemonsterdrops.asm script :p

Oh yeah, looking through this it shows it's spawning #$04 and #$07. #$04 is the Health pickup and #$07 is the Currency pick up. Thank you so much for helping me with this.
 
Top Bottom