... | ... | @@ -90,7 +90,13 @@ Here is the full list of damage type constants currently in master branch (0 is |
|
|
# Blockmap searching
|
|
|
This is basically a new Lua library consisting of a single function called searchBlockmap, which kind of does what it says on the tin. By default it searches around an object of your choice, either looking for other objects or linedefs. You can customise it to search in a specific area of the blockmap, however. Nev3r has already found this to be useful.
|
|
|
|
|
|
Full details on how to use searchBlockmap can be found on my (old) GitLab merge request for my "Lua additions" branch: http://git.magicalgirl.moe/STJr/SRB2...ge_requests/54
|
|
|
* Format of iteration function: `searchBlockmap(searchtype, function, mobj, [x1, x2, y1, y2])`. Returns true if search was uninteruppted, false if the iteration function returned true at any point
|
|
|
* *searchtype* can be either "objects" or "lines", for looking for mobj_t and line_t stuff in the blockmap respectively
|
|
|
* *function* is a function of your choice to iterate with: (sorry I can't get the next two bullets to be one indent further to the side)
|
|
|
- format of function needed: `funcname(mobj, foundmobj)` or `funcname(mobj, foundline)` (for searching for objects and lines, respectively)
|
|
|
- return value of *function* affects searching somewhat: nil doesn't change searching, false ends searching in a block (but doesn't stop searching, it just moves onto the next), and true ends the full search. Both returning true or false ultimately makes `searchBlockmap` return false.
|
|
|
* *mobj* is the reference mobj that you're checking around (if you don't supply x/y ranges to search in, it defaults to checking within the mobj's radius in both axes). If *mobj* was removed mid-search the search stops and `searchBlockmap` returns false
|
|
|
* (optional) *x1, x2, y1, y2* are coordinates on the map to search the blockmap between, if given
|
|
|
|
|
|
# New Lua hooks
|
|
|
* "ShieldSpawn" - toaster made this, so ask her how it works
|
... | ... | |