Commit graph

143 commits

Author SHA1 Message Date
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
Louis-Antoine
01124f2076 Fix Lua stacktrace not showing in various situations 2020-11-13 19:12:25 +01:00
Louis-Antoine
04826d2615 Replace lua_pop(-1) with lua_settop(0) 2020-11-13 15:31:11 +01:00
James R
097f204ceb Merge branch 'register-metatables' into 'next'
Improve support for metatables in netgames

See merge request STJr/SRB2!1224
2020-11-08 19:30:51 -05:00
Louis-Antoine
87206a8c21 Show a console error if the gamestate contains too many tables 2020-11-08 17:33:49 +01:00
GoldenTails
c70d5a9773 Make mapmusflags and mapmusname writable. 2020-11-05 18:12:35 -06:00
GoldenTails
365e02bb32 Make skincolor_* CTF color variables writable. 2020-11-05 17:38:32 -06:00
GoldenTails
2b39a971ac Make stoppedclock writable. 2020-11-05 15:22:45 -06:00
GoldenTails
f42dee1871 Make displayplayer writable. 2020-11-05 13:43:33 -06:00
GoldenTails
8a0f55e4ad Make gravity writable. 2020-11-05 12:39:03 -06:00
GoldenTails
113e6b6585 Make token writable. 2020-11-05 12:38:47 -06:00
GoldenTails
a502b09929 Make emeralds writable. 2020-11-05 12:37:49 -06:00
Steel Titanium
41d8210fd5 Expose gamestate to Lua 2020-10-31 16:36:15 -04: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
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
Monster Iestyn
78f7998618 Added polyobj.vertices and polyobj.lines to Lua 2020-09-09 21:15:02 +01:00
Monster Iestyn
625aeb1560 lua_script.c fixes:
* make sure polyobj_t userdata is invalidated at level load
* add support for syncing polyobj_t Lua variables in netgames
2020-09-09 16:09:08 +01:00
Monster Iestyn
d5beae9738 Begin work on adding access to polyobjects in Lua:
* create new file lua_polyobjlib.c
* made a stub LUA_PolyObjLib function
* added META_POLYOBJ to lua_libs.h
* updated makefile, CMake and MSVC project files for lua_polyobjlib.c
2020-09-08 18:08:08 +01:00
Nev3r
6dfe236602 Merge branch 'udmf-next' into 'next'
Merge udmf-next into next

See merge request STJr/SRB2!1075
2020-07-28 14:03:59 -04:00
James R
99e0c48f7b Fix a lot of stuff related to the version automation 2020-07-10 22:39:46 -07:00
Nev3r
ff8759e507 Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2/ into udmf-next
# Conflicts:
#	src/hardware/hw_main.c
2020-06-30 20:29:48 +02:00
Louis-Antoine
93cc48054a Expose "server" and "dedicated" to Lua scripts
Careful! Both are local variables and are always false for clients,
and therefore should obviously not be used in anything gamelogic-related.
2020-06-27 15:30:23 +02:00
SteelT
bff6b19056 Merge branch 'marathonmode' into 'next'
MARATHON RUN

See merge request STJr/SRB2!941
2020-06-17 19:36:10 -04:00