Commit graph

42 commits

Author SHA1 Message Date
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
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
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
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
MascaraSnake
4a0206b38d Merge branch 'next' into udmf-next
# Conflicts:
#	src/p_mobj.c
#	src/p_polyobj.c
2020-06-09 09:38:01 +02:00
SwitchKaze
f508f5b881 Fix typo SKINCOLOT 2020-05-24 12:36:20 -05:00
SwitchKaze
46191cade7 Update to 2.2.4 2020-05-22 16:47:51 -05:00
Nev3r
21de33bd08 Add mapthing arg support. 2020-04-11 12:54:34 +02:00
MascaraSnake
1580e14cbc Merge branch 'next' into udmf-next
# Conflicts:
#	extras/conf/Includes/SRB222_linedefs.cfg
#	extras/conf/Includes/SRB222_misc.cfg
#	src/p_spec.c
2020-03-21 20:04:31 +01:00
Louis-Antoine
892a8dd6e7 Make SRB2 flat like Earth 2020-03-20 18:55:29 +01:00
Louis-Antoine
e3cbdf8fab Use HAVE_BLUA as fuel for my fireplace 2020-03-19 18:36:14 +01:00
Nev3r
68f60f3c29 Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2/ into udmf-next 2020-03-11 09:31:31 +01:00
SwitchKaze
6415e10216 Merge branch 'next' of https://github.com/STJr/SRB2 into next-luacolors 2020-02-23 11:50:13 -05:00
James Hale
56b67a3b4f Custom skincolors 2020-02-21 21:56:39 -05:00
James R
7060083db5 Update copyright year to 2020 2020-02-19 14:08:45 -08:00
MascaraSnake
2d7b43c244 Implement linedef string arguments 2020-01-08 08:42:35 +01:00
MascaraSnake
68da1856da Implement linedef args (unused and untested so far) 2020-01-02 12:23:14 +01:00
Jaime Passos
c6f36fc470 un-ROTSPRITE rollangle and spriteinfo 2019-12-17 13:09:25 -03:00
Steel Titanium
d415cd5c6d
Update copyright date on source files 2019-12-06 13:49:42 -05:00
Jaime Passos
c4d7fe7c5a finish lua spriteinfo :] 2019-11-07 23:42:14 -03:00
Jaime Passos
f739956e89 spriteinfo lua support 2019-11-07 03:11:16 -03:00
toaster
4e256b73b2 Lua save-banks!
* Array of 8 INT32's natively embedded into savedata (net and SP)!
* Initialised to zero whenever a new save (or equivalent) is started, otherwise untouched by the base game.
* Requires reservation to avoid clobber-conflicts.
    * Access via `reserveLuabanks()` - returns a read-write userdata.
    * Assign userdata to local variable or global rawset to use later.

Mostly for future SUGOIlikes, but I'm sure someone could figure out an unrelated usage eventually.
2019-08-24 18:25:27 +01:00
mazmazz
075f28b7c8 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
Monster Iestyn
11cb163435 Backport the Blockmap library I made two years ago 2018-11-30 17:11:11 +00:00
Monster Iestyn
1b2aea81dc Merge branch 'master' into next 2018-11-25 20:39:17 +00:00
mazmazz
ea7162a76a Update source copyrights to 2018 2018-11-25 07:35:38 -05:00
Monster Iestyn
268bde3fdf Merge branch 'public_next'
# Conflicts:
#	src/d_netcmd.c
#	src/d_netcmd.h
#	src/dehacked.c
#	src/g_game.h
#	src/hardware/hw_draw.c
#	src/hardware/hw_main.c
#	src/lua_baselib.c
#	src/lua_hook.h
#	src/lua_hooklib.c
#	src/lua_hudlib.c
#	src/lua_libs.h
#	src/lua_maplib.c
#	src/lua_script.c
#	src/m_misc.h
#	src/p_mobj.c
#	src/s_sound.c
#	src/sdl12/mixer_sound.c
#	src/w_wad.c
2018-11-10 15:41:57 +00:00
Monster Iestyn
e15ed742c1 add ESLOPE ifdef checks around all the Lua slope support code that was there before I was involved 2018-10-21 16:27:54 +01:00
Monster Iestyn
61fa7026a1 add vector2 and vector3 userdata types to simplify getting a slope's o/d/normal 2018-10-20 19:00:37 +01:00
Monster Iestyn
7d4e27937d Merge branch 'next' into lua-slopes
# Conflicts:
#	src/lua_maplib.c
2018-10-20 18:31:06 +01:00
Monster Iestyn
fd1efff338 Added the META_ACTION userdata type to Lua, created getActionName() to return string name
SRB2's built-in action types will now all be pushed as META_ACTION, state_t.action can be assigned META_ACTION and return it

getUserdataType returns "action" for META_ACTION variables
2017-05-17 20:36:40 +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
Monster Iestyn
dc1e7165f7 Created lua_blockmaplib.c, for Lua's blockmap library
my P_SearchBlockmap_* functions are now a single searchBlockmap function, you can choose between "objects" and "lines" with the first arg to decide what to iterate through. I also rearranged the argument order a bit for easy stack cleanup etc

I'll remove the old stuff later, don't worry, it's disabled for now
2016-10-27 18:10:30 +01:00
Monster Iestyn
4c723d05ac Added node_t and nodes[] to Lua
Still some issues with node.bbox, but the rest seems to work
2016-07-08 20:05:54 +01:00
Monster Iestyn
8211e89aec Add seg_t to Lua, may be of use to Nev3r (and possibly others, I guess)
segs[i] is the segs table, "for seg in segs.iterate" iterates through segs, you know the drill by now I hope
2016-05-25 17:15:44 +01:00
Inuyasha
f07585191b copyright dates/statements updated and such
(no actual SLOC changes)
2016-05-17 17:42:11 -07:00
wolfy852
b0cbc8ab2a Lua slope manipulation stuff!
Warning: Incomplete. Very prone to crashing and I might not have handled some things properly. Use with caution.
2016-03-02 23:47:06 -06:00
Monster Iestyn
b564a169d8 Starting work for getting sector.lines in Lua: it WORKS at the least, but I have no way to determine the size of the array itself as of yet 2015-06-17 21:00:10 +01:00
Alam Ed Arias
c028c83235 SRB2 2.1.9 release 2014-08-03 23:49:33 -04:00
Alam Ed Arias
b93cb1b65a SRB2 2.1 release 2014-03-15 13:11:35 -04:00