YesNoOk
avatar

MegaMan help: Switchable weapons system (Read 474 times)

Started by RedDragonCats17, February 17, 2019, 11:35:36 am
Share this topic:
MegaMan help: Switchable weapons system
#1  February 17, 2019, 11:35:36 am
  • ***
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
So this is something new that I planned a long time ago. I was thinking about having the ability to switch weapons/techniques (if you're Maverick Hunter Zero and Omega Zero)/models (if you're Model X and Model ZX), and I knew it was going to be a tricky thing to do. While I already did Model OX as a transformation for Model ZX, the other biometals for Model X are going to be a little more ridiculous.

Starting with MegaMan Zero, since he's going to be first. If you go back to my thread on the Shield Boomerang, I (think) said that I'm using B as a means to test the weapon. Now I want to use B to switch weapons, and Z to use them (the Triple Rod is the only weapon that's on Z as of now).

There is another weapon I have in mind, but I didn't work on it because I have to make this first, and that's the Recoil Rod. I'll work on that by myself.

So, how can I make Zero switch his weapons?
Last Edit: February 24, 2019, 12:29:39 pm by RedDragonCats17

ink

Re: MegaMan help: Switchable weapons system
#2  February 22, 2019, 12:57:26 pm
  • ****
  • inktrebuchet
    • USA
    • s236.photobucket.com/albums/ff271/inktrebuchet/?
So, how can I make Zero switch his weapons?
This isn’t the kind of question that gets much help in this section. It’s not specific on what you are looking for, like asking how do I make a character.

I’m not super familiar with these characters or weapons but it sounds like you just need a variable to change if you press “B”, you could use explods, helper or var for something like that. Did you want these weapon changes to have a menu to choose them from? There’s not much info here..

Have you started any code for this yet? That usually gets people helping.


The simplest way is to use a var that changes between 1 and 3 when “b” is pressed.


Last Edit: February 22, 2019, 04:04:24 pm by ink
Re: MegaMan help: Switchable weapons system
#3  February 24, 2019, 12:55:31 am
  • ***
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
The way how it works is kinda similar to (I believe) the NES MegaMan games, but idk where it originates, it's just a educational guess. There is no menu (although the NES games do allow you to pause to switch weapons as well), you press B in game, and the weapon switches immediately. A icon of the weapon appears on top of the characters' head, meaning that the weapon is ready to be used. As MegaMan Zero, you start with the Triple Rod, but you can switch to the Recoil Rod and the Shield Boomerang.

For the icon, I'm just gonna use a black square with a letter of the weapon as a placeholder, until I get the money to get sprites commissioned (if I get my driver's license).

ink

Re: MegaMan help: Switchable weapons system
#4  February 24, 2019, 02:31:51 am
  • ****
  • inktrebuchet
    • USA
    • s236.photobucket.com/albums/ff271/inktrebuchet/?
Yes, the simplest way is to use a var that changes between 1 and 3 when “b” is pressed. Then you can have that var to trigger explods for the icons.

Any changestate that uses the first weapon would have var(#) = 1. The second weapon var(#) = 2 , etc.
Re: MegaMan help: Switchable weapons system
#5  February 24, 2019, 05:35:40 am
  • ***
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Like this?

Spoiler, click to toggle visibilty

ink

Re: MegaMan help: Switchable weapons system
#6  February 24, 2019, 05:48:27 am
  • ****
  • inktrebuchet
    • USA
    • s236.photobucket.com/albums/ff271/inktrebuchet/?
Test it in a character. If it doesn’t work the way you expect it to, try and figure out why. Come back with questions if you can’t solve it.

That’s the idea though. You may have to work on your triggers.
Re: MegaMan help: Switchable weapons system
#7  February 24, 2019, 06:35:33 am
  • ***
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
It doesn't seem to work on the Triple Rod or the Recoil Rod, but it does seem to work on the Shield Boomerang. Strange.
Re: MegaMan help: Switchable weapons system
#8  February 24, 2019, 12:15:15 pm
  • *****
  • Shame on you!
    • USA
[State 0, VarSet]
type = VarSet
trigger1 = command = "b"
v = 13
value =ifelse(var(13)=0,1,(ifelse(var(13)=1,2,0)))
ignorehitpause = 1
vVv Wheat Stage Released vVv
Re: MegaMan help: Switchable weapons system
#9  February 24, 2019, 12:30:00 pm
  • ***
    • USA
    • Skype - reddragoncats17
    • reddragoncats17.weebly.com/
Thanks to Odb for the code. The thread is solved.

ink

Re: MegaMan help: Switchable weapons system
#10  February 24, 2019, 01:46:15 pm
  • ****
  • inktrebuchet
    • USA
    • s236.photobucket.com/albums/ff271/inktrebuchet/?
Do you understand why that code works? Feel free to ask about it if not, you won’t get far just copy and pasting code that’s not understood.

Here is another way to do it. Longer but maybe it will help with understanding. Odb’s is much nicer looking.
Code:
[state -1 ,weapon select] ; var(25) = weapons 1-3
type = null
triggerall = command = "b"
trigger1 = var(25) = 0
trigger1 = var(25) := 1
trigger2 = var(25) = 1
trigger2 = var(25) := 2
trigger3 = var(25) = 2
trigger3 = var(25) := 3
trigger4 = var(25) = 3
trigger4 = var(25) := 1
Ignorehitpause = 1

[state n]
type = displaytoclipboard
trigger1 = 1
text = "Weapon = %d"
params = var(25)