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:
;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.
Might not be helpful to AensleigheR, but maybe will be to someone else.
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.
You want to put a ScreenBound state controller in your helper's state, which will allow it to actually go off screen. The simplest example of such SCTRL would look like this:
[State whatever]
type = ScreenBound
trigger1 = 1; active always while the helper is in this state
value = 0; allow going off screen
Then you can use DestroySelf on the helper when it's well off the screen. You should know its approximate size in pixels and the direction you have it move in (most likely, forward). Say, it's 100 pixels wide and moves forward. In this case, when its FrontEdgeDist reaches -50, it's entirely off the screen: -EdgeDist triggers take the difference between your character's X axis and the corresponding edge rather than your character's edge and the stage edge. Multiply this by 1.5 just to make sure and you have this:
[State whatever]
type = DestroySelf
triggerall = ishelper; it's good practice to perform this check.
; If you accidentally put this SCTRL into a non-helper state or
; if your helper shares states with the character themself, you
; won't get the "DestroySelf called for non-helper" message.
trigger1 = frontedgedist < -75; adjust as necessary
If your helper is moving backwards instead of forward, you do the same, but use BackEdgeDist instead of FrontEdgeDist. -Dist triggers are more reliable than -BodyDist ones in case you have to go beyond the screen boundaries because they don't depend on the width and height of your character.