Commit Graph

29 Commits

Author SHA1 Message Date
hendricks266 30f510d521 Add "rotatespritea" to CON and M32script.
I hope I didn't bruise Lunatic too much.

git-svn-id: https://svn.eduke32.com/eduke32@3610 1a8010ca-5511-0410-912e-c29ae57300e0
2013-03-25 04:33:03 +00:00
helixhorned 607774a982 New M32Script command "getspritelinktype" <spritenum> <<linktypevar>>.
This get into the writable variable the "linking type" of the sprite with index
<spritenum>.  The result is a bit field of ORed values:
 1: lotag has linking semantics
 2: hitag
 4: extra, 8: xvel, 16: yvel, 32: zvel, 64: owner  (custom only)

Custom setting about which sprites have what kind of linking can be programmed
via EVENT_LINKTAGS: it receives a sprite index as the 'current sprite' and is
supposed to return the bit field in RETURN.

An example which lists sprites and their linking hi- and lotags is provided in
the state 'listusedtags' in a.m32.

git-svn-id: https://svn.eduke32.com/eduke32@2590 1a8010ca-5511-0410-912e-c29ae57300e0
2012-04-05 19:49:12 +00:00
helixhorned 39314586ac Somewhat largish commit with various keyboard tinkering for Mapster.
The main change consist of adding a key press (and release) callback
whose only purpose is to be used from m32script as EVENT_KEYPRESS.
When entering that event, the RETURN variable will be set to the
keystatus code of the key, and whether it was pressed or released can
be checked by looking at keystatus[] at that code (ifholdkey and
ifhitkey do this). The purpose of this, then, is to be able to remap
keys in a more general (and complicated) fashion than is possible with
the mapster32.cfg 'remap' option. Various other additions build around
this central one:

- add an example EVENT_KEYPRESS to a.m32, among other things emulating
  the keypad arrows with Alt-<normal arrows> for notebook convenience;
  disabled initially
- a.m32: set 'owner' with Alt-KP2: now Alt-Shift-KP2, because of
  collision with the above
- new m32script command: setkey <keycode>, setting keystatus[<keycode>]
  to 1 (note: may be restricted to use in EVENT_KEYPRESS only in the
  future)
- fix indexing an m32script array with a defined label, there used to
  be a 'not a gamevar' error instead
- add the following constant labels for some key codes:
  KEY_SCROLL, KEY_F1 .. KEY_F12

git-svn-id: https://svn.eduke32.com/eduke32@2122 1a8010ca-5511-0410-912e-c29ae57300e0
2011-11-25 09:51:06 +00:00
helixhorned aa8b2e4e05 Lots of M32script tweaks:
* fix breaking out of 'switch' blocks and compilation of the 'default' case
* Have a way of assigning 'special function' menu [' F] entries to script states. Writing a string literal after the state name will register the state under that name. Menu names are limited to 24 characters and it's possible to have up to 16 of them.
* new branching command 'ifinteractive', true if a state runs from the menu mentioned above.
* new command: getnumberfromuser <<retvar>> "query_string" <maxnum> <flags>

See 'state collect_teleporting_sectors' in a.m32 for a combined usage of the new functionality.

git-svn-id: https://svn.eduke32.com/eduke32@1955 1a8010ca-5511-0410-912e-c29ae57300e0
2011-08-03 17:22:25 +00:00
helixhorned ee4d060b1f * New m32script commands:
- sethighlightsector <sectnum> <on?>
 - updatehighlightsector
 - collectsectors <<array_to_collect_sectnums>> <initial_sector> <<num_collected_sectors>> <sector_filtering_state>

The latter does a breadth-first search starting from an initial sector and collects nextsectors only when the filtering state, given a sectnum as RETURN input, writes a nonzero value into RETURN. As a usage example, a.m32 includes the state 'collect_teleporting_sectors', that collects all sectors containing an SE7 and highlights them afterwards. This way, it should be possible to retrofit old maps with TROR by distributing small scripts that do most of the work (right now, joining has to be done by hand, though).


* corruption checker: for the 'nextwall inconsistent with nextsector' corruption, suggest an alternative fix by searching fitting nextwalls and changing the nextwall of the corrupt wall (as opposed to the nextsector). It will display with a leading '?' in the listing, and can be demanded by suffixing 'corruptcheck tryfix' with it. For example,

corruptcheck tryfix 9-21 ?

would fix some corruptions in Billy Boy's cranium.map without introducing drawing errors.


* fix demo playback (tueidj figured this out)


git-svn-id: https://svn.eduke32.com/eduke32@1927 1a8010ca-5511-0410-912e-c29ae57300e0
2011-07-03 22:51:28 +00:00
helixhorned 203cf0b7b1 A crapload of random stuff.
* Polymer light access to m32script (light[<lightidx>].<field>). As an application, provide a state 'insertlights' that takes the currently active lights and puts them into the map as SEs (e.g. for maphack recovery).
* Prototype of a mechanism to gray out certain portion of a map, making them inactive to various, but not all, editing operations. Highlighting a set of sectors and pressing Ctrl-R will make the Z bounds be [(least ceiling z), (greatest floor z)] of all selected ones, pressing Ctrl-R when no sectors are highlighted will reset them. Not sure if it's for production use at this stage...
* The 'align walls' feature [.] now has three independently toggleable behaviours: recurse nextwalls (toggled when Ctrl is pressed), iterate point2s (disabled when Shift is pressed), and also copy pixel width (toggled when Alt is pressed).
* Make shades clamp instead of overflowing in the editor

Fixes:
* crash when carrying out certain operations on walls with xrepeat 0
* the Pause key on linux. Also make demo recording start on Shift-ScrollLock because ScrollLock alone is too easily pressed when pausing


git-svn-id: https://svn.eduke32.com/eduke32@1877 1a8010ca-5511-0410-912e-c29ae57300e0
2011-05-07 18:23:34 +00:00
helixhorned 148f3cadef mapster32: new command-line switch '-namesfile <filename>' for overriding NAMES.H; new 'drawlabel <quotenum> <x> <y> <z> <col> <backcol>' m32script command for drawing small labels, see end of a.m32 for an example; some special handling for sprites whose tile yoffset is greater or equal their pixel height.
git-svn-id: https://svn.eduke32.com/eduke32@1832 1a8010ca-5511-0410-912e-c29ae57300e0
2011-03-07 16:30:06 +00:00
helixhorned 71d5dc5e59 Selective auto-correction option for the corruption checker. 'corruptcheck now' will print numbered tags for each warning, which can then be used like this: 'corruptcheck tryfix 20 34-64'. General cleanup; make mapster32 not depend on enet objects.
git-svn-id: https://svn.eduke32.com/eduke32@1799 1a8010ca-5511-0410-912e-c29ae57300e0
2011-02-21 23:08:21 +00:00
helixhorned 639cabc0e6 A week worth of Mapster hacking: first, there is an experimental side view mode toggled with [F3]. Nav keys are {QWAZ}, MMB and RMB. Use with care because it is still in construction. The sector selection routines have been rewritten -- it is now possible to paste the selection into a room and a new inner loop will be added automatically (MickyC's idea). Adds m32script commands drawline16z and drawcircle16z.
git-svn-id: https://svn.eduke32.com/eduke32@1730 1a8010ca-5511-0410-912e-c29ae57300e0
2010-11-27 22:12:24 +00:00
helixhorned a38307a54f Fixes quite a few nasty bugs with the new clipping code, including the crash. Clip shapes are now loaded from _clipshape0.map through _clipshape9.map (no break like when loading tiles, just see if each is present). Mapster32: insert some safety code for sprites with sectnum<0. Because this is still a bad thing, have the m32script corruption checker catch this and run it periodically from EVENT_DRAW2DSCREEN. Also draw such sprites in 2D mode with a blood-red color, and make them draggable. Remove set[sector,wall,sprite] commands.
git-svn-id: https://svn.eduke32.com/eduke32@1722 1a8010ca-5511-0410-912e-c29ae57300e0
2010-10-31 19:54:03 +00:00
helixhorned 036a88736c Mapster32: make sector keep old firstwall when adding inner loop, rewrite setfirstwall to use malloc'ed memory for temp storage instead of end of sector[], reintroduce correct searchwall determination in Polymer mouse picker (intersection of xy projection of aiming ray with wall); added commands to m32script: shiftvarvar[lr], ifhighlighted, ifin3dmode, updatehighlight, sethighlight; coded prototype terrain helper based on isolines and triangle strips.
git-svn-id: https://svn.eduke32.com/eduke32@1710 1a8010ca-5511-0410-912e-c29ae57300e0
2010-09-30 23:05:40 +00:00
helixhorned 91250f081c New CON commands:
* sectsetinterpolation <sector>
 * sectclearinterpolation <sector>
 * clipmove <<ret>> <<x>> <<y>> <z> <<sectnum>> <xvect> <yvect> <walldist> <floordist> <ceildist> <clipmask>
 * lineintersect  <x1> <y1> <z1>  <x2> <y2> <z2>  <x3> <y3>  <x4> <y4>  <<intx>> <<inty>> <<intz>> <<ret>>
 * rayintersect <x1> <y1> <z1>  <xv> <yv> <zv>  <x3> <y3>  <x4> <y4>  <<intx>> <<inty>> <<intz>> <<ret>>
 * calchypotenuse <<ret>> <x> <y>
(all except *interpolation also in m32script). Also fixes Sect_ClearInterpolation to be symmetrical to its Set counterpart (shouldnt change anything since it was unused). Added "-conversion YYYYMMDD" switch for keyword-compatibility with old mods.
Mapster32: invisible sprite preview with Quote-i.

git-svn-id: https://svn.eduke32.com/eduke32@1708 1a8010ca-5511-0410-912e-c29ae57300e0
2010-09-27 21:52:04 +00:00
helixhorned 917b924a0d Fixes crash in 2d map drawing where sector[-1] was accessed; added commands a2xy and ah2xyz to m32script, coded 2d preview of swinging and sliding doors; added "samprate" setting to configuration, useful if the default one gives jittering/echoey audio
git-svn-id: https://svn.eduke32.com/eduke32@1697 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-17 20:00:44 +00:00
helixhorned b2988abb54 Search for named tile in tile selector ('S'); various bugfixes (among other things with PR-override vars)
git-svn-id: https://svn.eduke32.com/eduke32@1696 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-16 13:56:49 +00:00
helixhorned 6185aedded Fixes compilation for now. Now if my executable would start...
git-svn-id: https://svn.eduke32.com/eduke32@1692 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-12 13:38:37 +00:00
helixhorned 71e59a5502 A bunch of m32script additions, fixes and general stuff, among them: local vars/arrays, inline quotes and prettier error messages.
git-svn-id: https://svn.eduke32.com/eduke32@1691 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-11 22:37:45 +00:00
helixhorned 2f15e237f7 m32script: added BUILD functions getclosestcol and divscale, made 2d drawing commands accept VGA-palette colors (-1 through -255) in addition to editor colors, made 2d mode show Polymer SE light outlines
git-svn-id: https://svn.eduke32.com/eduke32@1683 1a8010ca-5511-0410-912e-c29ae57300e0
2010-08-03 22:21:13 +00:00
helixhorned 02379ee1d2 More of them. Includes the possiblity of typing m32script commands directly into the OSD (without "do", see osdtryscript in mapster32.cfg) and improved diagnostics.
git-svn-id: https://svn.eduke32.com/eduke32@1649 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-22 23:41:18 +00:00
helixhorned 8077dcd633 Mapster32 maintenance pack #1
The bulk of this commit is "code rape"--or rather, caressing, rewritten for readability.
Actual changes/fixes:
  - fixed "walking" in 2d mode
  - fixed DELETE key in OSD in SDL build
  - main loop in general (timeout for event wait after 200 ms so that highlights blink)
  - access to some pr_override* variables in m32script (suggested by Roma Loom)
  - API cleanup (added statics and consts here and there)

git-svn-id: https://svn.eduke32.com/eduke32@1644 1a8010ca-5511-0410-912e-c29ae57300e0
2010-05-18 05:14:17 +00:00
helixhorned 102b702fc0 m32script fixes and additions
git-svn-id: https://svn.eduke32.com/eduke32@1579 1a8010ca-5511-0410-912e-c29ae57300e0
2010-01-04 14:38:29 +00:00
helixhorned 73d0b92d92 more demo control + sound access for m32script
git-svn-id: https://svn.eduke32.com/eduke32@1538 1a8010ca-5511-0410-912e-c29ae57300e0
2009-11-01 20:30:09 +00:00
helixhorned d6f525b44b crude demo fast-forward/rewind; more m32script goodness
git-svn-id: https://svn.eduke32.com/eduke32@1536 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-25 23:25:38 +00:00
helixhorned 4bde7fddac m32script conveniece
git-svn-id: https://svn.eduke32.com/eduke32@1528 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-11 15:52:16 +00:00
helixhorned 40d655100c m32script: stuff for fiddling with polymer lights
git-svn-id: https://svn.eduke32.com/eduke32@1521 1a8010ca-5511-0410-912e-c29ae57300e0
2009-10-03 13:20:31 +00:00
helixhorned 293367e844 mapster-script stuff
git-svn-id: https://svn.eduke32.com/eduke32@1500 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-18 21:44:46 +00:00
helixhorned e7acafc9e7 some more functions for m32-script
git-svn-id: https://svn.eduke32.com/eduke32@1499 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-17 22:08:37 +00:00
helixhorned d7951477f5 d'oh
git-svn-id: https://svn.eduke32.com/eduke32@1498 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-16 22:33:10 +00:00
helixhorned 3be58d63d0 indirect constants for m32-script alongside with other changes
git-svn-id: https://svn.eduke32.com/eduke32@1496 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-14 22:11:37 +00:00
helixhorned ea0e088da5 Initial checkin of m32-script.
git-svn-id: https://svn.eduke32.com/eduke32@1493 1a8010ca-5511-0410-912e-c29ae57300e0
2009-09-12 23:03:15 +00:00