Commit graph

395 commits

Author SHA1 Message Date
spherallic
1470d099e3 Update copyright year & credits 2023-03-31 14:53:31 +02:00
Tatsuru
2a50626b00 Initial commit 2023-03-15 17:50:13 -03:00
MascaraSnake
02fa860c46 Merge branch 'thingonspecial3dfloor' into 'next'
Re-add P_ThingOnSpecial3DFloor for Lua backwards compatibility

See merge request STJr/SRB2!1905
2023-01-28 06:32:42 +00:00
Eidolon
366ee4ad92 Revert "Merge branch 'gamepad-refactor-lua-features' into 'next'"
This reverts commit 7f1cafcd3d, reversing
changes made to 696e2ab909.
2023-01-26 19:26:24 -06:00
Eidolon
6cc48a6e89 Revert "Merge branch 'gamepad-refactor-lua-rumble' into 'next'"
This reverts commit 7d8e8e20b7, reversing
changes made to 7f1cafcd3d.
2023-01-26 19:26:21 -06:00
LJ Sonic
379cc4207a Revert "Merge branch 'netcode-refactor' into merging"
This reverts merge request !1920
2023-01-15 17:57:23 +00:00
MascaraSnake
e472c551e1 Re-add P_ThingOnSpecial3DFloor for Lua backwards compatibility 2023-01-01 11:31:44 +01:00
LJ Sonic
717e0d5a17 Move netcode files to a new folder 2022-12-31 14:10:19 +01:00
Eidolon
7d8e8e20b7 Merge branch 'gamepad-refactor-lua-rumble' into 'next'
Add haptic functions for Lua scripting

See merge request STJr/SRB2!1872
2022-12-09 02:17:17 +00:00
ashifolfi
47e981d2a8 actually check the right type in lua 2022-11-20 16:07:14 -05:00
ashifolfi
3a2834e781 add R_TextureNameForNum and expose to lua 2022-11-20 15:25:53 -05:00
Sally Coolatta
a22fa1c455 Compromise on cheats setting modified game
Instead of modifying the game, cheats now set a separate "cheats were used in this session" variable, which returns some of the old behavior.

HOWEVER, cheats will STILL allow spawning / collecting emblems & unlocking unlockables. Cheats will purely prevent saving progress. (It was always frustrating that devmode would make debugging unlockable features harder...)

Lastly, the function to set no-saving was exposed to Lua (`G_SetUsedCheats(silent)`). Just thought it'd be useful for large-scale gamedata-using mods that want to add their own cheat commands.
2022-11-16 11:14:31 -05:00
Jaime Ita Passos
f0c3de6976 Add gamepad library and hooks for Lua scripting 2022-11-14 02:18:24 -03:00
Jaime Ita Passos
0516350bb4 Add haptic functions for Lua scripting 2022-11-14 01:52:20 -03:00
Eidolon
9a88c9ea47 Merge branch 'gravityflipping' into 'next'
Gravity flip bugfixes & additions

Closes #378, #661, and #430

See merge request STJr/SRB2!1808
2022-11-12 23:33:07 +00:00
spherallic
8d06145377 Play gravity flip sound on jump in jumpflip sectors, reorganize code 2022-09-09 15:35:05 +02:00
spherallic
9fabddd4bb Add sector type that flips gravity upon jumping 2022-09-08 16:56:35 +02:00
Eidolon
805941a98f Merge public next into uncappedrevengeance
This is to capture the UDMF merges and make the later code review
easier.
2022-05-03 14:45:14 -05:00
Eidolon
f0d7d8467f Refactor timing code even more
System layer is greatly simplified and framecap
logic has been moved internally. I_Sleep now
takes a sleep duration and I_SleepDuration
generically implements a precise sleep with spin
loop.
2022-05-01 00:32:46 -05:00
Eidolon
c3923adc3f Make Lua TeleportMove call MoveOrigin 2022-04-27 17:08:40 -05:00
Sally Coolatta
d476b41dfa P_SetOrigin & P_MoveOrigin to replace P_TeleportMove 2022-04-26 20:56:33 -05:00
MascaraSnake
faa7d89e3e Merge branch 'udmf-more-linedef-types' into udmf-sector-fields 2022-04-20 21:01:16 +02:00
MascaraSnake
36bf8b1a77 Merge branch 'udmf-linedef-executors' into udmf-executor-triggers 2022-04-19 22:33:53 +02:00
MascaraSnake
2e56c3de35 Merge branch 'udmf-polyobjects' into udmf-lighting 2022-04-19 22:18:30 +02:00
spherallic
14295ac7de 2022 2022-03-03 20:24:46 +01:00
spherallic
9fee550fb0 Actually check bot names in lib_gAddPlayer. 2022-02-08 14:58:09 +01:00
MascaraSnake
feaa4f1273 Replace most sector specials with sector special flags 2021-12-31 00:03:24 +01:00
MascaraSnake
060bc5fde0 Replace P_ThingOnSpecial3DFloor with the more versatile P_MobjTouchingSectorSpecial 2021-12-08 21:07:26 +01:00
Radicalicious
ea03ab9db0 Merge remote-tracking branch 'stjr/next' into expose-thrust-funcs-to-lua 2021-12-03 21:58:28 -06:00
MascaraSnake
aee4996eba Merge branch 'udmf-polyobjects' into udmf-lighting 2021-12-03 19:22:37 +01:00
LJ Sonic
599abc2a78 Merge branch 'lua-timestamp' into 'next'
Timestamp function for Lua

See merge request STJr/SRB2!1647
2021-12-02 22:41:08 +00:00
Hannu Hanhi
56c5a887c8 Call the Lua timestamp function getTimeMicros 2021-11-08 20:28:35 +02:00
Hannu Hanhi
270c7701b4 Timestamp function for Lua 2021-11-08 01:17:30 +02:00
GoldenTails
8110473643 Give userdata that needed names some names. 2021-10-22 18:31:37 -05:00
MascaraSnake
6871262909 Allow "fade light level" linedef executor to fade relative to current value 2021-09-19 23:12:30 +02:00
Tatsuru
bcd7468d25 Merge branch 'lua-camera' into 'next'
Allow Lua write access to camera_t variables & expose the cameras globally

See merge request STJr/SRB2!1581
2021-09-12 20:20:49 +00:00
namishere
39bd9c6da8 Make next compile again 2021-08-30 23:18:25 -07:00
CobaltBW
95359fef51 Amendment to G_RemovePlayer to preserve lua error handlers 2021-07-15 15:19:47 -07:00
CobaltBW
48514ee88d Fixed G_RemovePlayer crash in players.iterate
This was done by storing flag-for-removal status as a boolean inside the player struct.
Bot players are instead removed at the start of G_Ticker, rather than being removed immediately by G_RemovePlayer.
2021-07-15 15:04:24 -07:00
lachablock
117e3e2670 Expose P_TryCameraMove and P_TeleportCameraMove, disallow write access to camera.x and camera.y, allow write access to camera.height and camera.radius 2021-07-11 16:23:50 +10:00
Shane Ellis
09f445f227 Merge branch 'next' into 'addplayer'
# Conflicts:
#   src/g_game.c
2021-06-19 20:20:45 -04:00
LJ Sonic
cfa48574be Merge branch 'next' into 'lua-inputs'
# Conflicts:
#   src/lua_script.c
2021-06-19 10:34:48 -04:00
lachablock
476dcc861b Restore P_AproxDistance Lua parity 2021-06-03 14:36:29 +10:00
Shane Ellis
18c47afc76 Merge branch 'next' into 'addplayer'
# Conflicts:
#   src/lua_baselib.c
#   src/r_skins.c
2021-06-02 11:47:11 -04:00
sphere
69b6c409b5 Merge branch 'flicky-mapload-crash-fix' into 'next'
Flicky mapload crash fix (and other tmthing-related fixes)

Closes #81

See merge request STJr/SRB2!1522
2021-06-01 14:58:01 -04:00
Nev3r
f7ee0dacf2 Merge branch 'lua_mapnumber' into 'next'
Expose M_MapNumber to Lua

See merge request STJr/SRB2!1521
2021-06-01 07:43:33 -04:00
Nev3r
de0a91729b Merge branch 'buttered-lua' into 'next'
Expose P_ButteredSlope to lua

See merge request STJr/SRB2!1397
2021-06-01 07:39:19 -04:00
Monster Iestyn
ada6ec07db Fix Lua versions of P_ZMovement and its clones as well as P_MovePlayer so tmthing changes don't linger afterwards 2021-05-28 18:47:09 +01:00
flarn2006
fd82357d4f Expose M_MapNumber to Lua 2021-05-27 18:35:15 -04:00
sphere
186ef0479d Merge branch 'death-of-musicslots2' into 'next'
Remove music slot compatibility

See merge request STJr/SRB2!1321
2021-05-19 05:27:31 -04:00
LJ Sonic
d325c7e6d3 The year is 2021 2021-05-07 17:45:56 +02:00
James R
ed5a7f51e8 Revert "Merge branch 'lightmemedata' into 'next'"
This reverts commit d4c08a8410, reversing
changes made to e100f21dda.
2021-05-02 21:32:07 -07:00
Radicalicious
47a2710ec2 Expose P_ThrustEvenIn2D, P_InstaThrustEvenIn2D, and P_VectorInstaThrust to Lua 2021-05-01 14:05:07 -04:00
SwitchKaze
cb3a8f7a58 Remove key stuff 2021-04-02 15:46:08 -05:00
SwitchKaze
3faa98cf4a Expose inputs to Lua 2021-04-02 15:45:59 -05:00
namishere
32a4b270df Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2 into buttered-lua 2021-03-29 16:15:50 -07:00
lachablock
0405b3922c Do not let nonspin characters enter sectors they could not enter if standing at full height 2021-03-23 15:09:04 +11:00
SMS Alfredo
4430835a71 This might be dumb, but whatever 2021-02-14 20:49:03 -06:00
LJ Sonic
70850b0836 Deprecate P_AproxDistance for Lua scripts 2021-02-13 18:04:27 +01:00
LJ Sonic
758de501da Use R_PointToDist2 for the Lua versions of P_AproxDistance and FixedHypot 2021-02-13 18:04:12 +01:00
LJ Sonic
a58df577fe Revert "Use FixedHypot over P_AproxDistance"
This reverts commit c5474436af.
2021-02-13 17:46:29 +01:00
namishere
326be01276 Expose P_ButteredSlope to lua 2021-02-11 04:06:40 -08:00
LJ Sonic
83947d4428 Merge branch 'redundant-hypot' into 'next'
Replace P_AproxDistance with FixedHypot, and replace FixedHypot's algorithm with R_PointToDist2's

See merge request STJr/SRB2!1320
2021-01-25 18:08:25 -05:00
CobaltBW
a2fce68f14 Specialized Lua function for bot removal 2021-01-23 17:01:48 -08:00
Shane Ellis
135032c293 Correction to implicit declaration of B_UpdateBotleader() 2021-01-23 10:58:34 -05:00
Shane Ellis
2abf89e800 Update G_AddPlayer() 2021-01-23 10:13:16 -05:00
Shane Ellis
b73a15a0bf fixed G_AddPlayer not sending return value 2021-01-15 22:50:15 -05:00
Shane Ellis
4e029dbc67 Update lua_baselib.c 2021-01-15 17:45:41 -05:00
Shane Ellis
00462323c3 Revert "Implementation of lua function P_AddPlayer()"
This reverts commit 5e8313e157
2021-01-15 22:42:35 +00:00
Shane Ellis
5e8313e157 Implementation of lua function P_AddPlayer() 2021-01-15 16:50:01 -05:00
Nev3r
b642682dde Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2 into lua-tag-iterator
# Conflicts:
#	src/doomtype.h
2020-12-16 17:27:44 +01:00
Sally Coolatta
c5474436af Use FixedHypot over P_AproxDistance
Not convinced that the small speed benefit from P_AproxDistance is worth the "aproximate"[sic] results it gives. Let's instead try a define to replace it with FixedHypot. In Lua, the function gives a deprecated warning.

Inspired by the hyperwall fix for vanilla, except for everything. From little testing, actively improves waypoint checks, bumping, speed checks, wall collisions, Jawz targetting, Lightning Shield attacks, so on.

The only way I see this as a potential downgrade is A_Look (and related functions) getting slower, which are barely used in Kart.
2020-12-12 14:49:25 -08:00
Steel Titanium
ab156e1709 Remove music slot compatibility 2020-12-11 23:11:15 -05:00
James R
8dd964e3a7 Lua: taglist.add and taglist.remove for sector tag lists 2020-12-05 02:02:06 -08:00
James R
314fd2783a Lua tag lists
Index and take length of tag lists like a table, 1-indexed. There are three
methods which may be used on tag lists:

list:iterate() - returns an iterator over the tags in the list
list:has(tag) - returns a boolean whether the tag is in the list
list.shares(list2) - returns whether two lists share a tag

"find" is also an alias to "has". Each method may be accessed from the global
taglist library too, e.g. taglist.iterate(list)

Tag lists may be compared with an equality operator too. This will tell you if
the two lists are composed of identical tags.

Accessible from sector.taglist, line.taglist and mapthing.taglist.
2020-12-04 13:53:27 -08:00
Steel Titanium
7d45a7c91a Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2 into lua-skinsprites 2020-12-03 17:29:08 -05:00
Jaime Ita Passos
5e890ee6f8 Merge branch 'next' into spritestuff2 2020-11-19 00:52:43 -03:00
James R
50e15840fb Merge branch 'udmf-multitag' into 'next'
UDMF: Multitag support

See merge request STJr/SRB2!1097
2020-11-14 19:18:14 -05:00
Nev3r
fb9432ae57 Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2 into udmf-multitag 2020-11-10 11:46:53 +01:00
Steel Titanium
050a22f1ce Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2 into lua-musicfuncs 2020-11-08 21:20:07 -05:00
Louis-Antoine
9f851dc285 Return explicitly when failing to register a metatable 2020-11-09 00:16:40 +01:00
Louis-Antoine
e52cb7f6fa Throw an error if too many metatables are registered 2020-11-08 17:20:25 +01:00
Steel Titanium
1320f10839 Allow access to skin.sprites[]
Only numframes so far though, as there's already a function for what spriteframe provides.
2020-11-07 23:55:37 -05:00
Jaime Passos
36550725f3 P_DeleteFloorSpriteSlope -> P_RemoveFloorSpriteSlope 2020-11-05 00:42:14 -03:00
Steel Titanium
ac7781a3b3 Expose more music functions to Lua 2020-10-31 21:15:41 -04:00
Louis-Antoine
1155d875d5 Use the same names as userdataType() for userdataMetatable() 2020-10-30 15:00:13 +01:00
Louis-Antoine
f943f247af Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2.git into register-metatables 2020-10-30 14:46:04 +01:00
Nev3r
c62ef355ef Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2 into udmf-multitag
# Conflicts:
#	src/lua_baselib.c
#	src/lua_maplib.c
2020-10-27 20:48:25 +01:00
James R
bd9fda8ceb Merge branch 'lua-polyobjects' into 'next'
Lua polyobjects

Closes #19

See merge request STJr/SRB2!1140
2020-10-15 19:08:54 -04:00
Jaime Passos
e63efdac13 Only create floor sprite slopes when needed, instead of always allocating them.
Has to be done manually in Lua. Use P_CreateFloorSpriteSlope, and P_DeleteFloorSpriteSlope when done with it.
2020-10-14 13:07:02 -03:00
James R
9538ca696a Merge branch 'ceilingz' into 'next'
Add P_CeilingzAtPos function

See merge request STJr/SRB2!1164
2020-10-12 17:44:51 -04:00
James R
ddb6823fe5 Merge branch 'fix-theoretical-lua-exposure-crashes' into 'next'
Fix some theoretical crashes when using the P_*XYMovement, P_*ZMovement, and P_RailThinker functions in Lua.

See merge request STJr/SRB2!1173
2020-10-08 22:01:02 -04:00
James R
c3c34c489b Merge branch 'lua-sectorsounds' into 'next'
Support sectors as sound origins in Lua

See merge request STJr/SRB2!1144
2020-10-08 21:05:01 -04:00
GoldenTails
2ae5c02050 Fix some theoretical crashes when using the P_*XYMovement, P_*ZMovement, and P_RailThinker functions. 2020-10-03 13:24:47 -05:00
Louis-Antoine
e49032eaf7 Let Lua scripts access userdata metatables 2020-10-03 18:40:37 +02:00
Louis-Antoine
121c7da809 Let Lua scripts relink tables to their metatables when unarchiving
This is done through the new "registermetatable" function,
in a somewhat similar fashion to "freeslot" but for metatables:
it must be called at script load to tell SRB2 your metatable
can be automatically relinked during the unarchiving process.
2020-10-03 16:31:04 +02:00
Snu
82ceddb2be god damnit 2020-09-30 08:10:28 +01:00
Snu
feb011ee52 Expose function to Lua 2020-09-30 07:58:41 +01:00
Tatsuru
013714a26f Encapsulate userdata checks 2020-09-14 17:33:26 -03:00
Tatsuru
454682df70 Use the sector's actual soundorg (how did it even work) 2020-09-13 13:54:43 -03:00