User:Monster Iestyn/2.1.9 Summary
New functions for Lua:
- P_SpawnShieldOrb(player) - spawns the right shield depending on what shield powers you're meant to have currently (other shields are removed)
- R_SetPlayerSkin(player, skin number/name) - I'm aware changing player.mo.skin and skin stats manually does almost the same thing, but this fixes the life icon staying the same afterwards
- P_SpawnSpinMobj(player, type)
- P_DoSpring(spring, object) - spring sends object into the air ...in a spring fashion
- P_Telekinesis(player, thrust, range) - function used for Telekinesis character ability; pushes away all enemies and players within the range set
- (boolean) P_IsFlagAtBase(type) - type is expected to be either MT_BLUEFLAG or MT_REDFLAG
- (boolean) P_InQuicksand(mo) - returns true if player is in quicksand
- (boolean) P_InSpaceSector(mo) - returns true if player is in a space sector/FOF
- P_DoJumpShield(player) - player performs a whirlwind shield-style jump
- (boolean) P_IsObjectInGoop(mo) - is object in goop? returns true if in goop, returns false if not or the object has MF_NOGRAVITY or is a spectator player
- (int) EvalMath(word) - converts a string to a number by checking it against the existing lists of constants available for Lua, as well as performing any operations written inside the string; e.g. EvalMath("MF_NOGRAVITY|MF_SOLID") -> MF_NOGRAVITY|MF_SOLID -> 514
- (boolean) P_InsideANonSolidFFloor(mobj, rover) - is object inside a non-solid FOF?
- (boolean) P_CheckSolidLava(mo, rover) - is the FOF solid lava to the object?
- (boolean) P_CanRunOnWater(player, rover) - can the player run on top of the water FOF?
- EV_CrumbleChain(sec, rover) - the FOF specified is destroyed like a bustable block
Modified existing functions for Lua:
- P_SwitchWeather(weathernum, player) - if player is nil, weather is set globally
- P_SetupLevelSky(skynum, player) - if player is nil, sky is set globally
- v.drawString now has new alignment options: "small", "small-right", "thin" and "thin-right"
- v.stringWidth(string, flags, widthtype) - widthtype options are: "normal", "small" and "thin"
- The following functions now have an optional player argument for the player for it to be done for: P_PlayRinglossSound, P_PlayDeathSound, P_PlayVictorySound, S_StartSound, S_StartSoundAtVolume, S_ChangeMusic, S_SpeedMusic, S_StopMusic
- hud.add's function for the "game" hook now has a third parameter for the player's camera information (retrieve-only) - function(v, stplyr, camera)
New hooks for Lua:
- "JumpSpecial" (function(player)) - replaces/adds to normal effects triggered by the jump button
- "AbilitySpecial" (function(player)) - replaces/adds to double-jump effects (i.e when an ability such as thok would normally be triggered)
- "SpinSpecial" (function(player)) - replaces/adds to normal spin button effects related to spindashing
- "JumpSpinSpecial" (function(player)) - replaces/adds to normal mid-air spin button effects (i.e when spin button effects for abilities such as Telekinesis and Air Drill would normally be triggered)
- "PlayerMsg" (function(sourceplayer, type, targetplayer, message)) - replaces/adds to output for chat messages
- "HurtMsg" (function(player, inflictor, source)) - replaces/adds to messages printed on player damage/death
Other new Lua features:
- newly added dynamic variables: "levelskynum", "globallevelskynum", "mapmusic", "dedicatedserver"
- mapheader_t and mapheaderinfo[i] support (retrieve-only) now included - custom parameters can also be added to particular maps via the MAINCFG; these require a "LUA." prefix to be recognised as such, and should be referred to in all-lowercase in Lua scripts
- LF_ (level) and LF2_ (menu) map header flag constants are available for use in Lua
- player flag PF_FORCESTRAFE now exists for forcing left/right turn to act as strafe controls
- skin.soundsid[i] is now implemented for retrieval in Lua; this is a table that contains the sound numbers for each of the skin-specific sounds for a skin, e.g skin.soundsid[SKSSPIN] -> sfx_spin (if the sound has not been replaced with a custom skin sound). The "SKS" prefixed constants listed in sounds.h are also available for usage in Lua
- ffloor_t (FOFs) support now included; sector.ffloors() can be used to iterate through all the FOFs in a sector, as in "for rover in sector.ffloors() do <block> end"
- sector.thinglist() can be used to iterate through all the Objects in a sector, as in "for thing in sector.thinglist() do <block> end"
- sector.heightsec and sector.camsec are also available for Lua; these are the sectors for fake floors and the new camera clipping specials
Misc. notable fixes and changes:
- Fixed various cases of characters ending up in the wrong animation at the wrong time (such as spinning on ground if an ability was stopped at the same time as landing)
- Fixed Knuckles not being able to climb walls above solid/pushable objects
- NiGHTS Super Sonic can now use flipped gravity properly, go nuts NiGHTS mode fans
- MF_NOCLIPHEIGHT no longer allows friction to be applied to objects.
- New console command "weather" - works just like "skynum" except with weather instead!
- Late-comers to special stages are now forced into spectator mode, where they remain for the rest of the special stage's duration. They automatically revert back to normal in the next stage.
- The character ability CA_JUMPTHOK has been added, as well as the skin flag SF_RUNONWATER
- ERZ3 now supports race/competition modes - space countdown is removed in these modes, and the end of the race is at the pre-boss starpost
- gr_md2's value is now saved in config.cfg
- "Sector Special Parameters" linedef-containing control sectors can be used to adjust camera clipping heights for tagged sectors, by applying the "Intangible to the Camera" sector special to the sector itself - the ceiling and floor heights become the "ceiling" and "floor" to the camera instead