Mashable throws.

Started by Jesuszilla, August 01, 2009, 09:04:05 AM

Previous topic - Next topic

Jesuszilla

So now I'm making a character with a mashable throw and I just realized that... I don't exactly get how they work. Examples are Guy, R. Mika and Bison/Balrog in Zero3.


How exactly do they work and how would one go about coding such a thing?


Jesuszilla

Thank you.



Although I just found something interesting regarding Boxer.... P2 mashing buttons won't do anything. This brings a whole new meaning to "NO ESCAPE!"  ;P



However I'm still a bit lost as to how to code it... I understand it well, but I just want to prevent it from being used too much like Capcom does. There's a bit of a limit...

Rajaa Retired

Well I coded it, it might not be super accurate, I didn't even know this stuff until afterward when I read that anyway. >_>


Since you don't want your opponent to be able to button mash, just use this set up of variables.

Start up, the timer resets; Timer can't go less than zero for some crazy reason; Subtracts 1 every tick; Adds 10 every time I press the "sirpunch" command during that specific time, only happens once every time, though, since once it's pressed you'll start the animation over. So no worries about infinite headbutts or punching or kneeing becase the time it takes to get back, outweighs this amount if it doesn't you can just lower it or something like that. =p

If you need the opponent to subtract from the meter, you can just add a varadd which subtracts for the opponent pressing the sirpunch command or whatever name you might give the command.

[state 801,anim]
type=varset
trigger1=!time
var(6)=175

[state 801,anim]
type=varset
trigger1=var(6)<0
var(6)=0

[state 801,anim]
type=varadd
trigger1=var(6)
var(6)=-1

[state 801,anim]
type=varadd
trigger1=anim=802&&animelemtime(4)>6
trigger1=var(6)&&command="SirPunch"
var(6)=10


Here's my set up with the animations.

The first animation, anim 801, is the animation in which Dhalsim begins his head punch; this one is not affected by button mashing.

The second animation, anim 802, is just the animation where Dhalsim is punching and it continuously triggers as long as I have my meter, (var6). The fourth changeanim that changes to anim 802 is triggered after Dhalsim finishes punching and 6 ticks have passed and you press any button, The SirPunch command. The punching happens when animelem = 4, the whole frame last 15 ticks or so and it'd automatically punch again due to automatic looping of the animation 802. The command trigger, SirPunch is obviously button mashing, a bunch of commands in the .cmd named this. Has commands such as the standard: up, down, a, b, etc...

Animation 803 is the finishing punch which triggers when no meter is left, then I have the standard changestate that triggers when !animtime and anim=803


[state 800,anim]
type=changeanim
trigger1=!time
value=801

[state 800,anim]
type=changeanim
trigger1=anim=801
trigger1=!animtime&&var(6)
value=802

[state 800,anim]
type=changeanim
trigger1=anim=802
trigger1=!animtime&&!var(6)
value=803

[state 800,anim]
type=changeanim
trigger1=anim=802&&animelemtime(4)>6
trigger1=var(6)&&command="SirPunch"
value=802


Hope this helps you get an idea. >_>

PotS

My Honda and Karin have decent applications of the data I posted in that thread if you want to have a look.

Also what do you mean P2's inputs do nothing?  I just remember the AI being broken in that it'd always do like 12 hits from mashing. :knife:
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

Jesuszilla

That's not even possible with his throw... I can only get 4 hits even if I use the turbo function on my stick. And P2's mashing won't decrease the hits at all.

Cyanide

Does p2's mashing decrease the damage of each hit?


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Rajaa Retired

Maybe it's a just a throw that happens to 4 times and it doesn't share the same properties as an actual mash button throw.

Jesuszilla

#8
Quote from: Cyanide on August 02, 2009, 12:48:05 AM
Does p2's mashing decrease the damage of each hit?
Nope.



Oh, also it turns out I was wrong. P2's mashing DOES affect Boxer's throw as well.


Ideally I would like this to use as few vars as possible but still have it function as it should but meh I should have enough vars for it to function well I hope.

Cyanide

Only really need 1 don't you? As this is for a full game you can check p2's commands without any issues and just increase/decrease 1 variable in your throw state based on command/target,command.

Although variable organisation is good, if you're using a variable that's in effect for 1 state, and is initialised to 0 each time, you can actually reuse it all over the place if you don't want to waste space on variables that only have 1 function.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.

Rajaa Retired

Yeah you only need one. I even explained a fairly efficient way to do it in my second post here. P.o.t.S also said look into his character for a more accurate way of doing it. &gt;_&gt;

PotS

I used one to keep track of the timer, another for the animation skipping and yet another one for P1's "mashing cooldown", the last of which being the least important. :-X And that was skipping on P2's cooldown out of laziness, which would raise them to 4.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

Bastard Mami

you could always use sysvars if you only need the vars for that state, it is not like mugen common1.cns is going to change by itself.

Jesuszilla

Quote from: Cyanide on August 03, 2009, 08:25:07 AM
Only really need 1 don't you?
Not really, as the anim will speed up regardless of P2's input, so they kinda need their own var for it.