YesNoOk
avatar

Melee attack that tracks the opponent's horizontal position (Read 9662 times)

Started by DeluxeGamer705, September 15, 2024, 07:56:05 pm
Share this topic:
Melee attack that tracks the opponent's horizontal position
New #1  September 15, 2024, 07:56:05 pm
  • **
  • Gaming is so fun!
    • Poland
    • sites.google.com/view/dxgsmugensite/main-page
I'm having a bit of a problem with one thing involving tracking.

I'm trying to make a move that tracks the opponent's horizontal position. The thing, though, is that the tracking comes from the character that does an attack that tracks the opponent's horizontal position.

The code I'm using is this:

Code:
[State 0, PosSet]
type = PosSet
trigger1 = !time
x = enemy,pos x

The problem here occurs in simul matches. The move only tracks the team leader's position, whiffing if they're K.O.'d as it doesn't start tracking the teammates' positions.

I would really appreciate the help.


Also known as "BartekZioomPro" (crappy name, I know).
Playin' Mugen since 2017, creating content since 2022.
Last Edit: September 17, 2024, 10:32:12 pm by DeluxeGamer705
Re: Melee attack that tracks the opponent's horizontal position
#2  September 15, 2024, 09:01:16 pm
  • ****
  • Formerly DeathScythe
    • Brazil
    • lyricasky.neocities.org
Enemy always redirects to the first enemy found. Alternatively, you can use EnemyNear, it redirects to the nearest enemy.
You can even check if the first enemy is alive and then redirect to the second one:
Code:
ifelse((enemy, alive), (enemy, pos x), (enemy(1), pos x))
Enemy(1) will redirect to the second enemy found. :P
Last Edit: September 15, 2024, 09:14:23 pm by Lyrica
Re: Melee attack that tracks the opponent's horizontal position
#3  September 15, 2024, 09:16:06 pm
  • **
  • Gaming is so fun!
    • Poland
    • sites.google.com/view/dxgsmugensite/main-page
Enemy always redirects to the first enemy found. Alternatively, you can use EnemyNear, it redirects to the nearest enemy.
You can even check if the first enemy is alive and then redirect to the second one:
Code:
ifelse((enemy, alive), (enemy, pos x), (enemy(1), pos x))
Enemy(1) will redirect to the second enemy found. :P

Thanks! It now works as it should. :)


Also known as "BartekZioomPro" (crappy name, I know).
Playin' Mugen since 2017, creating content since 2022.