YesNoOk
avatar

TargetLifeAdd (SCTRL) (Read 24469 times)

Started by Ricepigeon, October 19, 2015, 05:18:17 pm
Share this topic:
TargetLifeAdd (SCTRL)
#1  October 19, 2015, 05:18:17 pm
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
Adds the specified amount to all targets' life, scaled by the targets' defense multipliers if necessary.

Required parameters:

    value = add_amt (int)
        add_amt is added toe ach target's life.

Optional parameters:

    ID = target_id (int)
        Specifies the desired target ID to affect. Only targets with this target ID will be affected. Defaults to -1 (affects all targets.)
    kill = kill_flag (boolean)
        If kill_flag is 0, then the addition will not take any player below 1 life point. Defaults to 1.
    absolute = abs_flag (boolean)
        If abs_flag is 1, then add_amt will not be scaled (i.e. attack and defense multipliers will be ignored). Defaults to 0.

IKEMEN GO-exclusive parameters:

    Dizzy = value (boolean)
        If set to 1, enables dmg to dizzy points conversion support using Default.LifeToDizzyPointsMul / Super.LifeToDizzyPointsMul const. Defaults to 1.

Example:
Code:
;Fighter Factory 3
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 =
value =
ID = -1
kill = 1
absolute = 0
;ignorehitpause =
;persistent =

Related SCTRL:
BindToTarget (SCTRL)
TargetBind (SCTRL)
TargetDrop (SCTRL)
TargetFacing (SCTRL)
TargetPowerAdd (SCTRL)
TargetState (SCTRL)
TargetVelAdd (SCTRL)
TargetVelSet (SCTRL)

Related Triggers:
NumTarget (Triggers)

Additional Notes:
This controller is almost always used when you have Player2 in a custom state, such as a throw or a grab, and eliminates the use of adding more HitDefs in order to create more cinematic-looking attacks. This controller is almost always used in conjunction with the TargetState controller as a result.
Last Edit: September 29, 2023, 04:36:45 am by Ricepigeon
Re: TargetLifeAdd (SCTRL)
#2  March 03, 2022, 10:03:40 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
I guess bumping these threads is OK.

If you put a target redirection in the value field, Mugen (1.0) will crash without notice when you have more than one target (Simul).

Something as innocent as this:

Code:
[State 200, Damage]
type = targetlifeadd
trigger1 = movehit = 1
value = ifelse(target, statetype = A, 10, 20)

You can avoid it by adding a numtarget = 1 trigger or dropping one target when you have two, with the obvious limitations that causes.

This may happen with more state controllers of the "target" family, but I haven't tested it.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.

2OS

Re: TargetLifeAdd (SCTRL)
#3  March 04, 2022, 04:30:06 pm
  • ****
  • 608 Wannabe
  • Ich schicke dich zur HOELLE!! STIRB DU FEIGLING!!
    • Egypt
it's actually the redirection that's the problem not the state controllers

when you obtain more than one target through a hit (simul as you've described) mugen doesn't know which one to redirect to hence the crash/freeze
Re: TargetLifeAdd (SCTRL)
#4  March 04, 2022, 06:19:39 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
They both work fine on their own, though. It's when you combine the state controllers and redirection that weird things happen. Instead of just picking one target and redirecting to that like it usually does (not sure which criteria it uses), it complicates things and then freezes. Like the redirection has special handling for those sctrl's.

Since that got a reply I went ahead and checked the other "target" sctrl's and, sure enough, they make Mugen crash too.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: TargetLifeAdd (SCTRL)
#5  March 04, 2022, 07:22:14 pm
  • ****
  • Vs Style Debuts Tag Project CEO
  • The Dark Wolf Returns
    • USA
I believe you were supposed to put the bottom code in parenthesis
What you posted
Code:
[State 200, Damage]
type = targetlifeadd
trigger1 = movehit = 1
value = ifelse(target, statetype = A, 10, 20)
Will cause Mugen to crash because the ifelse has 3 commas when 2 is supposed to be used hence the if-else scenario. Also, NumTarget is supposed to be used in the trigger.

It's supposed to look like this:
Code:
[State 200, Damage]
type = targetlifeadd
triggerall = numtarget
trigger1 = movehit = 1
value = ifelse((target, statetype = A), 10, 20)
Beware the Dark Wolf once more!
Re: TargetLifeAdd (SCTRL)
#6  March 04, 2022, 10:48:29 pm
  • ****
  • it's me
  • Bat's a Wrap.
    • Chile
    • koakoa@jabber.org
    • Skype - koakumadevil69
I was screwing around with the engine trying to find ways to crash the game with this and I am starting to think it's specifically the target controllers' parameters because:

This doesn't crash the game:
Code:
[State Trip]
type = ChangeState
triggerall = (stateno = 420) || (prevstateno = 420 && (time = [0,1]))
triggerall = movehit = 1 && hitpausetime = var(2)
trigger1 = numtarget(420)
trigger1 = !target(420),ishelper || playeridexist(target(420),id)
value = 470 + 0*(target(420),ctrl)
;ID = 420
ignorehitpause = 1

This does:
Code:
[State Trip]
type = TargetState
triggerall = (stateno = 420) || (prevstateno = 420 && (time = [0,1]))
triggerall = movehit = 1 && hitpausetime = var(2)
trigger1 = numtarget(420)
trigger1 = !target(420),ishelper || playeridexist(target(420),id)
value = 470 + 0*(target(420),ctrl)
ID = 420
ignorehitpause = 1

I'll continue to post my findings about this in this thread as I experiment
Yeaaaah im shootign ducks wiht the paino
Re: TargetLifeAdd (SCTRL)
#7  March 05, 2022, 03:10:22 pm
  • ******
    • Portugal
    • network.mugenguild.com/pots/
I believe you were supposed to put the bottom code in parenthesis
What you posted
Oh, I just wrote that to illustrate the engine bug. It's not from a char.

Your version of the code still crashes Mugen, so I guess that's scientific confirmation, hehe.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
Re: TargetLifeAdd (SCTRL)
#8  March 15, 2022, 04:27:50 am
  • ****
  • Vs Style Debuts Tag Project CEO
  • The Dark Wolf Returns
    • USA
Well that's strange...
Beware the Dark Wolf once more!
Re: TargetLifeAdd (SCTRL)
#9  September 29, 2023, 04:37:28 am
  • *****
  • Thanks and God bless
    • USA
    • ricepigeon.neocities.org
Updated first post to include new parameters that are exclusive to IKEMEN GO.