News:

MFG's Character of the Month: October 2026 Nominations

Main Menu

A way to know if you are hit by a Hyper?

Started by JustNoPoint, November 09, 2016, 02:14:41 PM

Previous topic - Next topic

JustNoPoint

I feel I'm forgetting something here but have looked over and over in the docs and cannot find a way for my character to know what kind of attack has hit him. I need to know if he's hit by a Hyper move so I can trigger something in a helper. Best I can think of is using a hitoverride helper but if I do this I'll have to replicate every CLSN1 he has in every anim he has too.

Edit: I missed this one
http://mugenguild.com/forum/topics/hitdefattr-triggers-169654.0.html

JustNoPoint

Seems I can't really figure out how to use this.

I've tried something simple like this in my -2

[State 0, VarSet]
type = VarSet
trigger1 = HitDefAttr = SCA, HA, HP, HT
var(42) = 1

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(42) = %d"

And not even this is triggering the varset. At 1st I thought I couldn't use this with an enemy redirect but now I guess I just don't know what I'm doing at all with it.

altoiddealer

I think I've provided this solution before :)  It will work.

Assign the PlayerID to an unused parameter in the HitDef, such as fall.envshake.ampl

fall.envshake.ampl = ID

Use GetHitVar to check that parameter

trigger1 = PlayerIDExist(GetHitVar(fall.envshake.ampl))
trigger1 = PlayerID((GetHitVar(fall.envshake.ampl)),IsHelper


JustNoPoint

I want this one to be used without editing other characters. I want clones to leave when Piccolo is hit by a super move and placed into a custom state.

Here's what I have.
Spoiler (click to show)

In -2
; ------- Custom State Check --------
[State -2, VarAdd]
type = VarAdd
trigger1 = GameTime
var(48) = 1

In -3
; ------- Custom State Check --------
[State 0, VarSet]
type = VarSet
trigger1 = MoveType != H
var(49) = Var(48)

[State 0, VarAdd]
type = VarAdd
trigger1 = MoveType = H
trigger1 = gametime
var(48) = 1

in the CMD
;----------------------------------------
;Cinematic Super! Leave!
[State 0, ChangeState]
type = ChangeState
triggerall = IsHelper(3501) || IsHelper(3502)
triggerall = StateNo != [3514,3523]
triggerall = StateNo != 5150
triggerall = root, MoveType = H
trigger1 = enemy, AnimExist(5939)
trigger1 = enemy, NumExplod(991901)
trigger2 = !enemy, AnimExist(5939)
trigger2 = root, Var(43)=1
trigger2 = root, Var(42)=1
trigger2 = root,var(48)-root,var(49)>=30
trigger3 = !enemy, AnimExist(5939)
trigger3 = root, Var(43)=2
trigger3 = root,var(48)-root,var(49)>=60
trigger4 = !enemy, AnimExist(5939)
trigger4 = root, Var(43)=3
trigger4 = root,var(48)-root,var(49)>=90
trigger5 = !enemy, AnimExist(5939)
trigger5 = root, Var(43)=4
trigger5 = root,var(48)-root,var(49)>=120
trigger6 = !enemy, AnimExist(5939)
trigger6 = root, Var(43)=5
trigger6 = root,var(48)-root,var(49)>=150
trigger7 = !enemy, AnimExist(5939)
trigger7 = root, Var(43)=6
trigger7 = root,var(48)-root,var(49)>=180
value = 3521
ctrl = 0

in the Helper.cns
;----------------------------------------
;Cinematic Super! Leave!
[Statedef 3521]
type = S
physics = S
movetype = I
anim = 3517
ctrl = 0
velset = 0,0
sprpriority = 1
poweradd = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = 2302,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = IsHelper(3501)
trigger1 = !Time
value = 3521,0

[State 0, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 3522
ctrl = 0

;----------------------------------------
;Cinematic Super! Not here
[Statedef 3522]
type = S
physics = S
movetype = I
anim = 15999
ctrl = 0
velset = 0,0
sprpriority = 1
poweradd = 0



[State 0, ChangeState]
type = ChangeState
triggerall = root, MoveType != H
trigger1 = enemy, AnimExist(5939)
trigger1 = !enemy, NumExplod(991901)
trigger2 = !enemy, AnimExist(5939)
trigger2 = root, Var(43)=1
trigger2 = root,var(48) <= root,var(49) +29
trigger3 = !enemy, AnimExist(5939)
trigger3 = root, Var(43)=2
trigger3 = root,var(48) <= root,var(49) +29
trigger4 = !enemy, AnimExist(5939)
trigger4 = root, Var(43)=3
trigger4 = root,var(48) <= root,var(49) +29
trigger5 = !enemy, AnimExist(5939)
trigger5 = root, Var(43)=4
trigger5 = root,var(48) <= root,var(49) +29
trigger6 = !enemy, AnimExist(5939)
trigger6 = root, Var(43)=5
trigger6 = root,var(48) <= root,var(49) +29
trigger7 = !enemy, AnimExist(5939)
trigger7 = root, Var(43)=6
trigger7 = root,var(48) <= root,var(49) +29
value = 3523
ctrl = 0

;----------------------------------------
;Cinematic Super! Come Back!
[Statedef 3523]
type = S
physics = S
movetype = I
anim = 3518
ctrl = 0
velset = 0,0
sprpriority = 1
poweradd = 0

[State 0, PosSet]
type = PosSet
trigger1 = !Time
x = Cond(root, Facing = 1,root,Pos X - 30,root,Pos X +30)
y = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = 2302,0

[State 0, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 35000
ctrl = 0
All I need to do is figure out how to use HitDefAttr and I should be good. Right now the code makes them disappear in ANY kind of custom state.

But as I said, even in the simple example I gave
Quote from: Just No Point on November 09, 2016, 08:29:24 PM
Seems I can't really figure out how to use this.

I've tried something simple like this in my -2

[State 0, VarSet]
type = VarSet
trigger1 = HitDefAttr = SCA, HA, HP, HT
var(42) = 1

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(42) = %d"

And not even this is triggering the varset. At 1st I thought I couldn't use this with an enemy redirect but now I guess I just don't know what I'm doing at all with it.

I can't seem to get HitDefAttr to DO anything. So if I can't figure out how it works with my character it'll be hard for me to use enemy, HitDefAttr to see the opponent's attacks.

So for now, what am I doing wrong that this HitDefAttr isn't working to set the var? It should set the var to 1 when I perform a hyper move.

altoiddealer

HitDefAttr trigger only works for your OWN active HitDef.

If you are checking an attack that has hit you, you would use GetHitVar(**)

However it does not seem to allow checking "attr" such as if it were projectvile, hyper, etc

Straight forward, it seems like only HitOverRide allows you to check the attr of the HitDef.

Otherwise, you can redirect your current code to the enemy.

[State 0, VarSet]
type = VarSet
trigger1 = MoveType = H
trigger1 = enemy,HitDefAttr = SCA, HA, HP, HT
var(42) = 1

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(42) = %d"


JustNoPoint

Well, the code I posted was to try to trigger on MY hitdefattr and it still didn't work. That's why I'm confused. With that simple varset I am checking to see if any hitdef triggers. I have also tried it with something simple like SCA, NA and even S, NA. The var doesn't change to 1. At this point I just want to know WHY I can't use it as a trigger for myself. Does it not work in -2? It's not for the clone. This test is simply to get the trigger to do something!

altoiddealer

Can you post the HitDef you are expecting it to trigger for?


JustNoPoint

Well, since that's in -2 I was expecting it to trigger on ANY hitdef that matches the attributes.

altoiddealer

I kind of just wanted to make sure you are using an attack with the attributes :)


JustNoPoint

Well technically the one I posted used helpers so it probably needed helper, hitdefattr stuff but that didn't work either. Anyway I'm on my phone but I promise the normal attacks I used had their attributes set.

Heck you can check all my basics lol

altoiddealer

As a very quick test, stuck this in State -2
Spoiler (click to show)


[State -2, Stand Hover]
type = Explod
trigger1 = HitDefAttr = SCA, NA
trigger1 = !numexplod(9876)
anim = 100
id = 9876

The Explod appears when performing a normal attack.

So I changed it to "trigger1 = HitDefAttr = SCA, HT" which is the attributes of Jailbot's Arcade hyper, and when performing the move the explod appears.


Re-reading your post...

[State 0, VarSet]
type = VarSet
trigger1 = HitDefAttr = SCA, HA, HP, HT
var(42) = 1

[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(42) = %d"

How about...
:lfor:
params = var(42)
:lfor:


Cyanide

You have a minor problem with this if people don't code their hitdef right. See the Hyper bit of attr does 2 things. It triggers things like nothitby etc, and shows a specific win symbol. However it doesn't have any noticeable affect for the character using it, so many people might not even bother. Default S, NA works, why change it.

So... you may need to come up with some additional stuff. Supers and hypers are not always sensible because of random coding.


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

#12

[State 0, VarSet]
type = VarSet
trigger1 = HitDefAttr = S, NA
var(42) = 1
[State 0, VarSet]
type = VarSet
trigger1 = HitDefAttr = SCA, NT
var(42) = 2
[State 0, VarSet]
type = VarSet
trigger1 = enemy,HitDefAttr = S, NA
var(42) = 7
[State 0, VarSet]
type = VarSet
trigger1 = enemy,HitDefAttr = S, NT
var(42) = 9

[State -2, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(42) = %d ,var(48) = %d ,var(49) = %d "
params = var(42), var(48) , var(49)

I can see the values change without P2 or P1 being hit. As soon as the move is active it changes.
I'm sure you can set it up so that it only changes when P1 is being hit for that single tic

----
Cyanide is right. There's more than a few times where you should use Crouching Hyper Throws as a random attack because it's rarely used. I know one or two of my characters use that particular hitdefattr to do custom stuff.

---- ----
So you want the clones to disappear if Pic's in a Hyper Throw for too long? Watching the hitdefattr and the time of being hit would probably produce some false positives. Where the first attack was the throw, Pic gets hit, but then a regular custom combo happens and he'd be in a hit reaction outside of the throw. Probably unlikely, but you'd also want to see if P2's stateno was [3000,3999].
My train of thought is, if they dont use the mugen standards, that's not P1's fault. Do what's supposed to happen and if P2's broken, it's on the author(s).

---- ---- ----
Also, not 100% positive, but I think you can thin the 3523 changestate to

[State 0, ChangeState]
type = ChangeState
triggerall = root, MoveType != H
trigger1 = enemy, AnimExist(5939)
trigger1 = !enemy, NumExplod(991901)
trigger2 = !enemy, AnimExist(5939)
trigger2 = root,var(48) <= root,var(49) +29
trigger2 = root, Var(43)=[1,6]
value = 3523
ctrl = 0

---- ---- ---- ----
aaand I think you can do some math to use
trigger2 = ((root,var(48)-root,var(49))/(root, Var(43)))>=30
vVv Gouken718 vVv SabreTooth718 vVv


JustNoPoint

Quote from: altoiddealer on November 10, 2016, 05:45:58 AM
[State 0, DisplayToClipboard]
type = DisplayToClipboard
trigger1 = 1
text = "var(42) = %d"

How about...
:lfor:
params = var(42)
:lfor:
:embarrassed:
I've never used params and it's always showed me what my var was before
Ok so it was working :P

Seems the issue I was having was using
trigger1 = HitDefAttr = SCA,HA
trigger1 = MoveType = H

seems there is a gap between the attribute and getting hit where I'd lose the var with MoveType != H

So now what I've done is created 2 explods
1 is created when the attack happens and lasts 25 ticks the other is created when I am actually hit while that one exists and it stays active till I'm no longer in a hit state.

Remind me how I can know if it's a HP since these will be in P2's Helpers a lot of times. And I can't use = enemy, helper, blah
I think you told me this once before but I can't remember.

Quote from: Cyanide on November 10, 2016, 08:28:58 AM
You have a minor problem with this if people don't code their hitdef right. See the Hyper bit of attr does 2 things. It triggers things like nothitby etc, and shows a specific win symbol. However it doesn't have any noticeable affect for the character using it, so many people might not even bother. Default S, NA works, why change it.

So... you may need to come up with some additional stuff. Supers and hypers are not always sensible because of random coding.
I kind of have the thought that if people don't code correctly I don't care if my stuff breaks with it :P
Having said that I guess I can try the state 3000 thing too. Though not everyone adheres to it either. Heck even many HDBZ chars use 2000 instead of 3000 :s

Quote from: Odb718 on November 10, 2016, 08:30:52 AM
---- ----
So you want the clones to disappear if Pic's in a Hyper Throw for too long? Watching the hitdefattr and the time of being hit would probably produce some false positives. Where the first attack was the throw, Pic gets hit, but then a regular custom combo happens and he'd be in a hit reaction outside of the throw. Probably unlikely, but you'd also want to see if P2's stateno was [3000,3999].
My train of thought is, if they dont use the mugen standards, that's not P1's fault. Do what's supposed to happen and if P2's broken, it's on the author(s).
I compare vars in -2 and -3. When they don't match for too long the character is in a custom state and they vanish. I also made a config file to change the length they have to be off. 30-180 all 30 tick segments

I made a standard for the HDBZ chars themselves and that's why it checks for a certain anim# and certain explod# so we have full control of when it happens. Only for cinematic moves.


Quote---- ---- ----
Also, not 100% positive, but I think you can thin the 3523 changestate to

[State 0, ChangeState]
type = ChangeState
triggerall = root, MoveType != H
trigger1 = enemy, AnimExist(5939)
trigger1 = !enemy, NumExplod(991901)
trigger2 = !enemy, AnimExist(5939)
trigger2 = root,var(48) <= root,var(49) +29
trigger2 = root, Var(43)=[1,6]
value = 3523
ctrl = 0
Yeah, I'd coded it differently then realized I could have them all +29 I'll apply this
Quote---- ---- ---- ----
aaand I think you can do some math to use
trigger2 = ((root,var(48)-root,var(49))/(root, Var(43)))>=30
Uhhhh, I'll keep it like it is because I suck at math and this hurts my head :P Var(43) is the one you can change in the config file. It can be from 0 to 6


; CLONES VANISHING DURING SUPER SENSITIVITY
[State 5900, 3]
type = VarSet
trigger1 = 1
v = 43
;#####################################################################################################################
;## Choose how long it should take before Piccolo clones teleport out when Piccolo is hit during a super move that sends him into a custom state
;## set to 0 to disable.
;## value = 1 is 30 ticks.
;## value = 2 is 60 ticks.
;## value = 3 is 90 ticks.
;## value = 4 is 120 ticks.
;## value = 5 is 150 ticks.
;## value = 6 is 180 ticks.
value = 1






altoiddealer

Quote from: Just No Point on November 10, 2016, 02:47:18 PM
Remind me how I can know if it's a HP since these will be in P2's Helpers a lot of times. And I can't use = enemy, helper, blah
I think you told me this once before but I can't remember.
This is a little different than previous scenarios.
You would have to get the enemy helper's PlayerID to redirect a trigger to it.  I don't think that's possible here.

Unless enemynear,IsHelper will trigger.  In which case you can varset enemynear,ID.  Or just
trigger1 = enemynear,IsHelper
trigger1 = enemynear,HitDefAttr = SCA,HA, HP, HT


JustNoPoint

enemy, IsHelper won't trigger because a helper cannot be an enemy unless they are set to player. I learned that the hard way making clones and all their stupid work arounds :P

I guess a standard would probably have to be set where people placed projectiles with their helpers too. I think a projectile would still carry root's HitDefAttr? Anyway since such a standard isn't possible I guess I'll try a huge CLSN2 invisible helper in play that changes uses hitoverride to change states when hit by a HP. While in this state if root is hit then it triggers the clones to leave. When root is no longer in a hit state the huge helper returns.

That sound like the best approach?

altoiddealer

#16
Yeah, that sounds like the best approach.  Nice idea :)  The Helper's HitOverRide could probably handle all the detection.  Just be sure to have the helper always posset the the corner/center of the screen, depending on orientation of the hitbox.
You can make the Y value relative to the top edge by using y = -ScreenPos Y
Center screen, y = Floor((GameHeight/2)-ScreenPos Y)


JustNoPoint

I just figured the huge helper would be bound to Piccolo the whole time. This dude is the helper KING!!!

JustNoPoint

Crap this may not work because it creates a hitspark and hit sound upon contact. I don't suppose there would be anyway around this? This would have worked perfectly too.

altoiddealer

#19
Quote from: Just No Point on November 11, 2016, 04:14:54 AM
Crap this may not work because it creates a hitspark and hit sound upon contact. I don't suppose there would be anyway around this? This would have worked perfectly too.
Upon further thought, I think this idea can go right out the nearest window lol

This would tamper with a lot of HitDefs.  Hitonce parameter, for instance.  PalFX.  Gainpower.  P1StateNo.  Lol.


Why don't you choose easier conditions to poof the clone?  Or a combination of easier triggers?  GetHitVar(IsBound) //  !CanReceover // etc