So I am making a game, similar to Castlevania, but with guns! I added 4 animations for each weapon. When the character collides with the weapon, how do I make it so that when the character clicks a button it shoots that weapon he picked up, and when it runs out of ammo, it switches back to the starter weapon. I also have a problem when you shoot. When you shoot, the character stays on the first frame, then when I move it continues the animation. I would like it so that when the character is stationary, it plays the animation without pausing on a frame. I am new to MMF2 so please explain everything as well as you can! Thank you guys! :D:D
How to use different weapons?
Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.
Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!
Clickteam.
-
-
Hello and welcome to the forum TurtleLord!
There are many, many ways in fusion to accomplish what you're talking about.To determine the best way to approach this, main things you'd have to clarify are:
1) wether the player can hold multiple weapons in its "inventory" and switch between them, or if he can carry only one weapon at a time
2) if with "starter weapon" you intend "previously picked weapon" or "basic-crappy starting weapon" XD
in case of "only one weapon at time" setup:
3) do you plan to "reset" ammo count to zero on every weapon switch, or keep track of last ammo count for each weapon on switching?As for the animation problem, I've hard times understanding the issue:
-does the animation "shooting" correctly plays?
-or does it plays for too long/short?
-or does it continue playing even after you've moved again?
-or do you want your player to shoot while walking?I LOVE Castlevania games, hope you best luck with your project
-
Hello Shrodinger! Sorry it took a while to get back to you. I have created a YouTube video on the animation problem. Also, would you mind telling me how to do the weapon select. I would like there to be a different amount of ammo in each weapon. Thank you!
Here is the link Please login to see this link.
-
Oh, I see, the animation stops without apparent reason.
Does this happen randomically / or does this always happens at same moment?
I'm sorry but it's difficult to tell only from the video. Uploading an .mfa will greatly help.
At first sight, it seems something that has to do with your coding of animation changes in the event editor.For different ammo/different weapon:
I'd say for a good beginning and understanding a very key Fusion feature, you could use your main player's alterable values.
In frame editor, click your player's animation, and then click the "A-Z" tab under "Properties".
You will see "alterable value A"
double click it and name it "my_weapon"
now click "new"
and create another variable named "shotgun_ammo"
and so on, for all your weapons.
Remember the order in which you place them,
because we will retrieve them by ther value index.Now in the event editor add these three different "class" of conditions:
1) picking weapon
Player collides with object "Shotgun"
>>> set alterable value "my_weapon" to 1replicate for each pickable bonus weapon,
remember that Alterable string C will be no. 2, and so on.2) shooting
Player press fire 1
+ my_weapon > 0
+ alterable value (altval "player",0) > 0
(this could be a little tricky to setup, just do exactly this: add the condition and rightclick your player,
click "alterable values", click "compare to one of the alterable values", click "use expression" on top right, rightclick your player, click values-alterable values by index, write "0" in "enter value here", click Ok, select "greater", click OK.... phew!)
>>> set internal flag 0 of player on, subtract 1 from alt. value ----> alterable value (altval "player",0) as we did before
(all this to save you from coding each weapon one by one!)Player press fire 1
+ alterable value (altval "player",0) = 0
>>> set my_weapon to 0, set internal flag 0 of player on
(this is to reset to base weapon)Player press fire 1
+ my_weapon= 0
>>> set internal flag 0 of player on
(this is to shoot with base weapon)3) launching the correct bullet
Player flag 0 is on
+my weapon=0
>>>> set player flag 0 off, shoot "crappy base gun bullet"Player flag 0 is on
+my weapon=1
>>>> set player flag 0 off, shoot "shotgun bullet"Player flag 0 is on
+my weapon=2
>>>> set player flag 0 off, shoot "other weapon bullet", etc. etc.replicate for each weapon
And you're done! XD
I think this could be hard to follow in some parts,
but it's quick enough to code and may be a good beginning for understanding key mechanics of Fusion -
Ok thanks! I will upload a .mfa file!
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!