how would you make a projectile weapon

Logana

Well-known member
i just need help understanding how to make a projective weapon for the adventure game im making because i wanna add a boomerang because it will add verity of attack methods in my game
 

dale_coop

Moderator
Staff member
If you want again the Adventure tutorial videos, you will see that the module allow to use a "magic" (a ball projectile), using the a_create_projectile.asm input script.
 

Logana

Well-known member
I know but for some reason when ever I use the script it instantly just resets the game for some reason
 

dale_coop

Moderator
Staff member
Have you made any modification in the script?
Could you share the script you use? Could you share screenshots of your "Input Editor" window (how you assigned the scripts to buttons)?
 

dale_coop

Moderator
Staff member
Also how is your "OBJ_PLAYER_PROJECTILE" constant value (in "Project Settings > User Constants")?
And how have you set the projectile object itself? its action step 0 for example?
 

Logana

Well-known member
I haven't changed any scripts from what they were when I got nesmaker except the sprite weapon script
 

dale_coop

Moderator
Staff member
Ok,

Could you share the script you use? Could you share screenshots of your "Input Editor" window (how you assigned the scripts to buttons)?
And how is your "OBJ_PLAYER_PROJECTILE" constant value (in "Project Settings > User Constants")?
And how have you set the projectile object itself? its action step 0 for example?
 

Logana

Well-known member
this is the scripted I used for the sprite weapon http://nesmakers.com/viewtopic.php?f=35&t=1738
 

Logana

Well-known member
and its action set is to play animation at speed 1 loop ,action null, and a 1 second timer where at the end it destroys itself
 

dale_coop

Moderator
Staff member
So, your "OBJ_PLAYER_PROJECTILE" constant value is not correct... it should be "1" or "2", depending of which object you want to use as your projectile :

2020-04-02-17-39-28-NES-MAKER-4-1-5-Version-0x159-Adv-MST.png

(on that screenshot, you can see I use the object "1" as my projectile... so I will set "1" for the OBJ_PLAYER_PROJECTILE constant)
 

Logana

Well-known member
but what if I want to have 2 weapons 1 magic and 1 melee also it didn't stop reseting the game
 

dale_coop

Moderator
Staff member
For an adventure game, if 1 magic and 1 melee, assign each script to different button "A" and "B", for example.
Resetting the game?

- Could you share screenshots of your "Input Editor"?

- Also to test that your projectile "works", set your Projectile's object actions steps to "nul"l, ends "loop", "0" for timer and speed.... we want the projectile is displayed (not destroyed too quickly). When this will work you can experiment as you want ;)


You must have made an error somewhere.
 

Logana

Well-known member
by reseting I mean it spawns the projectile for 1 frame then sends me back to the title screen like I had just started testing the game
 

Logana

Well-known member
also here is screen shot
 

Attachments

  • Annotation 2020-04-02 162939.png
    Annotation 2020-04-02 162939.png
    408.4 KB · Views: 499

Logana

Well-known member
I figured out the issue I was treating the melee and projectile as two separate things
 

dale_coop

Moderator
Staff member
??? Sorry, I don't understand.
Projectile and Melee are two different things (by default).

In my game I don't use any Melee weapon, I have/use only projectiles.
Maybe YOUR projectile object is the object "2"...
You don't have to do exactly like my screenshots... the important thing on my image is that game objects have ID's (from 0 to 15) to identify them. Set the constant with the correct values, accordingly.
All depends of how you set YOUR objects.
 
Top Bottom