[4.1] Projectiles in the platform module

dale_coop

Moderator
Staff member
Gilbertmaxter said:
I am actually :)

I am however more interested in using it for a charger to were the laser recharges over time instead of a instant laser pickup i will still use it but i am looking into charging the laser on its own to prevent over shooting

Here's an updated version for 4.1 of my old system of Ammo / charge laser gun:
http://nesmakers.com/viewtopic.php?f=3&t=1736
I will continue, adding an option for the automatic recharge when not using the gun... maybe tomorrow (now I need to sleep almost 1:00AM here :p)
 
that's fine thank you very much for this :)

I am working on it and my only question so far how do I put in the asset or game object into the overworld ?

couldn't figure that out.
 

dale_coop

Moderator
Staff member
dale_coop said:
Gilbertmaxter said:
I am actually :)

I am however more interested in using it for a charger to were the laser recharges over time instead of a instant laser pickup i will still use it but i am looking into charging the laser on its own to prevent over shooting

Here's an updated version for 4.1 of my old system of Ammo / charge laser gun:
http://nesmakers.com/viewtopic.php?f=3&t=1736
I will continue, adding an option for the automatic recharge when not using the gun... maybe tomorrow (now I need to sleep almost 1:00AM here :p)

Here's the automatic recharge system : http://nesmakers.com/viewtopic.php?p=10687#p10687
 

Gaet

New member
Dale thank you so much for this tutorial. I'm only just beginning to play with NES Maker and this was a huge help.
I will now try to make a charging shot (more powerful projectile if you hold B and then release).
 

dale_coop

Moderator
Staff member
Gaet said:
Dale thank you so much for this tutorial. I'm only just beginning to play with NES Maker and this was a huge help.

You're welcome... In fact, I fixed all those for myself, but hey, why not share how I did with everyone :p

Gaet said:
I will now try to make a charging shot (more powerful projectile if you hold B and then release).

Oh nice! The result would be very cool.
 

Gaet

New member
By the way I've been having mixed results when commenting out the 4 lines to allow for a shooting animation:

- When I run, it works exactly as I want it to: my player's "shoot" sprite is showing for 1/10th second as soon as I press A and then disappears
- When I jump, the "shoot" sprite shows when I press A but stays even after I release the button, and only disappears once the player is back on the ground
- When I'm static (standing), the "shoot" sprite never shows when I press A

Do you or does anyone know what I could do about this? And if yes, would you also know how I could call different animations for each of these (i.e. a "run & shoot" animation, a "jump & shoot" one and a "stand & shoot" one).

Thanks again for your work and for sharing it, much appreciated.
 

dale_coop

Moderator
Staff member
Gaet, animations states have always been an issue in NESMaker.
Sorry, don't know yet.
Please make another post for that problem.
 

Mugi

Member
sanity checking the actionstates in a way that all the animations work as expected is a huge pain in the ass to do.
basically you have to fill your input scripts (and/or post controller check script) with checks that if your char is in the air or shooting or X or Y it will have to set and release or dont set and dont release action steps.
you could just ask someone to give you cleaned files but that's largely useless too because in each game the player character behaves differently and has different animations and states so at the end of the day you'll just have to do it yourself in a way that it works for your specific game.
 

dale_coop

Moderator
Staff member
Agree with Mugi (and he knows well ;))
The "problem" is that can't be versatile... these specific cases for animations states when shooting & jumping & facing Up & xxx has to be coded specifically for the game intended.
 

Gaet

New member
Makes complete sense. I just wasn't sure whether I needed to fiddle more with my object details or not, but now I understand it's all in the input scripts.
 

dale_coop

Moderator
Staff member
Yep, because maybe you don't want.need NPC text?... or maybe you want activate them with another button... or under certain conditions, ... ;)
 

dale_coop

Moderator
Staff member
Just found that "ignore gravity" objects are not checking solid collisions... (only screen edge collisions).
So I fixed that.

Modify (or preferred, duplicate the original one) your "TileCollisions.asm" script (in your "GameEngineData\Routines\Basic\ModuleScripts\MainScripts\ScrollingPlatformer" folder) , at line 126, add this line:
Code:
   CheckForHorizontalCollision  ;; <<--- checking solid collisions now
    
   ; JSR updateHorizontalPosition
   ; JSR updateVerticalPosition
 
Thanks, that definitely fixed the issue.

The only problem is I run into slowdown now with the projectile on the screen :\

Wonder if I can gut some other collision checks I don't need to speed things up.
 

ZeGGamer1

New member
For my game, I want to have only two bullets on the screen at any given time, but I don't know how to do that in this version of NES maker, any ideas?

P.S. also, bullets collide with monster barriers, which makes things slightly frustrating.
P.P.S. Bullets, if they kill the enemy, don't destroy themselves, so that might need to be reordered. I've tried, but I don't know how to do that either.
 

dale_coop

Moderator
Staff member
A very simple trick, would be to count “player eeweapon” objects on the screen before creating a new one, if already 2 (or compare with a constant value), don’t create the projectile.


The script could be something like that (adding at the beginning of the b_create_peojectile (just after the “canShoot:” label)... (require a user constant PROJECTILE_MAX with a value of “2”).

Code:
canShoot:
   ;; We count the projectile already on screen to see if can Shoot another one :
   CountObjects #%00000100, #$00   ;; count player weapon on screen
   LDA monsterCounter              ;; the variable used to count is monsterCounter
   CLC
   CMP #PROJECTILE_MAX             ;; compare to 2
   BCC +                    ;; if less than 2 on screen we can create a projectile
   RTS                             ;; else we quit
+
 

DanielT1985

Member
Any way to make an animation play (preferably, the sword animation) when throwing a projectile? It seems weird that there's no animation for the projectile.
 

dale_coop

Moderator
Staff member
DanielT1985 said:
Any way to make an animation play (preferably, the sword animation) when throwing a projectile? It seems weird that there's no animation for the projectile.

Yep you can... what is the action step you want to use? let's say your weapon is the "03".
At the beginning of the projectile, search for the "canShoot:" label, and change it to looks like that:
Code:
canShoot:
	LDX player1_object
	;;; IF YOU WANT TO USE AN SPECIFIC ANIMATION / ACTION STEP WHEN SHOOTING, comment out the following 3 lines: 
	;;; check if already shooting (assuming the shoot action step is 03)
	GetCurrentActionType player1_object
	CMP #$03
	BNE notAlreadyShooting
	JMP wasAlreadyShooting 
notAlreadyShooting
	;;; IF YOU WANT TO USE AN SPECIFIC ANIMATION / ACTION STEP WHEN SHOOTING, comment out the following 1 line: 
	;;; if not already shooting, change it's action step (assuming the shoot action step is 03)
	ChangeObjectState #$03, #$02
	
;; THE REST FROM HERE
 

DanielT1985

Member
It says "Routines\Basic\ModuleScripts\InputScripts\b_create_projectile_platformer.asm(61):CreateObject(26): Unknown label"
 
Top Bottom