YesNoOk
avatar

Trigger when enemy's partner is dead? (Read 2994 times)

Started by Mr. Giang, July 20, 2018, 05:16:41 am
Share this topic:
Trigger when enemy's partner is dead?
#1  July 20, 2018, 05:16:41 am
  • ***
  • The Illusionary Wanderer
  • I have a dream
    • Vietnam
I'm having trouble at creating a move which only triggers when opponent's partner is dead. Is there any triggers which is similiar to "Partner, Alive" but applies to opponents?
Re: Trigger when enemy's partner is dead?
#2  July 20, 2018, 06:52:20 am
  • **
  • Sr. Símio Enfermo
    • Brazil
    • www.facebook.com/people/Manson-Rees/100027897993934
This goes in StateNo -2:

Code:
[State -2, VarSet]
type = VarSet
triggerAll = NumEnemy && TeamMode = Simul
trigger1 = !(Enemy(NumEnemy-1), Alive)
var(33) = 1
ignorehitpause = 1

I haven't test this code yet, but give it a try. :)
Re: Trigger when enemy's partner is dead?
#3  July 20, 2018, 01:17:32 pm
  • ***
  • The Illusionary Wanderer
  • I have a dream
    • Vietnam
That doesn't work, I'm fraid.

Code:
[State -1,Valkyrie Veil]
type = ChangeState
value = 3050
triggerall = power >= 2000
triggerall = var(33) = 1
triggerall = command = "Valkyrie Veil"
trigger1 = statetype = S && ctrl
Re: Trigger when enemy's partner is dead?
#4  July 20, 2018, 05:06:36 pm
  • **
  • Sr. Símio Enfermo
    • Brazil
    • www.facebook.com/people/Manson-Rees/100027897993934
That doesn't work, I'm fraid.

Code:
[State -1,Valkyrie Veil]
type = ChangeState
value = 3050
triggerall = power >= 2000
triggerall = var(33) = 1
triggerall = command = "Valkyrie Veil"
trigger1 = statetype = S && ctrl

I tested this code in KFM, and it is working:

Code:
[State -2, P4 is KnockOut?]
type = VarSet
triggerAll = NumEnemy
trigger1 = !(Enemy(NumEnemy=2), Alive)
var(33) = 1
ignorehitpause = 1

or

Code:
[State -2,One enemy is KnockOut at least]
type = VarSet
triggerAll = NumEnemy
trigger1 = !(Enemy(0), Alive) || !(Enemy(NumEnemy=2), Alive)
var(33) = 1
ignorehitpause = 1
Last Edit: July 20, 2018, 05:10:08 pm by Manson Rees
Re: Trigger when enemy's partner is dead?
#5  July 21, 2018, 11:48:35 pm
  • *****
  • Shame on you!
    • USA
Partner,
Redirects the trigger to the player's partner. Normal helpers and neutral players are not considered opponents. See the related trigger "numpartner" in the trigger documentation.
vVv Ryuko718 Updated 10/31/22 vVv
Re: Trigger when enemy's partner is dead?
#6  July 22, 2018, 02:59:43 am
  • **
  • Sr. Símio Enfermo
    • Brazil
    • www.facebook.com/people/Manson-Rees/100027897993934
Partner,
Redirects the trigger to the player's partner. Normal helpers and neutral players are not considered opponents. See the related trigger "numpartner" in the trigger documentation.

You can't use a redirect in another redirect...
Re: Trigger when enemy's partner is dead?
#7  July 22, 2018, 04:47:15 am
  • ****
    • USA
    • twitter.com/inktrebuchet
I’m confused. Are you only trying to find a trigger for if P4 is not alive? Or for if P4 is alive but P2 is not alive? Both?

There is a way to do this with playerids too but it’s only worth doing if you need more than just !alive.
Last Edit: July 22, 2018, 05:10:57 am by ink
Re: Trigger when enemy's partner is dead?
#8  July 22, 2018, 09:03:55 am
  • *****
  • Shame on you!
    • USA
lol I misread everything... like usual.
So this will add to the value if either char is dead. If P2 dies the round is over for me, but using displaytoclipboard I can see the var adding up.
Code:
[State 0, VarSet]
type = Varadd
triggerall = NumEnemy
trigger1 = !(Enemy(0), Alive) && (Enemy(NumEnemy=2), Alive) || !(Enemy(NumEnemy=2), Alive)  && (Enemy(0), Alive)
v = 41
value = 2 
Using Var(41) >= 10 to try and switch states didn't work though. Not entirely sure why. It seems as though you only want the trigger1 check after the Or/||
vVv Ryuko718 Updated 10/31/22 vVv
Re: Trigger when enemy's partner is dead?
New #9  July 26, 2018, 05:23:02 am
  • avatar
  • **
    • Vietnam
Partner,
Redirects the trigger to the player's partner. Normal helpers and neutral players are not considered opponents. See the related trigger "numpartner" in the trigger documentation.

Partner can considered Player-Helper is Partner. I have test that code for my char and it triggered despite there is no real partner in single or turn mode add "!Partner,ishelper" that will make AI more smarter despite he has player-helper. About Enemy's Partner, since there is no multiple trigger, Use Numenemy and alive value to trigger what enemy should be triggered.

[State -3]
type = varset
trigger1  = !ishelper ---> not trigger with helper
trigger1  = numenemy = 1 --> if there is only one enemy in the field mean Single or Turn mode
fvar(12) = 0 ---> since there is only one enemy in the field , you set this value to "0" prefered to the closest enemy
persistent = 256
ignorehitpause = 1

[State -3]
type = varset
trigger1  = !ishelper
trigger1  = numenemy >= 2 --> if there is more than 1 enemy in the field
trigger1  = enemy(0),alive && enemy(1),alive --> only trigger if both of them is still alive
fvar(12) = ifelse((Abs(pos x - enemy(0),pos x) < Abs(pos x - enemy(1),pos x)),0,1) ---> this code replace the enemynear's trigger and make AI work corectly to the real player.
persistent = 256
ignorehitpause = 1

[State -3]
type = varset
trigger1  = !ishelper
trigger1  = numenemy >= 2 --> if there is more than 1 enemy in the field
trigger1  = !enemy(0),alive || !enemy(1),alive --> if there is one man been KO and the other still alive
fvar(12) = ifelse(!(Enemy(0),alive),1,0) ---> this one is really easy to guest
persistent = 256
ignorehitpause = 1

You can trigger like this in 3v3 or 4v4 simul. Good Luck Homies.
NOTE that the ignorehitpause's params must be add in any circumstance especially in combo move.
------Tremble Mortal and Despair. Doom has come to this world------
Last Edit: July 26, 2018, 05:35:42 am by Archimonde