YesNoOk
avatar

Damage dampener for individual moves help (Read 2097 times)

Started by krudelu, November 17, 2018, 02:25:39 am
Share this topic:
Damage dampener for individual moves help
New #1  November 17, 2018, 02:25:39 am
  • **
  • (>owo)><(owo<)
Hello,

While I'm getting a hang of applying damage dampener, there is a multi-hit move where I wanted specific damage scale regardless of which hits I started cancelling to another move.

Say I have Move A can cancel into Move B. Move A hits for 5 hits while Move B does 1 hit. Move A can be cancelled into Move B from any of those 5 hits. I wanted the damage scale from Move A by 0.9 but it should only damage scale after canceling into Move B. I don't want each hit to damage scale that by next move, damage scale stacked that it reduced the next move's damage in a combo drastically.

How can I try to apply damage scale code so Move A would only damage scale after being canceled to Move B regardless of which hit it got cancelled?
Last Edit: November 23, 2020, 02:31:49 pm by krudelu
Re: Damage dampener for individual moves help
#2  November 17, 2018, 02:33:32 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 You mean as in damage scaling that is unique for each move and doesn't scale until the very last hit of each move? I just place an fvarset in each state that possesses a hitdef and have it be monitored by a constant fvarset in state -3 so that I can have more control over how much something gets scaled and when the scaling applies. For multi-hit moves, you want to define which animation element or time the last hitbox of an attack comes out so that multi-hits only scale once. Helpers will require a parentvarset for the fvar and a root in the hitdef's damage since they have their own variables obviously.
Re: Damage dampener for individual moves help
#3  November 17, 2018, 04:52:05 am
  • **
  • (>owo)><(owo<)
I'll try to show what I may mean by trying to draw it since it can be hard for me to explain it.

Say I wanted the next move to scale by 90% (x0.9 it's damage) when cancelled from the multi hit move.

What I'm trying to do is something like this:


And I'm trying for this one to not happen:


I tried defining which animation element like this and it ends up following the second pic:
Code:
[State 200, Damage Dampen]
type = varset
trigger1 = AnimElemtime(6) >= 0 && AnimElemtime(7) < 0
trigger1 = movehit
fvar(10) = fvar(10)*0.9
ignorehitpause = 1
persistent = 0

[State 200, Damage Dampen]
type = varset
trigger1 = AnimElemtime(8) >= 0 && AnimElemtime(9) < 0
trigger1 = movehit
fvar(10) = fvar(10)*0.9
ignorehitpause = 1
persistent = 0

Is there a way for the one I tried to explain on the first pic to be done?
Last Edit: November 17, 2018, 05:07:05 am by krudelu
Re: Damage dampener for individual moves help
#4  November 17, 2018, 06:06:35 am
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
 The code actually looks very much like my damage scaling system. Seeing as I use a similar code for scaling hitdef directly, the variable will constantly stack the division after every attack landed. Anyway, you're trying to make it always do 90% of the original damage per each attack no matter what order an attack hits, right? Couldn't you just make it so that the dampener keeps track of how many times a specific attack occurs in a combo as opposed for each hit in a combo?

 Granted, I've never really tried this type before myself, so, I'd still need to look up the method of going about it.
Re: Damage dampener for individual moves help
#5  November 17, 2018, 01:35:20 pm
  • **
  • (>owo)><(owo<)
Anyway, you're trying to make it always do 90% of the original damage per each attack no matter what order an attack hits, right? Couldn't you just make it so that the dampener keeps track of how many times a specific attack occurs in a combo as opposed for each hit in a combo?

For the first question, yeah. I'm trying to make it always do 90% of the original damage of the next move that got cancelled from multi hitting move regardless of how many hits of that particular move that does the multi hit no matter at which part of the multi hit cancels into.

For the second question, I'm not sure what you may meant by it but would you mind giving me an example of what you may meant by it? Also, I'm not trying to apply a dampener that would get affected based on how many times I have the attack used in a combo just in case I may have guessed it right.
Re: Damage dampener for individual moves help
#6  November 17, 2018, 10:30:19 pm
  • ****
  • CPU Purple Heart
    • USA
    • https://www.pixiv.net/en/users/8108265
For the first question, yeah. I'm trying to make it always do 90% of the original damage of the next move that got cancelled from multi hitting move regardless of how many hits of that particular move that does the multi hit no matter at which part of the multi hit cancels into.

 Ah, might be a little trickier. Has prevstateno in conjunction of movehit worked so that it considers any hit that landed last of the multi-hit move even on cancel?

For the second question, I'm not sure what you may meant by it but would you mind giving me an example of what you may meant by it? Also, I'm not trying to apply a dampener that would get affected based on how many times I have the attack used in a combo just in case I may have guessed it right.

 Yeah, that was what I meant, but I suppose that's not right given the answer.
Re: Damage dampener for individual moves help
#7  November 18, 2018, 01:34:55 am
  • **
  • (>owo)><(owo<)
Here's what I tried:

I tried putting this code on Move B like this:

Code:
[State 200, Damage Dampen]
type = varset
triggerall = prevstateno = 2530
trigger1 = !time
fvar(10) = fvar(10)*0.9
ignorehitpause = 1
persistent = 0

State 2530 is the multi hit move (Move A) in one state and it still didn't damage dampen Move B.

However, when I tried having Move B
-2 hits (does one hit for each state)
-Have 2 separate statedefs which have the first one transition to the 2nd statedef after the first statedef is done

And while the first statedef with the hitdef didn't damage dampen, the second statedef with hitdef damage dampened.

So here's now what I tried after attempting the above. I tried making a separate statedef for the startup of Move B that transitions to a separate statedef when he's about to attack. From here, I tried applying the code above on the statedef for the startup and it seems to be working properly on me now just like how I wanted to.

Thanks for mentioning the prevstateno method.

While the "create a separate statedef for startup" method could be viable, this would require me to do it for every move that can cancel from a multi hitting move.

While this could be a good fix for my problem for now, this might inconvenience me for moves that have 1 frame startup (aka moves that have a hitbox on the first frame of the move) later on.

So while I may stick to this method for most moves, if possible, please let me know if there are better alternate methods than this.

While it seems solves, I'm going to leave it as unsolved for now.
Last Edit: November 18, 2018, 02:09:05 am by krudelu
Re: Damage dampener for individual moves help
#8  November 22, 2018, 10:05:03 am
  • *****
  • Shame on you!
    • USA
I'm not exactly sure how you have your
type = AttackMulSet
set up.
Are you using a Statedef -2 type deal, or in each move?
Are you just using the fvar in the hitdef(s) themselves?


I do a basic statedef -2 set up. I use
triggerall = stateno < 3000
so that any basic/special attack gets adjusted.
But I use a combo-counter system for the scale.
Spoiler, click to toggle visibilty

With what you're asking you'd block the basic combo varadd for that specific state. This way it'll only increase the hit 1 time by creating a varadd by itself. Something like
Spoiler, click to toggle visibilty
The && Movehit may need to be removed. Actually, that first trigger1 might have to get completely reworked.

But, the most simplest thing for you to get that first image to happen is only trigger that varset one time. I imagine you're concerned that P2 gets hit by the 3rd hit and the 1st and 2nd miss. Spawn and explod on movehit. make sure the explod can only happen 1x by setting the ID and checking for it.
In the 2nd state, check to see if the explod exists in the varset. Once the var is set, destroy the explod.

[State 200, Damage Dampen]
type = varset
triggerall = explod(718)
triggerall = prevstateno = 2530
trigger1 = !time
fvar(10) = fvar(10)*0.9
ignorehitpause = 1


In the long and short of it. Use Statedef -2 combo counter, and use an AttackMulSet.


OR You could use my explod idea, go one step further, and use a simple

[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(718)
trigger1 = fvar(10):=fvar(10)*0.9 || 1 ;This sets the fvar
id = 718
ignorehitpause = 1

to do everything. This wont reset the fvar back to 1. So you should just move everything to statedef -2.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Damage dampener for individual moves help
#9  November 30, 2018, 09:16:48 am
  • **
  • (>owo)><(owo<)
Sorry for late reply

This is how I have the attackmulset set up in statedef -3

Code:
[State -3, Attack Scale]
type = AttackMulSet
trigger1 = 1
value = fvar(10)
ignorehitpause = 1

[State -3, Reset var when the opponent recovers]
type = Varset
trigger1 = numenemy
trigger1 = (enemynear,movetype!=H)
trigger2 = !numenemy
fvar(10) = 1
ignorehitpause = 1

And I have this code for independent moves so I can assign separate damage dampeners for each move.

Code:
[State 200, Damage Dampen]
type = varset
trigger1 = movehit
fvar(10) = fvar(10)*0.9
ignorehitpause = 1
persistent = 0

Now I'm working back on the version of the character when I haven't separated the startup as a separate state to try the new method presented so I'm trying to do the explod method:

The move that does the multi-hit(Move A) have helper as the one that does the multi-hit.

So I set up the explod like this in the helper's state:
Code:
[State 0, Explod]
type = Explod
trigger1 = 1
anim = 2523
ID = 718
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
removeongethit = 0
ignorehitpause = 1

And then for Move B's state (this one doesn't use helper this time), I applied the removexplod and damage dampener:
Code:
[State 200, Damage Dampen]
type = varset
triggerall = Numexplod(718)
trigger1 = !time
fvar(10) = fvar(10)*0.9
ignorehitpause = 1

[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(718)
trigger1 = fvar(10):=fvar(10)*0.9 || 1 ;This sets the fvar
id = 718
ignorehitpause = 1
I did this since I'm not sure if the 2nd state you might be referring to is the move that's cancelled into (move B).

I tried running it and the dampener is not working. I also tried applying the varadd codes above in statedef -2 as I apply the explod and the dampener codes and it's still not working. I also tried changing the varset to parentvarset and even that still didn't work.

Is there something that I might have overlooked or missing that might be the reason why it may not have worked?
Re: Damage dampener for individual moves help
#10  December 01, 2018, 01:26:09 am
  • *****
  • Shame on you!
    • USA
 Add the explod at the beginning of the multi-hit move.
Code:
[State 0, Explod]
type = Explod
trigger1 = 1
anim = 2523
ID = 718
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
removeongethit = 0
ignorehitpause = 1

If the explod is there, and the move hits, dampen it
Code:
[State 200, Damage Dampen]
type = varset
triggerall = numexplod(718)
trigger1 = movehit
fvar(10) = fvar(10)*0.9
ignorehitpause = 1
persistent = 0

If the move hits, we only want it to dampen 90% so remove the explod.
Code:
 [State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(718)
trigger1 =movehit
id = 718
ignorehitpause = 1

Make the explod visible for testing. See that it's only on screen for one hit, then change it. This should be all you need. I'm sure there's another way, but this seems easy enough. You could pretty much copy and paste this into other moves also. You'll want to keep them in this order I believe.


----
Come to think of it, I'm pretty sure you could have adjusted
persistent = 0
to 1 so it only happens once.....
vVv Ryuko718 Updated 10/31/22 vVv