YesNoOk
avatar

P2BodyDist/specific y axis for player 2 trigger? (Read 188 times)

Started by MDI, June 09, 2014, 08:07:02 am
Share this topic:

MDI

P2BodyDist/specific y axis for player 2 trigger?
#1  June 09, 2014, 08:07:02 am
  • *****
    • mugen.yolasite.com/stages.php
I'm trying to figure out if there is a way to trigger a state based on player 2 being at an exact number in regards to above p1's above axis. This is what I have so far

triggerall = P2BodyDist Y < -8
trigger1 = FrontEdgeDist > 58
trigger1 = BackEdgeDist > 58

Essentially it is a helper that acts as a platform for player 2 to step on. It works perfectly well aside from the fact that since the P2BodyDist trigger serves as letting you have player 2 at LEAST a certain height above player 1, when I'd prefer it to be more specific. My main problem right now is that the player ends up a few pixels before or above the platform's sprite when I want to be exactly on it.

If I could say have P2BodyDist = 9 (pixels above p1, no more no less) then THAT would be good.

Is such a thing possible?


Here is a pic to illustrate my problem
Anonymous said:
Actually you racist ass, rap was a good choice for that particular trailer.
Last Edit: June 09, 2014, 08:12:03 am by MDI
Re: P2BodyDist/specific y axis for player 2 trigger?
#2  June 09, 2014, 10:28:03 am
  • ***
    • USA
So the character is jumping onto the platform, and depending on how mugen feels, the character either lands inside it, or floating above it, or possibly perfect?
What ever code you use to get it to land, in the land state, make a posset or posadd. Check for time = 0, make that check see the y pos for the block and the y pos for p1. Then use some math to subtract or add the right amount. You should be good.
           

MDI

Re: P2BodyDist/specific y axis for player 2 trigger?
#3  June 09, 2014, 11:06:33 am
  • *****
    • mugen.yolasite.com/stages.php
I went back and now realize that my frontedge and backedge triggers were pretty useless. How I have it is that the platform has a hitbox which "attacks" the player 1 and forces it into state 0 while on the platform.



Spoiler, click to toggle visibilty

I have "trigger1 = P2BodyDist Y < -12" but time = 0 seems to do the same purpose. All that seems to matter is the hitbox itself. Using a hitdef might be the wrong way to go about this but I have tried target state as well and no success with that.

Could you perhaps take what you described and show me an example in the code? Also, do you think the fact that it is indeed a hitdef might be kinda screwing up my plan here?

Also, video for reference including clsns at 0:30 point.
https://www.youtube.com/watch?v=4cgp8Kfljuw
Anonymous said:
Actually you racist ass, rap was a good choice for that particular trailer.
Re: P2BodyDist/specific y axis for player 2 trigger?
#4  June 09, 2014, 12:10:33 pm
  • ***
    • USA
hmm, you could send it to a custom state that turns around and sends it to statedef 0 once it's put it in the proper position.
Kinda like a throw.
Try using a custom state and a targetbind.
[Statedef 718]
type    = S
movetype= A
physics = N

[State 718, 1]
type = targetbind
trigger1 = time = 0
pos = pos x, -9  ;*

[State 718, return]
type = changestate
trigger1 = time = 1
value = 0
ctrl = 1


-9 because that's how many pixels from the bottom of the platform and I'm just guessing where it's 0x axis is based.
Mugen can be funky with 'invisible' statedefs. I've made a bunch for my Samus. Sometimes it wants something for 1 tic so I put the time =1, you may be able to get the changestate to trigger at time = 0 and still have the pos change properly.