Attack seems to be tied to jumping?

red moon

Member
I setup the attack and set my melee object as well as the input script and assigned the input however, it appears to deal damage when the player is jumping. The B button does not initiate the animation that is in the list object as intended. I did set the user constant to match the block 10 on the player sheet as well. I feel like i am close at least!
If anyone notices anything out of place, please let me know.
Thanks again!


Also, I have the enemy pickup dropping as intended but it disappears really quickly; I did try adjusting the timer associated to the object's details but did not see a difference.

https://youtu.be/CptTxeKr1vs
 

Attachments

  • attack1.jpg
    attack1.jpg
    696.6 KB · Views: 960
  • attack2.jpg
    attack2.jpg
    864.2 KB · Views: 960
  • attack3.jpg
    attack3.jpg
    708 KB · Views: 960
  • attack4.jpg
    attack4.jpg
    569 KB · Views: 960
  • attack5.jpg
    attack5.jpg
    1.1 MB · Views: 960
  • attack6.jpg
    attack6.jpg
    917.4 KB · Views: 960

red moon

Member
I see that the adventure script contains code relating to the text box being initiated and seems to call out "Attacking" rather than "Sword", I suspect this is part of the issue.
 

dale_coop

Moderator
Staff member
Hmmm...
Here I think you can't use the "b_create_melee.asm" script from the Adventure module... because in the Adventure module, the melee is associated with the Action Step 2. But in the Platformer module, attack is Action Step 3.


You could duplicate the "b_create_melee.asm" script to your "Basic\ModuleScripts\InputScripts\SimplePlatformer" folder, and edit that script, then replacing the (line 54):
Code:
	CMP #$02
by:
Code:
	CMP #$03


And the (line 61):
Code:
	ChangeObjectState #$02, #$02
by:
Code:
	ChangeObjectState #$03, #$02
(keep the 02 for the last parameter, here... it's basically the animation speed)
 

red moon

Member
Thanks Dale,
I went ahead and applied those changes but could not get the attack to trigger. I can no longer destroy enemies by jumping into them so that is a step in the right direction at least!
 

Attachments

  • change1.jpg
    change1.jpg
    684.3 KB · Views: 943
  • change2.jpg
    change2.jpg
    839 KB · Views: 943

dale_coop

Moderator
Staff member
Also, make sure you check the "Weapon 1 unlocked" in the project "Info" dialog, to activate this skill:

2019-10-03-23-54-09-Initial-Data.png
 

red moon

Member
That was it...
Good call Dale!!!

I went ahead and experimented with the object variable and set the loop to go to first and adjusted the animation speed, adding some animation frames so the hold is long after button press.

This is great, I am happy that this element is working now!

One odd thing however, the melee sprite seems to be locked into sub palette 2. I did some tests and was able to change the palettes of other game objects-player death, enemy death, health pickup, invincibility...I can set any of these objects to sub palette 1 or 2 but this is not the case or the melee object. I am wondering if there is something in the plat-former handle sprite weapon code that has it set to SUB 2.

https://youtu.be/h6rNej1xoTM
 

Attachments

  • punchsprite.jpg
    punchsprite.jpg
    632.3 KB · Views: 913

dale_coop

Moderator
Staff member
For the sprite based melee weapon... the sub-palette is barcoded in the Pre-Draw script.
Modify the script assigned to "Handle Pre-Draw" element in "Project Settings > Script Settings".


Let me see... how to modify it correctly.
 

dale_coop

Moderator
Staff member
Modify the "Handle Pre-Draw" script... Around the end of the script, you will see that bloc of code:

Code:
;; it is right, which means draw without flip
	 LDA #%00000001
	 STA temp2
	 JMP doDrawWeapon
directionIsNotRightForDrawingWeapon:
	LDA #%01000001
	STA temp2

In this code, replace the values like this:

Code:
;; it is right, which means draw without flip
	 LDA #%00000000	;; use the sub 1 palette
	 STA temp2
	 JMP doDrawWeapon
directionIsNotRightForDrawingWeapon:
	LDA #%01000000	;; use the sub 1 palette
	STA temp2
 

red moon

Member
That did it! Thanks for the code and the explanation, that helps for sure!

I would like to try to get the projectile working soon, as you explained before the script that determines input for the B button needs to be modified since the script and input are already setup to attack and have a sprite associated and animation to that attack. I am guessing the code needed would be tied to pressing up to trigger the projectile and and choosing the projectile sprite instead of the melee sprite?
 

dale_coop

Moderator
Staff member
It's not exactly that.

The projectile script is another script (cf the Community Tutorials section for the tutorial).. here: http://nesmakers.com/viewtopic.php?f=35&t=1703
It will create a real game object (because an object can move... the sprite based weapon can't). And that script will be assigned to your "B" press (exactly like the create melee one currently is... ).

But in your case, this projectile script will be modified, in order to create the projectile object ONLY if the "Up" direction is pressed on the gamepad (we will add that to the script, not to the Input Editor assignments).

First... I'd suggest to follow the tutorial and make the projectiles work. (when you'll press B, both will be executing... it's ok) Then, we'll modify the script as I explained previously ;)
 

red moon

Member
Dale,
I went ahead and went through your link and added the projectile changes suggested in that thread. It does work, however the position is above the player and it does not mirror the sprite when shooting to the left. Its a good start at least

https://youtu.be/CZ3dyFPjwlw
Thanks again for the link to the previous shooting thread!
 

Attachments

  • newshoot.jpg
    newshoot.jpg
    561.9 KB · Views: 437

dale_coop

Moderator
Staff member
To set the offsets for the "projectile", click on the "Melee" buton until it displays 'Projectile":

newshoot.jpg
 
Top Bottom