Expose a bunch of functions to Lua
Exposes P_CheckSkyHit
, P_IsLocalPlayer
, P_GivePlayerSpheres
, P_DoFiring
, P_DoSpinDashDust
, P_DoSpinAbility
, P_PlayerShieldThink
, P_DoJumpStuff
, P_DoTailsOverlay
, P_DoMetalJetFume
, and P_TouchSpecialThing
to Lua while adding in P_DoFollowMobj
as well.
P_CheckSkyHit
has been modified slightly to work in Lua. P_TouchSpecialThing
also gets a quick fix for the blue sphere collection effect not being applied to flung spheres.
This merge request has been tested to make sure every function works. You can test using this wad and this exe if you want. The Lua in the wad makes spindash dust appear when above run speed on the ground (P_DoSpinDashDust
), allows you to do the homing thok and spin as any character with Custom 1 (P_DoJumpStuff
/P_DoSpinAbility
), and lets you throw fireballs whenever that can collect most of SRB2's collectables using Custom 2 (P_DoFiring
/P_TouchSpecialThing
). Sonic also gets his thok overwritten by any shield abilities, just like how shields work in S3K and Mania (P_PlayerShieldThink
). Amy is given a fake followmobj in the form of Tails' tails that's colored emerald (P_DoFollowMobj
/P_DoTailsOverlay
). Every character is also given a form of Metal's jet fume that tracks your movement direction (P_DoFollowMobj
/P_DoMetalJetFume
). The Lua also prints whenever an objects touches a sky line (P_CheckSkyHit
). If the object is a player or a local player, the print message will change and you will be given a blue sphere (P_IsLocalPlayer
/P_GivePlayerSpheres
).
Merge request reports
Activity
Why expose
P_TouchSpecialThing
though? It doesn't seem much more useful on its own than the TouchSpecial hook if not under heavy modifications.Additionally,
P_IsLocalPlayer
is just a comparison wrapper forconsoleplayer
andsecondarydisplayplayer
, which are already set to return player userdata to Lua for scripting convenience. Seems like redundant exposure.@Tatsuru exposing
P_TouchSpecialThing
allows you to remotely "touch" a special object without needing to have the player come in direct contact with the object. So with Tangle, for example, I can allow her to pick up rings/spheres/tokens with her tail without needing to recode all the interactions in Lua.P_IsLocalPlayer
, yes, is just a wrapper, but it's a useful one so you don't have to write out the entire check yourself manually each and every time. Basically the exact same reason the function even exists in source in the first place.Edited by SMS Alfredoadded Lua label
added 1 commit
- 75e6e323 - Make horizon lines also count for P_CheckSkyHit, not just thok barriers
mentioned in merge request !1491 (merged)
added 312 commits
-
75e6e323...e24fe291 - 311 commits from branch
STJr:next
- 9ec51a78 - Merge branch 'next' into exposition
-
75e6e323...e24fe291 - 311 commits from branch
Same deal as !1491 (merged). Solved merge conflicts and updated attached exe.
added Feature label
mentioned in merge request !1993 (merged)
mentioned in merge request !1994 (merged)
mentioned in merge request !1994 (merged)
mentioned in merge request !1995 (merged)
mentioned in merge request !1996 (merged)
mentioned in merge request !1997 (merged)
mentioned in merge request !1998 (merged)
mentioned in merge request !1999
mentioned in merge request !2000 (merged)