Commit graph

165 commits

Author SHA1 Message Date
Monster Iestyn
d91d9bf7fc add redflag, blueflag, rflagpoint and bflagpoint to Lua 2023-08-01 12:57:03 +01:00
sphere
5c87dd52ec Merge branch 'action-super-fix' into 'next'
Make A_Action super act as expected

Closes #718

See merge request STJr/SRB2!1737
2023-07-19 19:40:42 +00:00
Gustaf Alhäll
2f2de7d3d3
Optimize field lookups in Lua metatables 2023-06-18 18:05:16 +02:00
sphere
62bdb7174b Merge branch 'lua-optimized-constants' into 'next'
Hannu's "LUA_EnumLib optimizations for constant value access" with fixed merge conflict

See merge request STJr/SRB2!2017
2023-06-12 23:03:51 +00:00
katsy
ca11180976 Merge remote-tracking branch 'stjr/next' into lua-optimized-constants 2023-06-11 12:36:08 -05:00
Sally Coolatta
30f6ae6e56 Add read access to shareEmblems (as well as a few other MAINCFG variables that weren't) 2023-06-02 16:06:44 -04:00
MascaraSnake
e4933b3e94 Merge branch 'allow-modified-saving' into 'next'
[SUGOI] Allow saving in modified games.

See merge request STJr/SRB2!1749
2023-05-24 05:04:26 +00:00
spherallic
1470d099e3 Update copyright year & credits 2023-03-31 14:53:31 +02: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
LJ Sonic
379cc4207a Revert "Merge branch 'netcode-refactor' into merging"
This reverts merge request !1920
2023-01-15 17:57:23 +00:00
LJ Sonic
717e0d5a17 Move netcode files to a new folder 2022-12-31 14:10:19 +01:00
Eidolon
7f1cafcd3d Merge branch 'gamepad-refactor-lua-features' into 'next'
Add gamepad library and hooks for Lua scripting

See merge request STJr/SRB2!1871
2022-12-09 02:17:03 +00:00
LJ Sonic
7454235882 Merge branch 'mapmusname-fix' into 'next'
Fix mapmusname not overwriting Lua-provided strings (resolves #880)

Closes #880

See merge request STJr/SRB2!1803
2022-11-23 09:40:43 +00:00
Radicalicious
31520a1a5d Revert usage warning to an error 2022-11-22 16:21:13 +00: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
SteelT
325675e277 Fix reading the value of stagefailed 2022-09-30 20:27:54 -04:00
Radicalicious
1edbbad2df Remove extra whitespace 2022-08-03 23:08:42 +00:00
Radicalicious
71caaf180c Fix mapmusname not overwriting Lua-provided strings 2022-08-02 20:59:13 -05:00
spherallic
14295ac7de 2022 2022-03-03 20:24:46 +01:00
Sally Coolatta
dcdbdec2bf Make super for A_Actions act as described 2022-02-06 15:16:30 -05:00
Hannu Hanhi
3bff9011d8 LUA_EnumLib optimizations for constant value access
- constants are stored into _G after first use

- made LUA_EvalMath's dedicated Lua state permanent so it can also benefit from these optimizations
2022-01-23 20:11:10 +02:00
Tatsuru
0781b91de5 Merge branch 'fix-archiving-error-msg' into 'next'
Fix incorrect error message during Lua archiving

See merge request STJr/SRB2!1593
2021-09-12 20:27:17 +00: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
LJ Sonic
6403a38c72 Fix again 2021-08-10 01:48:26 +02:00
LJ Sonic
a9b35a6f7a Fix incorrect error message during Lua archiving 2021-08-10 00:15:44 +02:00
Nev3r
3a49b9519d Remove &, since args and stringargs are arrays 2021-07-13 17:55:06 +02:00
Nev3r
22dfa05c31 Forgot the stringargs. 2021-07-13 17:44:28 +02:00
Nev3r
aed86781fc Bugfix - Fix sporadically occurring incorrect userdata types in Lua, caused by previously loaded userdata which didn't get invalidated in previous sessions.
Invalidate userdata for line and mapthing args.
Invalidate userdata for slopes and their normal, origin and direction vectors.
2021-07-13 17:41:38 +02:00
lachablock
366b1f65a1 Allow Lua write access to camera_t variables & expose the cameras globally 2021-07-10 18:22:07 +10:00
LJ Sonic
e3a5da3f6f Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2.git into HEAD
# Conflicts:
#	src/lua_hook.h
#	src/lua_hooklib.c
2021-06-19 20:49:12 +02:00
LJ Sonic
cfa48574be Merge branch 'next' into 'lua-inputs'
# Conflicts:
#   src/lua_script.c
2021-06-19 10:34:48 -04:00
James R
4d22b9f17f Merge remote-tracking branch 'origin/next' into hooklib-refactor 2021-06-07 18:12:52 -07:00
GoldenTails
409cba678d metalrecording 2021-06-05 18:35:44 -05:00
SteelT
2cb920a5a6 Merge branch 'failed-level-lua' into 'next'
[SUGOI] Make stagefailed more useful, add linedef executor to toggle, and expose to Lua

Closes #361

See merge request STJr/SRB2!1463
2021-05-28 21:51:00 -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
Sally Coolatta
d59f25a6cd stagefailed is more useful
- Can now apply to normal stages, simply defaults to "false" in normal stages.
- Post-level cutscenes are now always skipped when the stage was failed.
- Exposed the boolean as a Lua read+write global.

Desired for SUGOI, as it allows for visited flags not be updated, and level completion emblems to not be awarded. Which means a lot less crappy non-ideal workarounds.

Normal stage intermission currently does not reflect failure state at all. Maybe it could always skip, never award score bonuses, have different text... etc. Probably would leave that up to vanilla dev opinion.
2021-04-18 12:59:49 -04:00
SwitchKaze
3faa98cf4a Expose inputs to Lua 2021-04-02 15:45:59 -05:00
LJ Sonic
3dff1eb1b7 Fix consoleplayer returning the server player during joining phase 2021-02-11 00:10:15 +01:00
James R
353692fa79 Merge remote-tracking branch 'origin/next' into hooklib-refactor 2020-12-16 08:43:49 -08:00
James R
8d382e49fb Big Large Lua Hooklib Refactor
* Hooks are no longer a mess of lua boiler plate. Helper functions reduce hooks
  to, at the most basic level, only two calls.
* Lua tables (the array part) are used to index hooks. Such tables contain only
  hooks of the same type.
* Hook types are defined in one place so you no longer need to sync up the enum
  and name array.
2020-12-10 00:36:41 -08:00
James R
0b0f2e1e35 Invalidate taglist userdata 2020-12-05 02:26:00 -08:00
James R
621efbfa15 Lua taglib for accessing taggroups
The global "tags" can be iterated upon for every unique tag which is set in the
level. If a tag is set on a sector/line/thing, it will be included. Taking the
length of "tags" will give you the number of these unique tags. (If a tag is
set on multiple sectors/lines/things, it will only be counted once though.)

For sectors, lines and mapthings, call the field "tagged". This function takes
one argument, which is the tag. The return value can be iterated over for all
the sectors/lines/things with that tag. The length can also be taken for the
number of such objects. If no argument is given, the global tag is default.
2020-12-04 00:30:08 -08:00
LJ Sonic
eef3028110 Merge branch 'fix-stacktrace' of https://git.do.srb2.org/STJr/SRB2.git into next
# Conflicts:
#	src/dehacked.c
#	src/dehacked.h
2020-11-29 21:54:15 +01:00
Nev3r
bcf6823cbf Merge branch 'dehacked-hell' into 'next'
Split dehacked.c into multiple files.

See merge request STJr/SRB2!1222
2020-11-29 05:18:45 -05:00
GoldenTails
8fef61aa29 Split dehacked.c into multiple files. 2020-11-23 21:42:26 -06:00
GoldenTails
d806655769 Fix a dumb typo of luaL_checklstring i made whoops 2020-11-23 21:20:17 -06:00
James R
8d71559afe Merge branch 'make-some-lua-globals-rw' into 'next'
Make several Lua global variables writable.

See merge request STJr/SRB2!1233
2020-11-22 18:47:53 -05:00
Louis-Antoine
13ba25f4fe Only call the Lua API for overridden actions 2020-11-15 01:15:58 +01:00