YesNoOk
avatar

How to add a streetfighter roll to any character? (Read 745 times)

Started by kreeddem, June 26, 2008, 12:59:02 am
Share this topic:
How to add a streetfighter roll to any character?
#1  June 26, 2008, 12:59:02 am
  • avatar
  • **
Alright folks,

Am currently developing a project which I wish not to discuss here, but I need some help with one thing. How do you add a roll to a character like in street fighter?

Requires FORWARD roll and BACKWARD roll.

Any help with code and help to implement the code to the character would be helpful, thanks.

Kreeddem
Re: How to add a streetfighter roll to any character?
#2  June 26, 2008, 01:02:42 am
  • ******
  • [E]
    • Mexico

  • Online
street fighter has roll? that's new for me.
Re: How to add a streetfighter roll to any character?
#3  June 26, 2008, 01:12:28 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Probably recovery roll. Thats more of a vs standard though.

How much do you know so far? I'm certainly not going to just give you the code for it.


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.
Re: How to add a streetfighter roll to any character?
#4  June 26, 2008, 01:59:39 am
  • avatar
  • **
Probably recovery roll. Thats more of a vs standard though.

How much do you know so far? I'm certainly not going to just give you the code for it.

Am learning as I am going along, if you send the code in a .txt document remember to add your name there and you will be in the credits of the game, if you can't help me, looks like am going to have to rip it for a sf char and give that person credit. This will take me long but oh well, if you can't share your code thats ok.
Re: How to add a streetfighter roll to any character?
#5  June 26, 2008, 02:49:18 am
  • ******
  • Somebody PM when Caddie is no longer a mod.
If you are going to rip it make sure you got permission or char is public.

Or you could use the snippet archive above and find something similar like this.

In the sf3 games, if you hit your opponent with an attack that knocks down, but then while he's falling hit him with one that does not knock down, he will recover from his fall.

e.g.: shoryu ken makes him fall -> light punch makes him recover

Thought about adding it for ryu, and here's what i came up with (after trying other much more complicated but less efficient stuff):

Code:
[State -3, autoairrecover]
type=hitfallset
trigger1=stateno=5050
value=!(gethitvar(type)!=3&&gethitvar(yveladd)<=0&&prevstateno!=5080&&pos y<=-20)

gethitvar(type)!=3 ->char wasn't tripped

gethitvar(yveladd)<=0 ->char wasn't hit downwards

prevstateno!=5080 -> char wasn't OTG

pos y<=-20 -> so that the char won't recover too close to the ground

The ! before all of that makes it so that if all these conditions are true, hitfall is set to 0

What it basically does is reset the hitfall attribute once it has served its purpose (after state 5035), so that next time the char gets hit he'll only fall if the attack knocks down.

EDIT: replaced with the new and improved version that i've been using since some time ago and been forgetting to post

or you could go to this website http://infinitymugenteam.com/FrameSoftware.htm and use their MVC Template
Re: How to add a streetfighter roll to any character?
#6  June 26, 2008, 03:23:17 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Nothing to do with credit. To do with you learning and understanding what you're making use of. I generally don't give people difficult code because they get into a copy paste mentality and learn less. If it was something really simple that was just a single controller i'd give you that. But a full on effect with all the required changestates and triggers isn't happening.

It is to be hoped that you know enough to get it started and then we help you out on the errors rather than we actually start you out altogether. Help section, not "do it for you" you see?


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.
Re: How to add a streetfighter roll to any character?
#7  June 26, 2008, 07:46:51 pm
  • ******
  • Somebody PM when Caddie is no longer a mod.
LOL Just found this in the archive.

From the VS games, it is used to get up, and roll toward your opponent, or out of the way. In any case, you will make it more difficult for the opponent to hit you while you are down.

To begin, we first put the following code in the CMD:

[mcode];Recovery - Roll
[State -1]
type = VarSet
trigger1 = (Var(0) = 0) && (MoveType = H) && (command = (whatever))
v = 0
value = 1

[State -1]
type = VarSet
trigger1 = ((Var(0) = 1) && (MoveType != H)) || (Lose)
v = 0
value = 0
[/mcode]
This is used to set the recovery while your character is in a hit state. If your character does not fall, then the variable is reset.

Next, the CNS part. Your character is required to use his/her own common1.cns file.

In state 5100: (Add and replace states)

(replace state 5100, 12)

[mcode][State 5100, 12]
type = ChangeState
trigger1 = (Var(0) = 0) && (AnimTime = 0)
value = 5101
[/mcode]
(add state 5100, 14)

[mcode][State 5100, 14]
type = ChangeState
trigger1 = (Var(0) = 1) && (AnimTime = 0)
value = 9000 ;Recovery Roll[/mcode]

And in state 5120

(replace state 5120, 7)

[mcode][State 5120, 7]
type = ChangeState
trigger1 = (Var(0) = 0) && (AnimTime = 0)
value = 0
ctrl = 1[/mcode]

(add state 5120, 8)

[mcode][State 5120, 8]
type = ChangeState
trigger1 = (Var(0) = 1) && (AnimTime = 0)
value = 9000 ;Recovery Roll[/mcode]

Finally, the Recovery Roll! (Modify as you wish)

[mcode]; Recovery Roll
[Statedef 9000]
type = L
movetype = I
physics = S
ctrl = 0
anim = 9000
velset = 0,0

[State 9000, VelSet]
type = VelSet
trigger1 = Time >= 0
x = 12

[State 9000, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 9000, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
value = SCA

[State 9000, VarSet]
type = VarSet
trigger1 = Time = 0
v = 0
value = 0

[State 9000, End]
type = ChangeState
trigger1 = (P2Dist X <= -25) || (FrontEdgeBodyDist <= 10)
value = 11
ctrl = 1[/mcode]



Did you even try to look?
Re: How to add a streetfighter roll to any character?
#8  June 27, 2008, 12:11:36 am
  • avatar
  • **
LOL Just found this in the archive.

From the VS games, it is used to get up, and roll toward your opponent, or out of the way. In any case, you will make it more difficult for the opponent to hit you while you are down.

To begin, we first put the following code in the CMD:

[mcode];Recovery - Roll
[State -1]
type = VarSet
trigger1 = (Var(0) = 0) && (MoveType = H) && (command = (whatever))
v = 0
value = 1

[State -1]
type = VarSet
trigger1 = ((Var(0) = 1) && (MoveType != H)) || (Lose)
v = 0
value = 0
[/mcode]
This is used to set the recovery while your character is in a hit state. If your character does not fall, then the variable is reset.

Next, the CNS part. Your character is required to use his/her own common1.cns file.

In state 5100: (Add and replace states)

(replace state 5100, 12)

[mcode][State 5100, 12]
type = ChangeState
trigger1 = (Var(0) = 0) && (AnimTime = 0)
value = 5101
[/mcode]
(add state 5100, 14)

[mcode][State 5100, 14]
type = ChangeState
trigger1 = (Var(0) = 1) && (AnimTime = 0)
value = 9000 ;Recovery Roll[/mcode]

And in state 5120

(replace state 5120, 7)

[mcode][State 5120, 7]
type = ChangeState
trigger1 = (Var(0) = 0) && (AnimTime = 0)
value = 0
ctrl = 1[/mcode]

(add state 5120, 8)

[mcode][State 5120, 8]
type = ChangeState
trigger1 = (Var(0) = 1) && (AnimTime = 0)
value = 9000 ;Recovery Roll[/mcode]

Finally, the Recovery Roll! (Modify as you wish)

[mcode]; Recovery Roll
[Statedef 9000]
type = L
movetype = I
physics = S
ctrl = 0
anim = 9000
velset = 0,0

[State 9000, VelSet]
type = VelSet
trigger1 = Time >= 0
x = 12

[State 9000, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 9000, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
value = SCA

[State 9000, VarSet]
type = VarSet
trigger1 = Time = 0
v = 0
value = 0

[State 9000, End]
type = ChangeState
trigger1 = (P2Dist X <= -25) || (FrontEdgeBodyDist <= 10)
value = 11
ctrl = 1[/mcode]



Did you even try to look?

nope, never new there was an archive for source code!