Create Projectile doesn't work in platform module?

Post Reply
User avatar
Imagaryboy
Posts: 18
Joined: Mon Aug 20, 2018 9:05 am
Location: Cologne

Create Projectile doesn't work in platform module?

Post by Imagaryboy » Fri Aug 31, 2018 10:50 am

I'm trying to add the ability to shoot in my platform game, but the "create projectile"-script from the adventure module doesn't work in the platform module.
I found the "shoot weapon"-script in the platform module, but that one just gives me those errors:

Routines\UserScripts\PlatformGame_Base\InputScripts\shootWeapon.asm(28): Unknown label.
Routines\UserScripts\PlatformGame_Base\InputScripts\shootWeapon.asm(37): Unknown label.

Not sure what to do now...
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Create Projectile doesn't work in platform module?

Post by WolfMerrik » Fri Aug 31, 2018 12:50 pm

The compiler errors want us to look at lines 28, and 37 of shootWeapon.asm (the script in question)
It seems there is a problem with the label preventShooting as not being defined.

So if we define it, and set it so that our code knows when we can shoot or not, it should work
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Create Projectile doesn't work in platform module?

Post by WolfMerrik » Fri Aug 31, 2018 12:54 pm

Try adding this line to Routines\Variables\SystemVariables.asm

Code: Select all

preventShooting .dsb 1
It should at least get you to compile
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
Imagaryboy
Posts: 18
Joined: Mon Aug 20, 2018 9:05 am
Location: Cologne

Re: Create Projectile doesn't work in platform module?

Post by Imagaryboy » Fri Aug 31, 2018 1:04 pm

Yeah, it compiles now but when I press the assigned shoot button, it only creates the melee game object once without any movement, even though I set movement speed in object details...
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Create Projectile doesn't work in platform module?

Post by WolfMerrik » Fri Aug 31, 2018 1:11 pm

Imagaryboy wrote:
Fri Aug 31, 2018 1:04 pm
Yeah, it compiles now but when I press the assigned shoot button, it only creates the melee game object once without any movement, even though I set movement speed in object details...
I believe that the object it is creating is from this line

Code: Select all

CreateObject temp,temp1,#$01, #$00
Have you tried changing this to be to the object you want to create? I believe the "Projectile Object" (in the default game objects) would be #$03,
Although it should not really matter which object you use, as long as the object itself if setup right.
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
Imagaryboy
Posts: 18
Joined: Mon Aug 20, 2018 9:05 am
Location: Cologne

Re: Create Projectile doesn't work in platform module?

Post by Imagaryboy » Fri Aug 31, 2018 1:15 pm

That's what I was thinking as well. But I guess the projectile movement has to be defined within the "ShootWeapon"-script
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Create Projectile doesn't work in platform module?

Post by WolfMerrik » Fri Aug 31, 2018 1:29 pm

One thing that might make it easier for testing,
add this to the beginning of the shootWeapon.asm script

Code: Select all

LDA #$00
STA preventShooting
This will make it so you can shoot regardless basically, as it sets the preventShooting to false,
you will want to of course change what prevents you from shooting elsewhere,
but it will let you continuously shoot, and make changes to the creation of the projectile.
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
Imagaryboy
Posts: 18
Joined: Mon Aug 20, 2018 9:05 am
Location: Cologne

Re: Create Projectile doesn't work in platform module?

Post by Imagaryboy » Fri Aug 31, 2018 1:45 pm

Oh thanks, that worked!
But I am not able to change the projectile offset. The projectile always spawns at the top right tile of the player object and too far away from the player.
User avatar
WolfMerrik
Posts: 199
Joined: Sat Aug 11, 2018 4:59 pm
Location: Maine
Contact:

Re: Create Projectile doesn't work in platform module?

Post by WolfMerrik » Fri Aug 31, 2018 2:02 pm

I believe that script does not define any offset, It was likely unfinished, and why it didn't make it into the tutorial.
Take a look at the adventure games a_create_projectile.asm, that used the offsets and I believe that even had them commented where it does in the script
ImageWant to download & share Image NESMaker Resources? Check out My Files on www.NESMakerFiles.com Image
User avatar
Imagaryboy
Posts: 18
Joined: Mon Aug 20, 2018 9:05 am
Location: Cologne

Re: Create Projectile doesn't work in platform module?

Post by Imagaryboy » Sun Sep 02, 2018 1:34 pm

WolfMerrik wrote:
Fri Aug 31, 2018 2:02 pm
I believe that script does not define any offset, It was likely unfinished, and why it didn't make it into the tutorial.
Take a look at the adventure games a_create_projectile.asm, that used the offsets and I believe that even had them commented where it does in the script
Do you have any idea how we can make the projectile script from the adventure module work in the platform module? I want to set up an Item that gives the player the ability to shoot, and this mechanic is already built into the script from the adventure module.
Post Reply