collapse

Author Topic: Figuring out p2 distances and using accurate values  (Read 958 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:November 14, 2024, 07:28:12 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: 12476
  • Country: Brazil br
  • Last Login:November 11, 2024, 12:35:15 PM
  • 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

D2TD VS Showcase Thread by D2TD
[Today at 09:12:03 AM]


Marvel vs. Capcom: Eternity of Heroes REMAKE Game Update 1.3.0 - N.A.O.H. by LightFlare
[November 21, 2024, 09:44:09 PM]


Terrordrome: Rise of the Boogeymen Extended Version ( jeepers creepers) version by leonardo
[November 19, 2024, 10:22:47 PM]


Hill of the Nameless(1.1 Only) by Vegaz by LightFlare
[November 19, 2024, 10:50:39 AM]


Golden Axe Returns by gokudo99
[November 19, 2024, 03:59:31 AM]


Barkley Shut Up and Jam! Stages by Vegaz by LightFlare
[November 12, 2024, 11:26:21 AM]


[BOR] _Avengers United Battle Force_ by O Ilusionista
[November 11, 2024, 12:35:24 PM]


Eternal Lament Stage 1.1 & 1.0 by O Ilusionista
[November 11, 2024, 12:34:54 PM]


MatreroG's Stages W.I.P. Concepts by MatreroG
[November 11, 2024, 07:00:56 AM]


Spooky House(1.1 Only/AIGS) by Vegaz by LightFlare
[October 31, 2024, 11:31:36 AM]

* IMT Calendar

November 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