YesNoOk
avatar

HitDef (SCTRLs) (Read 158676 times)

Started by Odb718, September 30, 2015, 12:13:58 pm
Share this topic:
Re: HitDef (SCTRLs)
#21  November 04, 2017, 09:47:11 pm
  • ******
  • Loyal to the Game
    • USA
    • http://jesuszilla.trinitymugen.net/
Guard dist for CvS2 is a full screen's width. From what I've seen, that's almost always the case in other games so it's pretty much not something that should be used quite like you expect.
Re: HitDef (SCTRLs)
#22  November 21, 2018, 06:49:01 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Quote
affectteam = team_type (string)  team_type specifies which team's players can be hit by this HitDef. Use B for both teams (all players), E for enemy team (opponents), or F for friendly team (your own team). The default is E.

Unfortunately, the parameter affectteam does not accept expressions.

Stuff like affectteam = IfElse(var(1)>0,B,E) will crash mugen and consider it as Invalid affectteam value.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Last Edit: November 24, 2018, 09:24:52 am by Odb718
Re: HitDef (SCTRLs)
#23  November 24, 2018, 09:25:37 am
  • *****
  • Shame on you!
    • USA
For anyone who comes across the problem XGargoyle pointed out,

To get different AffectTeam = to work, you would need to set up two different hitdefs with the triggerall to check Var(1) for this example.
One hitdef would check,
TriggerAll = Var(1) > 0
the second would check
TriggerAll = Var(1) <=0
Each hitdef would set the affectteam to their needed value.
vVv Ryuko718 Updated 10/31/22 vVv
Last Edit: November 24, 2018, 09:31:41 am by Odb718
Re: HitDef (SCTRLs)
#24  April 10, 2020, 06:54:14 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
In Helpers, Hitdef information is defined at the time of helper's creation and remains frozen through all the state.

If your hitdef has dynamic parameters that change during the duration of the state, they will not be updated on the hitdef.

For example, if your hitdef has this parameter:
damage = 30+30*(root,var(1)=10)

If at the creation of the helper, var(1)=10, then the helper will deal 60 damage even if the value for var(1) changes before the actual hit.
On the other hand, if at the creation of the helper, var(1) is not equal to 10, the helper will deal only 30 damage, even if during the state and previous to the actual hit, var(1) becomes 10.


XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: HitDef (SCTRLs)
#25  April 10, 2020, 07:10:21 pm
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 Would the movehitreset sctrl get around the issue of hitdefs not updating in helpers?
Re: HitDef (SCTRLs)
#26  April 10, 2020, 07:23:04 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
Why would that fix the situation?

MoveHitReset will trigger after the hit is made, but the problem I reported is that the hitdef parameters can't be dynamically updated before the actual hit, so MoveHitReset has yet to activate.

My workaround to "solve" the problem is to create clone helper, and then add a changestate that will switch to the clone helper if the dynamic conditions change after the original helper's creation and before the actual hit
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: HitDef (SCTRLs)
#27  April 11, 2020, 01:54:34 am
  • *****
  • Shame on you!
    • USA
Could you just create a changestate? Or do you have to create a 2nd helper?
vVv Ryuko718 Updated 10/31/22 vVv
Re: HitDef (SCTRLs)
#28  April 11, 2020, 12:09:21 pm
  • ******
  • Hedgehog Whisperer
  • Red Bull addict
    • Spain
    • xgargoyle.mgbr.net
You use a changestate to switch to the same helper with a different hitdef. If your helper had code triggering at time=0 for example, you'll need yo do some adjustments as technically speaking the new helper won't rely on them anymore.
XGargoyle: Battle posing since 1979
http://xgargoyle.mgbr.net
http://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that link
http://paypal.me/XGargoyle  <-- Donations welcome!
Re: HitDef (SCTRLs)
#29  October 07, 2020, 02:43:37 am
  • avatar
  • *
    • Canada
Some properties or engine quirks of HitDefs that aren’t really well documented.

- HitDefs with ground.type=None are non-interrupting, deal no damage, don’t force the target into a hit state, etc. They also don’t grant targets or set MoveHit, MoveContact. But properties p1stateno, p2stateno, chainID will all work on these HitDefs, so it’s possible to use p1stateno or chainID to detect when a non-interrupting hit connects and then deal damage via a permanent target bug instead. Kind of has a niche use for attacks which you don’t want to interrupt the enemy with (it almost appears visually as if the opponent has armor, even though they don’t).
- P2stateno=-1 on a ground.type=None HitDef puts the target into your statefiles without resetting Time to 0, so landing the hit on an opponent with StateNo=200, Time=15 will put them into your StateNo=200 with Time still =15. I can’t think of a use for this for a normal char though.
- A HitDef with a throwing type attribute (any NT,ST,HT,AT) makes the target completely unhittable for the duration of p1’s pausetime, with a minimum of 1 frame, so if you set e.g. pausetime = 15,0 the target will be unhittable for 15 frames. This also supersedes all NotHitBy/HitBy, it will strictly last until the pausetime ends. I can’t think of any way this will apply for normal chars, outside of knowing it exists to explain simul issues/issues with helper hits.
- Someone mentioned earlier that omitting the statetype portion of the HitDef makes it non-reversible (e.g. using attr=,NA). This is true, but Mugen engine automatically updates the HitDef to take on the statetype of the character applying the HitDef after it hits (e.g. my statetype=S, the HitDef before becomes S,NA). So as soon as the HitDef hits once, it becomes reversible again. To avoid this, you can make use of hitonce, or else continue to re-apply the HitDef on every frame so the attr is constantly updated as not having a statetype, at which point it’s truly irreversible for most (non-cheap) purposes.
Re: HitDef (SCTRLs)
#30  October 07, 2020, 02:55:26 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
Some properties or engine quirks of HitDefs that aren’t really well documented.

- HitDefs with ground.type=None are non-interrupting, deal no damage, don’t force the target into a hit state, etc. They also don’t grant targets or set MoveHit, MoveContact. But properties p1stateno, p2stateno, chainID will all work on these HitDefs, so it’s possible to use p1stateno or chainID to detect when a non-interrupting hit connects and then deal damage via a permanent target bug instead. Kind of has a niche use for attacks which you don’t want to interrupt the enemy with (it almost appears visually as if the opponent has armor, even though they don’t).

 This is technically incorrect since it still does make hitdefs interrupt targets, but they just end up with no hittime and no hitshaketime to the point it's unnoticeable. I've actually tried to experiment with ground.type = none in the past and it failed to give me results that I wanted for a DoT gimmick.
Re: HitDef (SCTRLs)
#31  October 07, 2020, 03:04:54 am
  • avatar
  • *
    • Canada

 This is technically incorrect since it still does make hitdefs interrupt targets, but they just end up with no hittime and no hitshaketime to the point it's unnoticeable.

This is an interesting result, because we did verify that this worked the way I described, where the opponent never enters a hit state/leaves its current state using ground.type=None. You can see this in https://youtu.be/BVUuS0Znzxs - the characters continue to move/attack and Time continues to advance without being interrupted while these HitDefs are used. If there was even an instant of interruption, Time would be reset to 0 or the character would change state. I’m interested in how your test was set up to see what might be different.

Re: HitDef (SCTRLs)
#32  October 07, 2020, 03:15:44 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 Upon doing another test, I think I may have misremembered. It doesn't prevent non-interruption, it just prevents you from getting target information of any kind, which may explain why it failed me for attempting DoT.
Re: HitDef (SCTRLs)
#33  October 07, 2020, 03:29:51 am
  • avatar
  • *
    • Canada
Yep - need to use a combo of p1stateno/chainID and a permanent target to perform the actual damage, which is super inconvenient. It’s mostly just a gimmick in the end.
Re: HitDef (SCTRLs)
#34  January 27, 2021, 04:35:40 am
  • ***
  • Come On You Know LGx
  • biblical (yea)
    • USA
    • Skype - eddsworldtrash
    • remixsparta.wix.com/mugensdawn
Don't know if this has been mentioned at all (looked through it a few times but I do miss things), but I just found out that hitdefs refuse to function if the statetype is a liedown state, regardless of movetype.

Which, you know, makes sense, but kind of sucks for my very niche scenario.
Re: HitDef (SCTRLs)
#35  April 22, 2021, 11:42:05 am
  • avatar
  • **
    • Vietnam
If you leave the first argument of the ATTR parameter blank, the hitdef will not be affected by reversaldefs, but the hitdef will work as normal. Useful if you don't want moves to be countered or projectiles to be reflected.

Hitdef
attr = , SA

and its attr will be reset when that hitdef making contact with nothitby with a value SCA, or the character with that hitdef is being paused during the time that hitdef is activating.
------Tremble Mortal and Despair. Doom has come to this world------
Re: HitDef (SCTRLs)
#36  November 23, 2021, 06:10:55 am
  • ***
  • One of Ikemen GO devs
    • Colombia
It's not specified in the docs.
But "down.hittime" defaults to 20.
But wait!! We haven't made the Suave Dude character yet!!
Re: HitDef (SCTRLs)
#37  April 02, 2022, 09:38:32 pm
  • avatar
Re: HitDef (SCTRLs)
New #38  April 02, 2022, 09:48:13 pm
  • ****
    • crepa.neocities.org

  • Online
Last Edit: April 04, 2022, 11:01:38 pm by Odb718