News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

First Attack

Started by KamiyaKasshinRyu, January 21, 2009, 12:24:59 PM

Previous topic - Next topic

KamiyaKasshinRyu

I like this feature 'cause its from Capcom.(I guess)
How do you make a First Attack and then display a explod that indicates First Attack?

Byakko

Quoteits from Capcom
I doubt that.
QuoteI like this feature 'cause its from Capcom
That doesn't really sound like a good justification... Then again it's not like you need a justification anyway.
QuoteHow do you make a First Attack and then display a explod that indicates First Attack?
You have a few slightly different methods for that.

In statedef -2, add a varset with the following triggers
triggerall = var(XXX) = 0
trigger1 = movehit
trigger2 = movetype = H
(where var(XXX) is the variable you want to use)
sets the variable you want to use to 1.
Then, add the creation of an explod that triggers when the variable is 1.
Then, when the explod is displayed and the variable is 1, set the variable to 2.

Alternatively, instead of the first varset, make that the creation of a helper on the same conditions. Simply, make sure that the helper doesn't get created if it already exists (give the helper an ID and make sure there isn't already a helper with that ID), and then just never destroy that helper. Of course, this means you're going to stick with a helper that doesn't do anything for the rest of the fight.

Third version, create a helper right at the start of the round. Make it check if "parent, movehit" or if "parent, movetype = H", and if on of those triggers happens, display the explod. Immediately afterward, destroy the helper. It's kind of the opposite as the above. In addition, it seems to be the simplest, as it won't leave you with an unused helper and it won't require a constant checking in statedef -2 like the first method (it will always check if the var is 0, which will never be true after it has happened) and it will also spare you a variable.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

KamiyaKasshinRyu

In statedef -2, add a varset with the following triggers
triggerall = var(XXX) = 0
trigger1 = movehit
trigger2 = movetype = H
(where var(XXX) is the variable you want to use)
sets the variable you want to use to 1.
Then, add the creation of an explod that triggers when the variable is 1.
Then, when the explod is displayed and the variable is 1, set the variable to 2.


Okay I'll go try this one first befor the other two.  :)
Thanks bro.



KamiyaKasshinRyu

Hey! It Really Works.
I haven't try the other two.
Thank you very much.  :)

KamiyaKasshinRyu

#4
Quote from: KamiyaKasshinRyu on January 22, 2009, 04:13:10 PM
Hey! It Really Works.
I haven't try the other two.
Thank you very much.  :)

Im a little bit wrong.
I change it to:
[State -2, VarSet]
type = VarSet
triggerall = var(59) = 0
trigger1 = movetype = A && movehit
v = 59
value = 1
Now it works but have some problem:
When I play as the P1...it works perfect.The First attack explod for P1 is just right.
But when I play as the P2...it doesnt work just right because the first attack explod for P1 and P2 both appears when P2 do a first attack.
Help... ???
What do I have to do with this:
[State -2, First Attack ]
type = Explod
triggerall = var(59) = 1
triggerall = life = lifemax
trigger1 = teamside = 1
trigger1 = numexplod(88) = 0
id = 88
anim = 50
pos = 0,60
postype = left
facing = 1
removetime = -2
bindtime = -1
sprpriority = -1
ownpal = 1
scale = .5,.5

[State -2, First Attack ]
type = Explod
triggerall = var(59) = 1
triggerall = life = lifemax
trigger1 = numexplod(88) = 0
trigger1 = teamside = 2
id = 88
anim = 55
pos = 0,60
postype = right
facing = 1
removetime = -2
bindtime = -1
sprpriority = -1
ownpal = 1
scale = .5,.5
How do I make "First Attack Explod" appear just right.
Thanks. :)

Rajaa Retired

well first off var(99) is not a variable number that can be used, 0-59 are the ONLY var numbers you can use.

also the thing you described makes no sense, since both explods have the same id and you used different teamsides as triggers, so only one can be summoned based off of you triggers. Are you sure that you don't have another explod somewhere else?

KamiyaKasshinRyu

Yep...Im pretty sure I have only two explods for First Attack.
One is for P1 and 1 for P2.
Its true that when player 2 do a first attack,explod for P1 and P2 appear.

Quote from: Judge Rajaa on January 24, 2009, 09:20:38 PM
well first off var(99) is not a variable number that can be used, 0-59 are the ONLY var numbers you can use.

Oh...im using Var 59...

Byakko

#7
Add persistent = 0 to both ? It looks really weird since they should be mutually exclusive, not only with teamside but even with trigger1 = numexplod(88) = 0. Only one character has the code, and both still show, right ? I dunno, try putting teamside < 2 insetgad of teamside = 1, should be the same but that's an odd glitch...
(looking back at my post earlier I have no idea why I said to put a trigger for movetype = H, sorry about that)
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

Cyanide

Persistent doesn't work in negative states.

I reckon you have a 3rd controller thats the same as teamside = 1 but with the teamside = 2 trigger. Just double check you don't have a duplicate.


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.

KamiyaKasshinRyu

#9
Quote from: Byakko on January 25, 2009, 03:33:14 AM
(looking back at my post earlier I have no idea why I said to put a trigger for movetype = H, sorry about that)
It's Okay...You're the one that help me to have an Idea on how to make FirstAttack.
Thanks.

Im very sure I dont have a double.  ;D
And I am sure now what causes the problem, it is this one state.
I check everything and Remove and add one by one.
I have no problem,then lastly I add this state.
[State -2, PowerAdd]
type = PowerAdd
trigger1 = var(33) = 1
value = 1000
And I found that it causes the problem.
But, I don't know why and how?

Anyway, Any suggestion on how I add power when I first attack?
Thank you very much for help.

Rajaa Retired

i don't understand the fist part of your post, but it seems you solved the epxlod summoning problem.


to add power on the first hit for first attack, just use the same trigger for the explod but use "movehit=1" as the "movehit" trigger.

KamiyaKasshinRyu

#11
Yep...the explod summoning is solved but  occurs again when I add this state:
[State -2, PowerAdd]
type = PowerAdd
triggerall = var(59) = 1
trigger1 = movehit = 1
value = 1000
This poweradd state, Is there something wrong?
Thanks.

Byakko

Just like that, there really shouldn't be anything wrong.
What can possibly occur is that some variables change for wrong reasons and get the wrong value at the wrong time. When is var(33) set to 1, and does var(33) affect anything else ? Though even with that, it's still pretty weird because just this controller shouldn't do anything like allowing an explod to be displayed, it's not changing any value other than power.
If I struggled to the end of my determination, to the end of my way of life with my followers, if the result is ruin, then this ruin is inevitable. Grieve. Shed tears. But you cannot regret.

KamiyaKasshinRyu

#13
Oops...its Var(59)...I'm Very Sorry...Got my mind twisted   :o
I've try to change it to Var(33) to be make sure if using var(59) occur the problem...but still there's no difference...So I'm back and change everyting again to Var(59)...
Still I have no idea how to fix this poweradd problem... :sugoi:

Negative Edge

My screenpack I recently released has this feature.
The way I did this was using a helper without no variables at all.
I will post my code and explain it.

[State -2, First Attack]
type = Helper
triggerall = roundstate >= 0
triggerall = !numpartner
triggerall = !lifemax && (teammode = single && enemy,teammode = turns)
trigger1 = time = 1 && !numhelper(1990994333)
helpertype = normal
name = "First attack"
ID = 1990994333
stateno = 1990994333
pos = 0,-99999999999999999
postype = left 
ownpal = 0
supermovetime = 999999999999
pausemovetime = 999999999999
ignorehitpause = 1
persistent = 0

Don't mind the !numpartner line, I hate simul mode and thats why its there, anyway, I called the helper at the very start of a match, thats what the code above is for.

this line is for the first attack to work on the single player arcade and versus mode. For survival mode, just create another block like the one above and remove this line,

triggerall = !lifemax && (teammode = single && enemy,teammode = turns)


Now for the helper states with the material I coded...

;----------------------------------------------------
;First attack Logo
;----------------------------------------------------
[Statedef 1990994333]
type = S
physics = n
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = invisible
flag2 = noshadow
ignorehitpause = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
ignorehitpause = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = time = 0
v = 1
range = 0,1
ignorehitpause = 1
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = enemy,alive
triggerall = teamside = 1
triggerall = !enemy,moveguarded
triggerall = root,movecontact && root,movetype != H
triggerall = var(1) = 0
trigger1 = (root,movehit && enemy,movetype = H || enemy,movetype = H ) && enemy,stateno != [120,155]
value = f104,0
volume = 255
channel = 20
ignorehitpause = 1
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = enemy,alive
triggerall = teamside = 1
triggerall = !enemy,moveguarded
triggerall = root,movecontact && root,movetype != H
triggerall = var(1) = 1
trigger1 = (root,movehit && enemy,movetype = H || enemy,movetype = H ) && enemy,stateno != [120,155]
value = f104,1
volume = 255
channel = 20
ignorehitpause = 1
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = enemy,alive
triggerall = teamside = 2
triggerall = !enemy,moveguarded
triggerall = root,movecontact && root,movetype != H
triggerall = var(1) = 0
trigger1 = (root,movehit && enemy,movetype = H || enemy,movetype = H ) && enemy,stateno != [120,155]
value = f104,0
volume = 255
channel = 20
ignorehitpause = 1
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = enemy,alive
triggerall = teamside = 2
triggerall = !enemy,moveguarded
triggerall = root,movecontact && root,movetype != H
triggerall = var(1) = 1
trigger1 = (root,movehit && enemy,movetype = H || enemy,movetype = H ) && enemy,stateno != [120,155]
value = f104,1
volume = 255
channel = 20
ignorehitpause = 1
persistent = 0

;--------------P1 side-------------------
[State 0, Explod]; First attack
type = Explod
triggerall = enemy,alive
triggerall = teamside = 1
triggerall = !enemy,moveguarded
trigger1 = (root,movehit && enemy,movetype = H || enemy,movetype = H ) && enemy,stateno != [120,155]
anim = f1990994329
ID = 1990994329
pos = 164,119
postype = left
bindtime = -1
removetime = 169
supermovetime = 999999999999
pausemovetime = 999999999999
scale = .5,.5
sprpriority = 1
ontop = 1
ownpal = 0
ignorehitpause = 1
persistent = 0

;--------------P2 side-------------------
[State 0, Explod]; First attack
type = Explod
triggerall = enemy,alive
triggerall = teamside = 2
triggerall = !enemy,moveguarded
trigger1 = (root,movehit && enemy,movetype = H || enemy,movetype = H ) && enemy,stateno != [120,155]
anim = f1990994339
ID = 1990994329
pos = 164,119
postype = left
bindtime = -1
removetime = 169
supermovetime = 999999999999
pausemovetime = 999999999999
scale = .5,.5
sprpriority = 1
ontop = 1
ownpal = 0
ignorehitpause = 1
persistent = 0

[State 0, DestroySelf]
type = DestroySelf
triggerall = (!root,moveguarded || !enemy,moveguarded)
triggerall = root,stateno != [120,155]
triggerall = enemy,stateno != [120,155]
trigger1 = (root,movehit && enemy,movetype = H) || (enemy,movetype = H || root,movetype = H)

The first three blocks of code are basically to make the helper invisible and not interfere with the players movements during a match. the var random along with the playsnd sctrls are just random sound clips I used to make the announcer say something when a first attack occurs. ( also a variable in a helper state does not interfear with root variables. As you see I have explod logo codes for player ones side and player twos side using the teamside triggers to make mugen detect which side it should show the logo on.

The triggers I used prevents a first attack from happening when an attack being blocked and parried. It only registers on a clean hit whether it's the player or a helper summoned by the player or a projectile as well successfully attacking the opponent. This also prevents a first attack when both players simultaneously hit eachother on the first try.

My destroyself code basically is saying kill the helper after the first hit was sucessfully made for both players.

Anyway take a look at my code and play around with it a bit to get a good understanding.
check anyone of my screenpack vids to see it at work.