Commit graph

40 commits

Author SHA1 Message Date
Sally Coolatta
9d7ec0ab8f Merge SRB2 next
Probably doesn't compile yet, but I got rid of all of the conflicts for anyone who wants to take a stab at it.
2021-02-27 05:18:36 -05:00
James R
01e7c48630 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
James R
775cb46f75 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
Louis-Antoine
05ae84bd09 Fix Lua stacktrace not showing in various situations 2020-11-13 19:12:25 +01:00
Sally Coolatta
fc934b38e1 Merge public next 2020-11-10 15:32:48 -05:00
James R
745b293c47 Always allow access to the serverplayer 2020-11-05 20:00:21 -08:00
James R
cedb09bd92 Fix pointers on LUA_Archive and LUA_UnArchive
(servers joinable again)
2020-08-21 19:47:53 -07:00
Sally Coolatta
0dc21106e5 Lua stuff is done 2020-08-15 07:47:18 -04:00
SteelT
2b2596b4b3 Merge lua_script.h 2020-08-10 12:34:38 -04:00
Sally Coolatta
e296e1309a YAY, round 2 2020-08-09 21:02:56 -04:00
Sally Coolatta
cc1afaa838 Merge lua_script.h 2020-08-05 14:03:53 -04:00
LJ Sonic
ba9df9b574 Merge branch 'next' into 'dofile'
# Conflicts:
#   src/lua_script.c
#   src/lua_script.h
2020-06-01 09:28:56 -04:00
Louis-Antoine
a71f690241 Show the traceback when a Lua script error happens 2020-05-30 20:24:33 +02:00
Sally Coolatta
63917ffccc The start of the scary 2.2 merge
All conflicts are left in-tact. We should be collaborating on solving these files one at a time.
2020-05-29 13:43:38 -04:00
Louis-Antoine
808b7b17cc Add dofile() to Lua 2020-05-29 17:35:07 +02:00
James R
0e25e9a074 Merge branch 'more-lua-map-names' into 'next'
G_BuildMapTitle for Lua, G_BuildMapName outside of levels

See merge request STJr/SRB2!694
2020-05-19 23:13:35 -04:00
James R
7ff3e7f18b Merge branch 'lightmemedata' into 'next'
Cvars returned by CV_FindVar did not work with userdataType

See merge request STJr/SRB2!754
2020-04-09 19:48:39 -04:00
Louis-Antoine
46df2b9551 Use HAVE_BLUA as fuel for my fireplace 2020-03-19 18:36:14 +01:00
Latapostrophe
6fe54eafba Fix Lua crashes when loading without addons 2020-03-12 16:03:12 +01:00
James R
2274129f57 Update copyright year to 2020 2020-02-19 14:08:45 -08:00
James R
0f3a44887c LUA_PushLightUserdata takes the fun out of lib_cvFindVar 2020-02-02 15:19:19 -08:00
James R
77433dd500 Allow G_BuildMapName outside of levels 2020-01-15 19:25:48 -08:00
Jaime Passos
4ebbe4e518 Move ALL the Lua global variable stuff into lua_script.c. 2019-12-23 18:49:23 -03:00
Steel Titanium
a5cdb0a4b3 Update copyright date on source files 2019-12-06 13:49:42 -05:00
Latapostrophe
0599d23254 get replays to save player lua vars 2019-09-10 11:59:17 +02:00
toaster
3b99335605 * Strip the word "function" from INLEVEL error messages, since they're now shared between access and function cases.
* Move it into lua_script.h, so it's available to everything that needs it.
2019-07-30 17:57:57 +01:00
mazmazz
81352aece1 WIP 20190101 merge
d_netcmd.c
filesrch.c
m_menu.c
p_setup.c
p_spec.c
r_data.c
r_main.c
r_things.c
w_wad.c
w_wad.h
2019-01-02 01:09:15 -05:00
mazmazz
c91b2b4456 Update source copyrights to 2018 2018-11-25 07:35:38 -05:00
Monster Iestyn
1462c638cb Added the "lua_lumploading" variable for restricting certain Lua functions to lump load time only 2017-04-25 21:45:53 +01:00
Monster Iestyn
aa146dee41 Disabled all seg_t/node_t-related Lua code for now
To re-enable support for the above, uncomment the define HAVE_LUA_SEGS line in lua_script.h. Plain bbox userdata stuff is not disabled (though currently it's not used anyway)
2016-11-24 21:11:44 +00:00
Inuyasha
f07585191b copyright dates/statements updated and such
(no actual SLOC changes)
2016-05-17 17:42:11 -07:00
Inuyasha
3235351b99 And now Lua yells at you for doing what I just fixed 2016-05-11 14:33:50 -07:00
Alam Arias
771c1ecb8a Merge pull request #68 from Yukitty/revert-Lua-angles
Revert "Change angle_t handling in Lua."
2016-03-09 11:58:51 -05:00
JTE
54f95eb387 Revert "Change angle_t handling in Lua."
This partially reverts commit ef0e61fc33.
2016-03-09 08:38:10 -05:00
Inuyasha
cfcd7ce0d3 Readded EvalMath to Lua.
There is a caveat to this: The first time EvalMath is used, a
deprecated function warning will be shown to the user that tells
them to use _G[] instead.

This reverts commit 9d36cf37bd.
2016-03-08 22:15:26 -08:00
Yukita Mayako
9d6e75ae4f Cleanup LUAh_NetArchiveHook prototype mess. 2016-03-03 17:30:10 -05:00
Yukita Mayako
0af32ee2fa Move garbage collection out of Lua hooks.
That's supposed to be run once a frame, not once per hook
per mobj per frame you moron. If you just run it seven
thousand times a frame, of course your framerate will drop.
2015-06-10 13:42:45 -04:00
JTE
ef0e61fc33 Change LUA_NUMBER to fixed_t, change angle_t handling in Lua.
Angles now go from 0 to 0xFFFF (360 degrees == FRACUNIT) instead
of using a full UINT32. Lua only has one number type, so signedness
gets in the way of using angle_t directly. This handling of angles
matches up with how ZDoom ACS scripting and the like does it.

I also changed all the integer casts and pushes of fixed_t to
their own macro in preperation for possible future seperation.
2015-05-20 23:54:04 -04:00
Alam Ed Arias
02a3b0776c SRB2 2.1.7 release 2014-04-14 01:14:58 -04:00
Alam Ed Arias
b93cb1b65a SRB2 2.1 release 2014-03-15 13:11:35 -04:00