Player Projectile Issues

SerafukuSoftware

New member
I've been scratching my head trying to get my player to shoot projectiles in the adventure module, and I believe I've set up most of steps correctly, however I must be missing something and it doesn't seem to be working. I'll try to explain what I've done so far in written steps, and if anyone could help me fill in the gaps and correct me, I'd be very much thankful ^^

1. added the b_create_proj_simple input script to my input editor and configured it to when you Press the B-button/Target = NULL/Game State = MainGame
2. set OBJECT_PLAYER_PROJECTILE = "2" to correspond to my Projectile Source Game Object.
3. set SPR_WEAPON_V = "9" (9th tile in my ObjectTIles.bmp)
4. set SPR_WEAPON_H = "10" (10th tile in my ObjectTiles.bmp)
5. Projectile Source Object Details:
* Player Weapon ticked *Max Speed = 200
* SOR set to "Destroy Me" *Acc Speed = 200
* EOR set to "Destroy ME" *Set bounding box
* Ignore Gravity
Are there any action steps I need to set for the Projectile Source?
7. Adjusted Projectile Offsets accordingly to suit my Player Sprite.
6. "Player" object details:
Do I set action step #3 to "6 - Shoot Forward" or am I supposed to do that with the Projectile Source?

compiling and executing the game achieves no results, when B button's pressed Player doesn't shoot. What am I missing?
I apologise if this is written up in a weird way but I will try to explain more.
 

dale_coop

Moderator
Staff member
You don't need 3 and 4 (it's for settings the Sword, not the projectiles).
You don't need the 6, it's a Monster action. For the player, keep "loop" in Action.

Don't use the b_create_projectile_simple... it's an example of code. I am not sure the code is all correct.
Prefer using the a_create_projectile.asm script that is in the "Routines\Basic\ModuleScripts\InputScripts\Adventure" folder.

Now... in the Adventure module, you need to give/unlock the projectile (like for the sword) to your Player.
You can do that with a Npc, give an item, magic.
Or just set/check the "Weapon 2 unlocked" in your project Infos, if you want your player has the ability to shoot at start.
 

SerafukuSoftware

New member
dale_coop said:
You don't need 3 and 4 (it's for settings the Sword, not the projectiles).
You don't need the 6, it's a Monster action. For the player, keep "loop" in Action.

Don't use the b_create_projectile_simple... it's an example of code. I am not sure the code is all correct.
Prefer using the a_create_projectile.asm script that is in the "Routines\Basic\ModuleScripts\InputScripts\Adventure" folder.

Now... in the Adventure module, you need to give/unlock the projectile (like for the sword) to your Player.
You can do that with a Npc, give an item, magic.
Or just set/check the "Weapon 2 unlocked" in your project Infos, if you want your player has the ability to shoot at start.

Thank you very much for correcting me, Dale! Great News is I've gotten a bit further now and Projectiles are technically working. However my player freezes in place when I shoot a projectile, I can still change its direction but I cannot shoot another projectile afterwards.
 

dale_coop

Moderator
Staff member
Check your sounds (SFX)... you might need to assign a sound to the "SND_SHOOT" sfx. If you don't have sounds yet, you could try just commenting out the line "PlaySound #SND_SHOOT" to see if this is really the cause of your issue.
 

SerafukuSoftware

New member
dale_coop said:
Check your sounds (SFX)... you might need to assign a sound to the "SND_SHOOT" sfx. If you don't have sounds yet, you could try just commenting out the line "PlaySound #SND_SHOOT" to see if this is really the cause of your issue.

I've quoted out the PlaySound #SND_SHOOT, and unfortunately it appears to have made no difference, sorry Dale
 

dale_coop

Moderator
Staff member
Might be something incorrect with the settings somewhere... of your player or your projectile.

Your projectile should be "player weapon", a speed and a acceleration, SOR and EOF to "destroyMe", a bounding box and that's all (nothing to change in actions steps: keep them all loop and no flags set, for the adventure game)

Your player, should have his action step 3 (this one is used by the shoot script) to "GoToFirst" for end of action, with a timer value of "1" (or end of animation and a animation speed if you have a particular animation for shooting).

Else could you share your NESMaker folder zipped? (in fact would just need your project .MST file and your GraphicAssets and GamaEngineData folders).
 

SerafukuSoftware

New member
dale_coop said:
Your player, should have his action step 3 (this one is used by the shoot script) to "GoToFirst" for end of action, with a timer value of "1" (or end of animation and a animation speed if you have a particular animation for shooting).

That is the part that I completely forgot about, and now that I've added it in it's fixed everything! Thank you so much for your help, Dale. Very much appreciated. :D
 
Top Bottom