The Mugen Fighters Guild

Help => M.U.G.E.N Development Help => MUGEN Class => Topic started by: Ricepigeon on October 19, 2015, 05:18:17 pm

Title: TargetLifeAdd (SCTRL)
Post by: Ricepigeon on October 19, 2015, 05:18:17 pm
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) (http://mugenguild.com/forum/topics/bindtotarget-sctrl-170088.0.html)
TargetBind (SCTRL) (http://mugenguild.com/forum/topics/targetbind-sctrl-170204.0.html)
TargetDrop (SCTRL) (http://mugenguild.com/forum/topics/targetdrop-sctrl-170205.0.html)
TargetFacing (SCTRL) (http://mugenguild.com/forum/topics/targetfacing-sctrl-170206.0.html)
TargetPowerAdd (SCTRL) (http://mugenguild.com/forum/topics/targetpoweradd-sctrl-169929.0.html)
TargetState (SCTRL) (http://mugenguild.com/forum/topics/targetstate-sctrl-169309.0.html)
TargetVelAdd (SCTRL) (http://mugenguild.com/forum/topics/targetveladd-sctrl-170207.0.html)
TargetVelSet (SCTRL) (http://mugenguild.com/forum/topics/targetvelset-sctrl-170208.0.html)

Related Triggers:
NumTarget (Triggers) (http://mugenguild.com/forum/topics/numtarget-triggers-169464.0.html)

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 (http://mugenguild.com/forum/topics/targetstate-sctrl-169309.0.html) controller as a result.
Title: Re: TargetLifeAdd (SCTRL)
Post by: PotS on March 03, 2022, 10:03:40 pm
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.
Title: Re: TargetLifeAdd (SCTRL)
Post by: 2OS on March 04, 2022, 04:30:06 pm
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
Title: Re: TargetLifeAdd (SCTRL)
Post by: PotS on March 04, 2022, 06:19:39 pm
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.
Title: Re: TargetLifeAdd (SCTRL)
Post by: DarkWolf13 on March 04, 2022, 07:22:14 pm
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)
Title: Re: TargetLifeAdd (SCTRL)
Post by: jaede_ on March 04, 2022, 10:48:29 pm
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
Title: Re: TargetLifeAdd (SCTRL)
Post by: PotS on March 05, 2022, 03:10:22 pm
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.
Title: Re: TargetLifeAdd (SCTRL)
Post by: DarkWolf13 on March 15, 2022, 04:27:50 am
Well that's strange...
Title: Re: TargetLifeAdd (SCTRL)
Post by: Ricepigeon on September 29, 2023, 04:37:28 am
Updated first post to include new parameters that are exclusive to IKEMEN GO.