Difference between revisions of "M32 script examples"

From EDukeWiki
Jump to navigation Jump to search
(created this page documenting a.m32)
 
m
Line 78: Line 78:
  
  
Also, various modifiers (usually Shift and/or Ctrl) affect in what increments these values are changed.<br>
+
Also, various modifiers (usually '''Shift''' and/or '''Ctrl''') affect in what increments these values are changed.<br>
  
 
Finally, '''Alt-KP1''' asks for RBG values and '''Alt-KP2''' for a tile number used as light projection.
 
Finally, '''Alt-KP1''' asks for RBG values and '''Alt-KP2''' for a tile number used as light projection.
Line 84: Line 84:
  
  
*When aiming at a wall or a sector with Polymer enabled, '''KP/'''s the cvars ''r_pr_overrideparallax'' and ''r_pr_overridespecular''. When override mode is enabled, the following keys let you tweak the parallax and specular parameters:<br>
+
*When aiming at a wall or a sector with Polymer enabled, '''KP/''' toggles the cvars ''r_pr_overrideparallax'' and ''r_pr_overridespecular''. When override mode is enabled, the following keys let you tweak the parallax and specular parameters:<br>
  
 
{| cellspacing="1" cellpadding="1" border="1" width="250"
 
{| cellspacing="1" cellpadding="1" border="1" width="250"
Line 164: Line 164:
 
==== EVENT_INSERTSPRITE3D ====
 
==== EVENT_INSERTSPRITE3D ====
  
When this event is enabled, insetring a LOCATORS sprite will auto-increment its lotag value by setting it to the maximum lotag value of all LOCATORS in its sector plus one.
+
When this event is enabled, inserting a LOCATORS sprite will auto-increment its lotag value by setting it to the maximum lotag value of all LOCATORS in its sector plus one.
  
  

Revision as of 10:11, 4 August 2010

Mapster32 Scripting



This page documents the semi-official scripted Mapster32 enhancements implemented in samples/a.m32.


Polymer related manipulations

state printlights

Calling this routine prints all Polymer SE lights in the current map formatted as expected by maphack files to the console, so that they can be copied and pasted from mapster32.log.


EVENT_PREKEYS3D

Various keys are overridden for special purposes in 3D mode when this event is enabled.

  • When aiming at a Polymer SE light, the following key bindings on the keypad become active:

/
*
-
7
8
9
+
4
5
6
1
2
3

.






KP 4,5,6,8
angle/horizon
KP 7,9
range (light distance)
KP+/-
spotlight cone radius
KP 1,2,3
RGB color (Shift inverts)





Also, various modifiers (usually Shift and/or Ctrl) affect in what increments these values are changed.

Finally, Alt-KP1 asks for RBG values and Alt-KP2 for a tile number used as light projection.


  • When aiming at a wall or a sector with Polymer enabled, KP/ toggles the cvars r_pr_overrideparallax and r_pr_overridespecular. When override mode is enabled, the following keys let you tweak the parallax and specular parameters:

/
*
-
7
8
9
+
4
5
6
1
2
3


.


KP 4,7
parallaxscale
KP 8,9
parallaxbias
KP 1,2
specularfactor
KP 3,6
specularpower

Again, modifiers control the increment speed.



Geometry manipulations

state rotselspr

Using this routine, you can rotate a collection of sprites around a pivot sprite by an arbitrary angle.

To use it, first select the sprites you want to rotate using RSHIFT. Next, bring the mouse pointer close to the sprite you wish to be the pivotal one so that it blinks. To carry out the rotation, enter the following command in the console:

do set dang <angle in BUILD units>, state rotselspr

where positive angle values specify clockwise rotation.


state duprot and state duplin in EVENT_ANALYZESPRITES

These routines permit you to duplicate a collection of sprites in a circular arc or a straight line, adding a z offset to each step. The main use of them is the construction of sprite stairways.

Their usage is documented as a tutorial in m32script_ex.map.



Miscellaneous functions

EVENT_INSERTSPRITE3D

When this event is enabled, inserting a LOCATORS sprite will auto-increment its lotag value by setting it to the maximum lotag value of all LOCATORS in its sector plus one.


EVENT_KEYS3D

This event defines a few convenience function for the SPACE key:

  • When hit on a door wall (but not a swinging door), its sound will play.
  • When hit an on SE7 (teleporter/water) or SE17 sprite, it will teleport you to the other location.