Someone will probably pop in with a better answer... but here is my input. If you want your character to jump a certain direction/height before performing the attack, then I suggest you continuously monitor P2 / adjust a Var, so that your jump trigger and the attack trigger can rely on what the Var is. If you just want the AI to decide which variation of the attack to perform while in the air, then you should be able to just take a quick location check and set a Variable.... or possibly make a big conditional parameter on your changestate. As for positioning, I recommend reviewing the code I use for my character Jailbot, which constantly monitors P2's location in order to choose which face image to use (He looks at the enemy throughout the fight). Relavent code:Example usage... chooses correct "face" when idle. [State 0, Stand face] type = Explod trigger1 = anim = 0 ID = 1000 anim = 10000 + var(7) And this is the monitoring system I use in State -3... There are 18 different faces he chooses from for 18 different regions P2 is on the screen. So, you could probably consolidate your definitions to larger, fewer regions. You could also factor in stuff like enemy's current x and y vel to maybe select a different var than just "current location". Note that I use Null controllers to better organize varsets, especially when there are numerous ones. Also note my comments such as "R" and "RR" are just a quick reference as to how far away the enemy is. So, "UURRR" refers to when the enemy is far above and at the far opposite side of the screen.[State -3, Normal Face Changer - Look Neutral] type = Null triggerall = numenemy triggerall = EnemyNear,statetype != C && (EnemyNear,StateNo != [10,12]) ;Enemy not crouching trigger1 = p2dist x < 120 && p2dist y > -20 ;NEAR trigger1 = var(7) := 0 trigger2 = (p2dist x >= 120 && p2dist x < 200) && p2dist y > -30 ;R trigger2 = var(7) := 4 trigger3 = p2dist x >= 200 && p2dist y > -40 ;RR trigger3 = var(7) := 8 [State -3, Normal Face Changer - Looking Up] type = Null triggerall = numenemy triggerall = p2dist x < 120 trigger1 = p2dist y < -20 && p2dist y >= -40 ;U trigger1 = var(7) := 1 trigger2 = p2dist y < -40 && p2dist y >= -60 ;UU trigger2 = var(7) := 2 trigger3 = p2dist y < -60 ;UUU trigger3 = var(7) := 3 [State -3, Normal Face Changer - Looking Up / Right] type = Null triggerall = numenemy triggerall = p2dist x >= 120 && p2dist x < 200 trigger1 = p2dist y < -30 && p2dist y >= -50 ;UR trigger1 = var(7) := 5 trigger2 = p2dist y < -50 && p2dist y >= -70 ;UUR trigger2 = var(7) := 6 trigger3 = p2dist y < -70 ;UUUR trigger3 = var(7) := 7 [State -3, Normal Face Changer - Looking Up / Right Right] type = Null triggerall = numenemy triggerall = p2dist x >= 200 trigger1 = p2dist y < -40 && p2dist y >= -60 ;URR trigger1 = var(7) := 9 trigger2 = p2dist y < -60 && p2dist y >= -80 ;UURR trigger2 = var(7) := 10 trigger3 = p2dist y < -80 ;UURRR trigger3 = var(7) := 11 [State -3, Normal Face Changer - Start Looking Down] type = Null triggerall = numenemy triggerall = (EnemyNear,anim = 10 || EnemyNear,anim = 12) || p2dist y = [21,40] ;Starting to crouch, or low trigger1 = p2dist x < 120 ;NEAR trigger1 = var(7) := 12 trigger2 = p2dist x >= 120 && p2dist x < 200 ;R trigger2 = var(7) := 14 trigger3 = p2dist x >= 200 ;RR trigger3 = var(7) := 16 [State -3, Normal Face Changer - Looking Down] type = Null triggerall = numenemy triggerall = EnemyNear,anim = 11 || p2dist y > 40;Enemy is crouching, or very low trigger1 = p2dist x < 120 ;DD trigger1 = var(7) := 13 trigger2 = (p2dist x >= 120 && p2dist x < 200) ;DDR trigger2 = var(7) := 15 trigger3 = p2dist x >= 200 ;DDRR trigger3 = var(7) := 17 [State -3, Normal Face Changer - No Enemy] type = varset trigger1 = !numenemy var(7) = 0 Spoiler: Video showing my technique in action (click to see content)
VIDEO