Maphack Language: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
LeoD (talk | contribs)
more detailed information added
LeoD (talk | contribs)
recent maphack tokens added
Line 28: Line 28:
Freezes any model animation in place.  This is achieved by altering the value of [[mdflags]].<br/>
Freezes any model animation in place.  This is achieved by altering the value of [[mdflags]].<br/>
There is no actual implementation for ''nomd2anim'' and ''nomd3anim''. They are mapped to ''nomdanim''.
There is no actual implementation for ''nomd2anim'' and ''nomd3anim''. They are mapped to ''nomdanim''.
===away1===
sprite ''spriteid'' '''away1'''
Moves the sprite forwards by a small amount. This is achieved by altering the value of [[mdflags]].<br/>
It is mostly used to resolve flickering ("z-fighting") of overlapping wall aligned sprites, which is especially prevalent when using the Polymer renderer.
===away2===
sprite ''spriteid'' '''away2'''
Moves the sprite backwards by a small amount. This is achieved by altering the value of [[mdflags]].<br/>
It is mostly used to resolve flickering ("z-fighting") of overlapping wall aligned sprites, which is especially prevalent when using the Polymer renderer.


===[[pitch]]===
===[[pitch]]===
Line 54: Line 66:


Offsets the '''z''' coordinate of the model's centerpoint, to be used in conjunction with '''pitch''' (forwards/backwards) and/or '''roll''' (right/left).<br/>
Offsets the '''z''' coordinate of the model's centerpoint, to be used in conjunction with '''pitch''' (forwards/backwards) and/or '''roll''' (right/left).<br/>
The '''pitch''' and '''roll''' values can be used as scaling factors. With '''pitch 1''' and '''roll -2''', for example, the model is moved twice as far to the left as it gets moved forwards. Be aware that the same ''value'' will result in 1/16 the translation for '''mdzoff''' compared to '''mdxoff''' and '''mdyoff'''.
The '''pitch''' and '''roll''' values can be used as scaling factors. With '''pitch 1''' and '''roll -2''', for example, the model is moved twice as far to the left as it gets moved forwards.<br/>
Be aware that the same ''value'' will result in 1/16 the translation for '''mdzoff''' compared to '''mdxoff''' and '''mdyoff'''.
 
===mdposxoff===
sprite ''spriteid'' '''mdposxoff''' ''value''


===away1===
Ported from NBlood. In Mapster32's 2D view the '''x''' coordinate of the model's centerpoint is moved to the right/eastwards/angle 0. (The default placement lets sprites face northwards/angle 1536.)<br/>
sprite ''spriteid'' '''away1'''
This is quite different from the way ''pitch/roll + md[x|y|z]off'' works. Do not confuse.
 
===mdposyoff===
sprite ''spriteid'' '''mdposyoff''' ''value''
 
Ported from NBlood. In Mapster32's 2D view the '''y''' coordinate of the model's centerpoint is moved to down/southwards/angle 512. (The default placement lets sprites face northwards/angle 1536.)<br/>
This is quite different from the way ''pitch/roll + md[x|y|z]off'' works. Do not confuse.
 
===mdposzoff===
sprite ''spriteid'' '''mdposzoff''' ''value''


Moves the sprite forwards by a small amount. This is achieved by altering the value of [[mdflags]].<br/>
Ported from NBlood. In Mapster32's 2D view the '''z''' coordinate of the model's centerpoint is moved forwards to the viewer (upwards in 3D view).<br/>
This is mostly used to resolve flickering ("z-fighting") of overlapping wall aligned sprites, which is especially prevalent when using the Polymer renderer.
This is roughly equivalent to the way (''pitch + mdxoff'') or (''roll + mdyoff'') work, respectively.


===away2===
===mhkreset===
sprite ''spriteid'' '''away2'''
sprite ''spriteid'' '''mhkreset'''


Moves the sprite backwards by a small amount. This is achieved by altering the value of [[mdflags]].<br/>
This development helper resets all previous maphacks for a sprite.
This is mostly used to resolve flickering ("z-fighting") of overlapping wall aligned sprites, which is especially prevalent when using the Polymer renderer.





Revision as of 04:39, 26 October 2021

Maphacks are used to edit the positioning of objects and other parts of a level in cases where the maps cannot be redistributed. This only affects the visual representation through the renderer and does not change the actual gameplay. Additional information may be found in MapHacks.txt.

sprite

sprite spriteid <token> [value]

sprite spriteid angoff value
sprite spriteid angleoff value

Rotates the model (md3 or kvx) away from the starting angle of the sprite. A value of 2048 represents a full turn of 360 degrees. Practical values should be chosen between -1023 and 1024 (+- 180 degrees).

notmd

sprite spriteid notmd
sprite spriteid notmd2
sprite spriteid notmd3

Renders a tile as a texture (original ART tile or highres image if available) instead of a model (md3 or kvx). This is achieved by altering the value of mdflags.
It is mostly used to "flatten" wall aligned or floor aligned decorative objects.
There is no actual implementation for notmd2 and notmd3. They are mapped to notmd.

nomdanim

sprite spriteid nomdanim
sprite spriteid nomd2anim
sprite spriteid nomd3anim

Freezes any model animation in place. This is achieved by altering the value of mdflags.
There is no actual implementation for nomd2anim and nomd3anim. They are mapped to nomdanim.

away1

sprite spriteid away1

Moves the sprite forwards by a small amount. This is achieved by altering the value of mdflags.
It is mostly used to resolve flickering ("z-fighting") of overlapping wall aligned sprites, which is especially prevalent when using the Polymer renderer.

away2

sprite spriteid away2

Moves the sprite backwards by a small amount. This is achieved by altering the value of mdflags.
It is mostly used to resolve flickering ("z-fighting") of overlapping wall aligned sprites, which is especially prevalent when using the Polymer renderer.

sprite spriteid pitch value

Adjusts the model's pitch, i.e. bowing or falling backwards. Not yet implemented for kvx models.
A hackish method can be used to move the model forwards/backwards from clipping into a wall, by setting the sprite's mdzoff to a grossly high (or low negative) number (try 100000 for starters), and setting a pitch of 1.

sprite spriteid roll value

Adjusts the model's roll, i.e. tilting to the side. Not yet implemented for kvx models.

sprite spriteid mdxoff value

Offsets the x coordinate of the model's centerpoint,(upwards/downwards in 3D view) to be used in conjunction with pitch.

sprite spriteid mdyoff value

Offsets the y coordinate of the model's centerpoint (upwards/downwards in 3D view), to be used in conjunction with roll.

sprite spriteid mdzoff value

Offsets the z coordinate of the model's centerpoint, to be used in conjunction with pitch (forwards/backwards) and/or roll (right/left).
The pitch and roll values can be used as scaling factors. With pitch 1 and roll -2, for example, the model is moved twice as far to the left as it gets moved forwards.
Be aware that the same value will result in 1/16 the translation for mdzoff compared to mdxoff and mdyoff.

mdposxoff

sprite spriteid mdposxoff value

Ported from NBlood. In Mapster32's 2D view the x coordinate of the model's centerpoint is moved to the right/eastwards/angle 0. (The default placement lets sprites face northwards/angle 1536.)
This is quite different from the way pitch/roll + md[x|y|z]off works. Do not confuse.

mdposyoff

sprite spriteid mdposyoff value

Ported from NBlood. In Mapster32's 2D view the y coordinate of the model's centerpoint is moved to down/southwards/angle 512. (The default placement lets sprites face northwards/angle 1536.)
This is quite different from the way pitch/roll + md[x|y|z]off works. Do not confuse.

mdposzoff

sprite spriteid mdposzoff value

Ported from NBlood. In Mapster32's 2D view the z coordinate of the model's centerpoint is moved forwards to the viewer (upwards in 3D view).
This is roughly equivalent to the way (pitch + mdxoff) or (roll + mdyoff) work, respectively.

mhkreset

sprite spriteid mhkreset

This development helper resets all previous maphacks for a sprite.


light

light sector x y z range r g b radius faderadius angle horiz minshade maxshade priority tilenum

Displays a spotlight using the Polymer renderer.