Shock Help Thread

Started by Toasted Brains, October 07, 2016, 03:23:31 AM

Previous topic - Next topic

Toasted Brains

This thread is for me to ask about coding while I'm working on Shock for M.U.G.E.N.
This is how his throw looks like:

How do I code it to look like he slams the opponent down 3 times, then hits them with a frying pan?
Chris is out now! Up next is another OC, some stages, and a certain half-demon.

Cyanide

Set up a hitdef with multiple triggers that hit MAFD and cause fall. Then sprite him hitting with a frying pan and code for that. This is just a pre-animated combo. Set your animation up right and the hitdefs correctly and you'll get the result you want.

Too little to go on now. Code the attack so he hits something and it sort of acts how you want, then if you're stuck come back. Hitdefs and animations should be simple enough to implement.


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.

Odb718

Quote from: RMaster007 on October 07, 2016, 03:23:31 AMThis thread is for me to ask about coding while I'm working on Shock for M.U.G.E.N.
Please don't make one giant thread for ALL of your problems. It will help EVERYONE out on the forum if you make separate threads. It's not against the rules or bad in any way to make multiple threads for different questions. Just don't make 2 for the same problem. Sometimes the person that knows the answer hasn't seen the question yet. Just be patient and we usually get all the problems solved.

Cyandie's way is good for a regular attack. If the move is a throw type, you'd do it differently.
I figure you want the character to maybe bounce up after the 3rd slam, and then get's whacked with the pan?
But like Cyanide said, there's not enough info on what you want to do to really help. Right now we're just guessing.
vVv Gouken718 vVv SabreTooth718 vVv


altoiddealer

As you've volunteered to help beta test Jailbot, why don't you take a look at his "Bash n' Toss" special?  Jailbot smashes the enemy on the floor, so you may be inspired by how I went about that.

It is a throw type move, so it puts the enemy into a custom state, with a custom animation, and uses a TargetBind controller to position him for every animation frame.

I have not used the "Throw Editor" feature in FF3 but it is probably easy to use to get the right X/Y coordinates.


Toasted Brains

Quote from: altoiddealer on October 07, 2016, 04:12:46 PM
As you've volunteered to help beta test Jailbot, why don't you take a look at his "Bash n' Toss" special?  Jailbot smashes the enemy on the floor, so you may be inspired by how I went about that.

It is a throw type move, so it puts the enemy into a custom state, with a custom animation, and uses a TargetBind controller to position him for every animation frame.

I have not used the "Throw Editor" feature in FF3 but it is probably easy to use to get the right X/Y coordinates.

Thanks man, I look into Jailbot's code to see how it would work.
Also, I'm trying to figure this out:

Now, position-wise, where should the bullet be?
The coding:
Spoiler (click to show)
;-------------------------------------------------------------------------------
; Pistol

[StateDef 1000]
type = S
movetype = A
physics = S
juggle  = 1
velset = 0,0
anim = 1000
ctrl = 0
hitcountpersist = 1
facep2 = 1

[State 1000, VarSet]
type = VarSet
trigger1 = AnimElem = 1
v = 50
value = 1

[State 1000, Helper]
type = Helper
trigger1 = AnimElem = 3
ID = 1001
pos = 525,600
postype = p1
stateno = 1001
helpertype = normal
name = "Pistol"
keyctrl = 0
ownpal = 1
supermovetime = 1

[State 1000, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1000,0

[State 1000, End]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------------------------------------------------
; Bullet

[StateDef 1001]
type = A
movetype = A
physics = N
juggle  = 1
velset = 0,0
anim = 1001
ctrl = 0

[State 1001, 1]
type = VelSet
trigger1 = time >= 0
x = 13
y = 0

[State 1001, 2]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA         ;Attribute: Standing, Normal Attack
damage = 45, 20         ;Damage that move inflicts, guard damage
animtype = Light         ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA         ;Flags on how move is to be guarded against
hitflag = MAF         ;Flags of conditions that move can hit
priority = 3, Hit         ;Attack priority: 0 (least) to 7 (most), 4 default               ;Hit/Miss/Dodge type (Def: Hit)
pausetime = 2, 2         ;Time attacker pauses, time opponent shakes
sparkno = S8003            ;Spark anim no (Def: set above)
sparkxy = 8,-61      ;X-offset for the "hit spark" rel. to p2,               ;Y-offset for the spark rel. to p1
guard.sparkno = S8012
hitsound = S5,6         ;Sound to play on hit
guardsound = S6,1         ;Sound to play on guard
ground.type = High      ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5      ;Time that the opponent slides back
ground.hittime  = 12      ;Time opponent is in hit state
ground.velocity = -4      ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8   ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High         ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3      ;X-velocity at which opponent is pushed,               ;Y-velocity at which opponent is pushed
air.hittime = 12         ;Time before opponent regains control in air
palfx.time = 8
palfx.add = 32,16,50
palfx.mul = 164,32,50
palfx.color = 100

[State 1001, DestroySelf]
type = DestroySelf
trigger1 = movecontact

[State 0, DestroySelf2]
type = DestroySelf
trigger1 = pos x != [ -200, 200]
ignorehitpause = 1
persistent = 1
Chris is out now! Up next is another OC, some stages, and a certain half-demon.

altoiddealer

I think it should come out the end of the barrel of the gun ;)

But really instead of guess and check to get the x/y position, in FF3 go to your anim with the gun.  From the top menu go to Zoom > actual size.  Now when u hover the cursor it will show the actual x/y values relative to the axis.  In this case probably like 30,-20


Toasted Brains

Chris is out now! Up next is another OC, some stages, and a certain half-demon.

Toasted Brains

Quote from: Odb718 on October 07, 2016, 09:01:47 AM
Quote from: RMaster007 on October 07, 2016, 03:23:31 AMThis thread is for me to ask about coding while I'm working on Shock for M.U.G.E.N.
Please don't make one giant thread for ALL of your problems. It will help EVERYONE out on the forum if you make separate threads. It's not against the rules or bad in any way to make multiple threads for different questions. Just don't make 2 for the same problem. Sometimes the person that knows the answer hasn't seen the question yet. Just be patient and we usually get all the problems solved.

Cyandie's way is good for a regular attack. If the move is a throw type, you'd do it differently.
I figure you want the character to maybe bounce up after the 3rd slam, and then get's whacked with the pan?
But like Cyanide said, there's not enough info on what you want to do to really help. Right now we're just guessing.

Okay, first of all, rude. This thread is just to check for assistance on coding.
Second, it's not a special throw, but a normal throw, the opponent bouncing up after the 3rd slam sounds neat. But I was just thinking about him slamming the opponent down three times, making them lie down for a bit, then he hits them.
Chris is out now! Up next is another OC, some stages, and a certain half-demon.

altoiddealer

I recommend grabbing FF3 and using it - it's really, really good.


Toasted Brains

I would if Norton didn't f**king ruin every damn thing. >:(
Chris is out now! Up next is another OC, some stages, and a certain half-demon.

Odb718

Quote from: RMaster007 on October 16, 2016, 04:15:39 AMOkay, first of all, rude. This thread is just to check for assistance on coding.
Second, it's not a special throw, but a normal throw, the opponent bouncing up after the 3rd slam sounds neat. But I was just thinking about him slamming the opponent down three times, making them lie down for a bit, then he hits them.
Not sure what part of what I said is rude to you. There arent any rules to dev help, but it's kind of an unspoken rule. I was trying to help you, and everyone else that uses dev help. Like I do every day of the year. I can totally change that for you if you don't like how I didn't insult you in anyway. Let me know.

You're going to want to use p1stateno and p2stateno in your hitdef to make a throw. Then you'll set up the animation for P2 in your *.air and use it in your custom state for P2. Because throws can be so different there's MULTIPLE ways to make them work. You can set up the animation's sprites using the default hit reactions two ways. (mainly two ways)
You'd get the sprites in the position relative to your P1's sprites and lock P2's animation to P1's 0,0.
The other way is to use all the sprites you need and do TargetBind/VelSet/VelAdd.
Your throw you'd probably want to do the lock to 0,0. You could use sounds, targetlifeadd, and hitadd in the middle of the state to show each slam as a hit. At the end you'd probably do a selfstate that has a velset in the statedef.
One trick, you'll definitely want to get rid of norton for, in FF3 is onion skin. You'll be able to see your P1 sprite, set P2's position, and move to the next sprites. It makes making throws super easy. I think you can make norton ignore FF3 too.
If you're not sure what to do for any step, just ask.
Sounds, EnvShake, and dust FX make slams come to life.

I personally add the final hit as a new hitdef. It doesn't hit the custom state, but any helper or P4 will be affected if they're close enough. It helps with recovery.
vVv Gouken718 vVv SabreTooth718 vVv


Toasted Brains

I know how a throw works, but where should I position the opponent?
I'll do what I did with the pistol special and put the throw in, then let someone help with positioning.
And I'm sorry I called you rude.
Chris is out now! Up next is another OC, some stages, and a certain half-demon.

Toasted Brains

The pistol works perfectly now, thanks to altoiddealer's help.
But now I can't activate his hyper, due to its QCF, x+y command and the pistol being QCF, x.
COMMAND CODING:
Spoiler (click to show)
;===========================================================================
;---------------------------------------------------------------------------
;Special 1 - Pistol

[State -1, Pistol]
type = ChangeState
value = 1000
triggerall = command = "pistol"
triggerall = command != "holddown"
trigger1 = (statetype = s) && ctrl
trigger2 = (stateno = 200) && movecontact && time > 2
trigger3 = (stateno = 210) && movecontact && time > 2
trigger4 = (stateno = 220) && movecontact && time > 2
trigger5 = (stateno = 230) && movecontact && time > 2
trigger6 = (stateno = 240) && movecontact && time > 2
trigger7 = (stateno = 250) && movecontact && time > 2
trigger8 = (stateno = 400) && movecontact && time > 2
trigger9 = (stateno = 410) && movecontact && time > 2
trigger10 = (stateno = 420) && movecontact && time > 2
trigger11 = (stateno = 430) && movecontact && time > 2
trigger12 = (stateno = 440) && movecontact && time > 2
trigger13 = (stateno = 450) && movecontact && time > 2
trigger14 = var(59) = 1
trigger14 = random > 979
;---------------------------------------------------------------------------
;Hyper 1 - Beatdown

[State -1, Beatdown]
type = ChangeState
value = 3000
triggerall = power >= 1000
triggerall = command = "beatdown"
trigger1 = statetype = S
trigger1 = ctrl
trigger2 = statetype != A
trigger2 = hitdefattr = SC, NA, SA, HA
trigger2 = stateno != [3000,3050)
trigger2 = (stateno = 200) && movecontact && time > 2
trigger3 = (stateno = 210) && movecontact && time > 2
trigger4 = (stateno = 220) && movecontact && time > 2
trigger5 = (stateno = 230) && movecontact && time > 2
trigger6 = (stateno = 240) && movecontact && time > 2
trigger7 = (stateno = 250) && movecontact && time > 2
trigger8 = (stateno = 400) && movecontact && time > 2
trigger9 = (stateno = 410) && movecontact && time > 2
trigger10 = (stateno = 420) && movecontact && time > 2
trigger11 = (stateno = 430) && movecontact && time > 2
trigger12 = (stateno = 440) && movecontact && time > 2
trigger13 = (stateno = 450) && movecontact && time > 2
How should I fix this?
Chris is out now! Up next is another OC, some stages, and a certain half-demon.

Odb718

#13
First, I think the reason it's not working is because you have more complex code under easy code in -1.
Second, I thinned down your stuff, and put the hyper above the special.

;---------------------------------------------------------------------------
;Hyper 1 - Beatdown

[State -1, Beatdown]
type = ChangeState
value = 3000
triggerall = power >= 1000
triggerall = command = "beatdown"
trigger1 = (statetype = s) && ctrl
trigger2 = statetype != A  ;stateno 200 is probably standing. you shouldnt need this.
trigger2 = hitdefattr = SC, NA, SA, HA  ;<<<I doubt state 200 has all of these attributes.
;trigger2 = stateno != [3000,3050) ;if stateno=200 stateno !=3000
trigger2 = (stateno = [200,250]) && movecontact && time > 2 ;If this shouldnt happen when ^^^ do, change it to trigger 3
trigger3 = (stateno = [400,450]) && movecontact && time > 2 ;and this to 4

;----------------------------------------------------------------------
;Special 1 - Pistol

[State -1, Pistol]
type = ChangeState
value = 1000
triggerall = command = "pistol"
triggerall = command != "holddown"
trigger1 = (statetype = s) && ctrl
trigger2 = (stateno = [200,250]) && movecontact && time > 2
trigger3 = (stateno = [400,450]) && movecontact && time > 2
trigger4 = (var(59) = 1) && (random > 979)


When mugen fires off a tic and figures everything out, as soon as something works, it's locked in. So if you have a double fireball motion below a single fireball motion, they both were input right? Mugen knows both inputs work and scrolls down and looks at the changestates. If the single fireball motion changestate can work, mugen forgets all about the double motion. If the single's triggers fail, it'll look at the double motion and see if it's triggers work.
That's why _sometimes_ the double fireball motion will work.

If var(59) is your AI trigger, I'd suggest making it in a totally different changestate. You can have as many changestates to the same state as you want. Which helps keeping track of AI stuff.


----
Small edit. IF by chance, there are statedefs between 200 and 250, those lines I made will trigger them also. If you dont want, say state 237 to work you have to tell mugen
trigger2 = stateno != 237
to block 237 and have the other the 50 states work.

--------
Another edit. When coding in statedef -1, it's easy to remember Ultra>Special>Normal. Ultras usually go at the stop, then Specials, then Normal(Basic) attacks. The most difficult commands are at the top. The same for the Changestates, usually. But you can decide which ones override other ones by putting them above other changestates. If your basic A attack was at the top of the changestates, NO OTHER "A" input would work. Except in very few instances.
vVv Gouken718 vVv SabreTooth718 vVv


Toasted Brains

Tried it out and it works perfectly. Thanks man.
Chris is out now! Up next is another OC, some stages, and a certain half-demon.

Toasted Brains

Just an update, Shock's beta will come out in four days!
His throw has been added and I plan to fix some infinites before his release.
Chris is out now! Up next is another OC, some stages, and a certain half-demon.

altoiddealer

Why not make a thread in "Projects"?


Toasted Brains

New idea for him involving this:

Info on it later.
Chris is out now! Up next is another OC, some stages, and a certain half-demon.