FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers) (Read 4426 times)

Started by Ricepigeon, September 29, 2015, 04:39:09 pm
Share this topic:

Ricepigeon

FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#1  September 29, 2015, 04:39:09 pm
• Gaps? Where we're going, we don't need gaps...
FrontEdgeDist gives the distance between the x-axis of the player and the edge of the screen in front of the player. FrontEdgeBodyDist gives the distance between the front of the player (as determined by the front edge of his width bar) and the edge of the screen. BackEdgeDist gives the distance between the x-axis of the player and the edge of the screen behind of the player. BackEdgeBodyDist gives the distance from the back of the player, as determined by the end of his width bar, to the back edge of the screen.

Format:
1.) FrontEdgeDist
2.) FrontEdgeBodyDist
3.) BackEdgeDist
4.) BackEdgeBodyDist
Arguments:
none
Return type:
float
Error conditions:
none

Examples:
Code:
`;Triggers if the x-axis of the player is within 30 pixels of the edge of the screen in front of him.trigger1 = FrontEdgeDist < 30;Triggers if the front of the player is within 30 pixels of the edge of the screen in front of him.trigger1 = FrontEdgeBodyDist < 30;Triggers if the x-axis of the player is within 30 pixels of the edge of the screen in back of him.trigger1 = BackEdgeDist < 30;Triggers if the back of the playerâ€™s width bar is within 30 pixels of the edge of the screen in back of him.trigger1 = BackEdgeBodyDist < 30`

Additional Notes:
Since most characters front and back will be nonzero values, using FrontEdgeDist and BackEdgeDist are not adequate methods of determining if the player is in the corner of the screen. If a player is allowed to go offscreen, such as a helper or a player using a ScreenBound SCTRL, there can be instances where the front or back of the player will offscreen, causing FrontEdgeBodyDist and BackEdgeBodyDist to return negative values, but their X-axis can still be onscreen, causing FrontEdgeDist and BackEdgeDist to return positive values. Note that using a Width SCTRL can affect the results of FrontEdgeBodyDist and BackEgdeBodyDist, but never FrontEdgeDist or BackEdgeDist.

Just No Point

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#2  September 29, 2015, 06:49:00 pm

Rai Tei

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#3  June 14, 2016, 02:50:48 pm
Is there a way to use de edge distance of p2?

Niitris

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#4  June 14, 2016, 02:57:37 pm
Yeah, use a enemy redirect (enemy,FrontEdgeDist).

Target redirect works too, not sure which is better.

XGargoyle

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#5  June 14, 2016, 03:37:53 pm
• Hedgehog Whisperer
• Red Bull addict

• Online
enemy,FrontEdgeDist and enemynear,FrontEdgeDist will return the distance of the enemy, no matter if he's been hit or not

target,FrontEdgeDist will return the distance of the enemy being hit. When the enemy is no longer in a hit state, it will not trigger, and return bottom

 XGargoyle: Battle posing since 1979http://xgargoyle.mgbr.nethttp://www.pandorabots.com/pandora/talk?botid=e71c0d43fe35093a  <-- Please click that linkhttp://paypal.me/XGargoyle  <-- Donations welcome!

Rai Tei

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#6  June 14, 2016, 03:53:19 pm
Thanks guys!

aoiro

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#7  June 28, 2016, 08:48:36 am
I was wondering if there was a way to get the end of the actual stage rather the screen, I searched, but apparently there is no such a trigger, maybe some
workround?
because sometimes you would like to make the character able to bounce from the wall, but only at the real end of the stage, and not a virtual nonexistant wall defined by the screen

Odb718

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#8  June 30, 2016, 07:30:55 pm
• Shame on you!
vVv Wheat Stage Released vVv
Last Edit: July 01, 2016, 10:05:27 pm by Odb718

AensleigheR

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#9  April 25, 2017, 08:19:23 pm
Can I use this trigger for helpers? I run into a little trouble while coding my helper. I want him to disappear as soon as he reaches the end of the stage, but it would turn out that he gets stuck on it instead. :l Can somebody help me please?

Ricepigeon

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#10  April 25, 2017, 09:38:54 pm
• Gaps? Where we're going, we don't need gaps...
Can I use this trigger for helpers? I run into a little trouble while coding my helper. I want him to disappear as soon as he reaches the end of the stage, but it would turn out that he gets stuck on it instead. :l Can somebody help me please?

Did you check to make sure that any Screenbound controllers are disabled? Would cause the problem you're describing.

AensleigheR

Re: FrontEdgeDist, FrontEdgeBodyDist, BackEdgeDist, & BackEdgeBodyDist (Triggers)
#11  April 26, 2017, 07:21:54 am
Are you talking about the stages? Well yes I have, I have set the screen bound from 1000 to 10,000 but still my helper gets stuck when the move misses.

Well the move goes like this, my character commands a 'helper' to rush forward towards the opponent. If he catches him/her, he would hold him in place for a short duration of time. L/M/H versions differ. Needless to say, if the opponent dodges or blocks the helper's initial attack, the helper would come back to me. However, if the opponent manages to DODGE only the HEAVY VERSION of the move, my helper gets stuck at the end of the stage. L and M versions work just fine :l I wonder what I did wrong?