collapse

Author Topic: Figuring out p2 distances and using accurate values  (Read 744 times)

0 Members and 1 Guest are viewing this topic.

Offline supermystery

  • MUGEN Content Architect
  • *****
  • Posts: 125
  • Last Login:July 02, 2011, 02:22:50 PM
    • Supermystery's Site
Figuring out p2 distances and using accurate values
« on: December 08, 2008, 07:58:44 AM »
This something i use in debug mode to judge how far an opponent is, its also very useful for when your doing the AI too. Put the coding under statedef -2.


Code: [Select]
[State -2, DTC]
type = DisplayToClipboard
trigger1 = 1
text = "P2BodyDist X = %d, P2BodyDist Y = %d, Frontedgedist = %d, Backedgedist = %d"
params = Floor(P2BodyDist X), Floor(P2BodyDist Y), frontedgedist, backedgedist
IgnoreHitPause = 1


You should be able to see more information when you use debug mode (Ctrl + D).

Heres an example of what it looks like:





Check out Mugen - Lair Below

Mugen - Lair

Offline pkon

  • Initiate
  • **
  • Posts: 30
  • Last Login:November 26, 2009, 09:28:52 PM
Re: Figuring out p2 distances and using accurate values
« Reply #1 on: December 08, 2008, 08:39:43 PM »
Thank you for the code. now i can code my ai better.

Offline Excursion

  • Webmaster
  • Infinity Administrator
  • *
  • Posts: 2803
  • Country: United States us
  • Last Login:April 27, 2024, 07:12:37 PM
    • Excursion's Corner
    • Email
Re: Figuring out p2 distances and using accurate values
« Reply #2 on: December 26, 2008, 02:24:23 PM »
Sorry I'm late with a reply, but this code helped me out immensely, thank you supermystery  :)

Offline O Ilusionista

  • Since 1999 and kicking :)
  • IMT Content Architect
  • *
  • Posts: 12459
  • Country: Brazil br
  • Last Login:April 27, 2024, 11:21:03 AM
  • OpenBOR & Mugen addicted
    • BMT - Brazil Mugen Team
    • Email
Re: Figuring out p2 distances and using accurate values
« Reply #3 on: December 26, 2008, 02:54:37 PM »
This code is good and very used..but doesn't works well on simul modes. Plus, P2BodyDist gives the distance of P2 FRONT CLSN position, not his X axis position. P2DistX give you p2 X axis position though.

For simul modes, you should use EnemyNear:

Quote
[State -2, Debug Info]
type = DisplayToClipboard
trigger1 = roundstate > 0
text = "P2 Distance X: %f, P2 Distance Y: %f"
params = (Pos X-(enemyNear, Pos X)), (Pos y-(enemyNear, Pos y))

It will return a negative value, because you're on a negative position from p2.

Tags:
 


* IMT Facebook

Help us by Donating!

IMT Discord

Join us at our Discord! Click the image below!

* IMT Shoutbox

Sorry, this shoutbox does not exist.

* Recent Posts

* IMT Calendar

April 2024
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
[28] 29 30

SimplePortal 2.3.5 © 2008-2012, SimplePortal