Projectile issue with transitioning to new screen [4.1]

Having trouble compiling code? Getting an unexpected error? Player not appearing on screen? Seeking answers on how to do a particular thing? This is the forum you're looking for, to ask other NESmaker users for assistance.
Post Reply
User avatar
chronicleroflegends
Posts: 143
Joined: Thu Sep 06, 2018 3:51 am

Projectile issue with transitioning to new screen [4.1]

Post by chronicleroflegends » Mon Jan 14, 2019 8:04 pm

I have noticed an issue with my projectiles when I move from one screen to another in 4.1.

To prevent lag, I make it where the player can only have a max of 2 projectiles on screen at once.
The problem is ff I leave the screen while the projectile is still moving (not collided with a monster or solid) I lose the projectile forever, it never updates my variable to say the projectile is usable again.

I actually think I know a good fix for this, just not sure where to place it.

Since obviously you are not going to have already created a projectile before you enter a new screen, I was thinking of adding a small bit of code to whatever controls screen transitions to reset the variable to 2 every time you enter a new screen.

Looking at the screen code it looks like this may be handled by multiple scripts though. Any advice over where the best place to put this would be?

I want to reset the projectile count whether the player walks from one screen to another or teleports.
~Do you believe in legends? ~
My Games: Nix: The Paradox Relic
User avatar
chronicleroflegends
Posts: 143
Joined: Thu Sep 06, 2018 3:51 am

Re: Projectile issue with transitioning to new screen [4.1]

Post by chronicleroflegends » Mon Jan 14, 2019 8:49 pm

Answered my own question.

Could only seem to get it to work by updating the 4 'Handle x Bounds' in the defined scripts.
Just added a 2 line reset script to each.
~Do you believe in legends? ~
My Games: Nix: The Paradox Relic
User avatar
dale_coop
Posts: 3090
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Projectile issue with transitioning to new screen [4.1]

Post by dale_coop » Mon Jan 14, 2019 9:00 pm

Thanks for sharing that info.
Might be useful for someone in the same situation (at least for myself at some point ;)).
-----
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)
Post Reply