I know there's an auto-run event to check whenever the player entered a warp, however it still requires some setup to know when the player has ended warping. It's not the same entering a door than entering a pipe, and it's not the same entering an pipe horizontally than vertically, (and not to mention the transitions effects). To differentiate between these three things, it would require us to three events, and trigger them on every warp in order to know exactly when the player is warping and the type of warp it's in.
It's important to know when the player is warping in case you want to lock certain custom actions while warping.
That's why I suggest a variable that turns 1 (or any other value greater than 0) whevener the player is warping, and turns 0 when the player is able to move again. This is not needed for instant/loop warps. In the case of pipe warps being projectiles, this property could take the value of 2 until the player is ascending, and turn 0 when the player is able to move again (it isn't completely necessary, it's just a small suggestion).
char(1).blinking (Read Only)
A variable that turns 1 everytime the player is invisible when blinking (when got hurt or when got a power-up). For example:
The reason why I'm suggesting this to be a property instead of manually setting up it is because.
a. It requires a complex setup. The player blinks differently depending if got hurt, got a power-up and the type of power-up it is (either "special" or not).
b. The blinking effect is random so no matter what you do, you won't be able to perfectly sync the script with the player.
c. It is important that the script be accurately syncronized with the player, if you're doing for example a custom vehicle or anything that attachs the player (e.g a custom Spiny Hat or the Cape Feather).
Even after this setup the system is still not reliable. All this process can be a lot simplified by just making it a property If for example someone was working with a custom playable that's being drawn through a bitmap, and want it to blink as the player would do, he could only do this:
Code: Select all
bitmap().hide = char(1).blinking
(Additionally, this value can turn -1 when the player got a power-up/got hurt and while cannot move, but this isn't as important as what I said above)
char(1).curframe (Read Only)
Similar to npc's curframe, it would store a value indicating the current player's animation.
It doesn't have to be writable, being read only would be more than enough. This would be very useful for doing effects that syncs with the player (e.g a Starman effects that leaves flashy effects, or a custom accesory like a Spiny Hat from SMM or the Cape Feather, taking the previous examples).
I made this sheet to show how it would work:
This way, the difference between facing left and right it's just a sign (I assume that's how the frames are programmed)