YesNoOk
avatar

difference between enemy,stateno and p2stateno triggers? (Read 4393 times)

Started by concord23, May 26, 2016, 12:12:20 pm
Share this topic:
difference between enemy,stateno and p2stateno triggers?
#1  May 26, 2016, 12:12:20 pm
  • **
  • always trying to edit mugen chars as original game
when i was trying to convert some kof98 chars to kof97 throw system I noticed some ambiguity when i was logging enemy,stateno and p2stateno in two separate variables ,if the player is the hometeam enemy,stateno gives the enemy 's prevstateno and thus enemy,stateno is not equal to p2stateno
whereas if the player is not the hometeam enemy,stateno gives the enemy's p2stateno and thus enemy,stateno=p2stateno
I am wonderring is that a mugen bug or is some thing i dont understand so just use the displaytocilpboard with two distinct variables one for enemy,stateno and the other for p2stateno and test that both for being the hometeam or not
Re: difference between enemy,stateno and p2stateno triggers?
#2  May 26, 2016, 01:14:58 pm
  • avatar
  • ******
    • Thailand
Enemy refers to the first team member of the opposing team and even refers to dead enemies.

P2 triggers generally refer to the nearest enemy that is alive.
Re: difference between enemy,stateno and p2stateno triggers?
#3  May 26, 2016, 01:22:35 pm
  • **
  • always trying to edit mugen chars as original game
but here am talking about my test in training mode or single vs mode
Re: difference between enemy,stateno and p2stateno triggers?
#4  May 26, 2016, 01:27:52 pm
  • **
    • Brazil
    • thundermugen.com/
Enemy,StateNo will return the State Number of the first enemy found. P2StateNo will return the State Number of the nearest enemy alive.
Also, "Enemy" is a trigger redirection, this means you can check ANY trigger related to the enemy by using it.
For example, you could check if the enemy is moving using "Enemy,Vel X", you can check if the enemy is attacking using "Enemy,MoveType = A" and many other things.
ALSO, if you are on a Simul Battle, you can use "Enemy(0)" to get the first enemy found and "Enemy(1)" to get the second one.
Similar to the "Enemy" trigger redirection, there are other ones:
EnemyNear = redirects to the nearest enemy, you can also use "EnemyNear(0)" and "EnemyNear(1)"
Parent = redirects to the object that created the helper, this can be the char or another helper
Root = redirects to the char that owns the helper
Helper = redirects to the first helper found, you can also use "Helper(ID)" to redirect to the helper you want
Partner = redirects to your partner in simul battles
Target = redirects to whatever is being hit by you, you can also use "Target(ID)" to redirect to an enemy that was hit by an specific hitdef
PlayerID(ID) = redirects to the player that has the specified ID.
Re: difference between enemy,stateno and p2stateno triggers?
#5  May 26, 2016, 01:32:55 pm
  • **
  • always trying to edit mugen chars as original game
thanks Thunderbert for this clarification but i did that test:
[state disp]
type = DisplayToClipboard
trigger1 = 1
text = "enemy,stateno=%d,p2stateno=%d"
params = (enemy,stateno),p2stateno
IgnoreHitPause = 1
and i noticed significant difference between being hometeam and the reverse in the training mode or single vs mode like i posted
-player is hometeam:enemy,stateno is not equal to p2stateno that is enemy,stateno=enemy,prevstateno
-player is not hometeam:enemy,stateno=p2stateno
just test that displaytoclipboard in training mode with  being player1 first time  and player2 second time and compare eash time enemy,stateno and p2stateno
Last Edit: May 26, 2016, 01:46:01 pm by concord23
Re: difference between enemy,stateno and p2stateno triggers?
#6  May 26, 2016, 02:30:34 pm
  • **
    • Brazil
    • thundermugen.com/
Here, Enemy,StateNo and P2StateNo returned the same value... Being it in the HomeTeam or the other one...
Re: difference between enemy,stateno and p2stateno triggers?
#7  May 26, 2016, 06:33:28 pm
  • **
  • always trying to edit mugen chars as original game
yes ,forgive me i realised that the problem were caused by mugen.cfg that one day i  set these helpermax,spiritedecompressionsize,sysexploadmax... with higher values
Re: difference between enemy,stateno and p2stateno triggers?
#8  January 11, 2018, 10:10:12 am
  • avatar
  • **
    • Vietnam
thanks Thunderbert for this clarification but i did that test:
[state disp]
type = DisplayToClipboard
trigger1 = 1
text = "enemy,stateno=%d,p2stateno=%d"
params = (enemy,stateno),p2stateno
IgnoreHitPause = 1
and i noticed significant difference between being hometeam and the reverse in the training mode or single vs mode like i posted
-player is hometeam:enemy,stateno is not equal to p2stateno that is enemy,stateno=enemy,prevstateno
-player is not hometeam:enemy,stateno=p2stateno
just test that displaytoclipboard in training mode with  being player1 first time  and player2 second time and compare eash time enemy,stateno and p2stateno

Enemy,Stateno usually different than p2stateno because the opponent helper type can be considered as a p2. So in character coding especially AI editor. I rarely use p2stateno unless I want to build a character's defence move. Clearly enough. Enemy,Stateno is refer to an Root stateno and p2stateno can be an root stateno or an Helper stateno.
------Tremble Mortal and Despair. Doom has come to this world------