DUKE PLUS MAP EFFECTS
last updated November 1, 2008 (for version 1.90)
THE BASIC EFFECT: Place a SE with lotag 102 at the height that you want the water surface to be. Any sprite that goes below that height in the sector will be underwater. If the sector is going to be entirely underwater, you should set the EXTRA of the SECTOREFFECTOR to 1 (this will ensure that anything in that sector is considered underwater, regardless of the height of the effector sprite). To complete the effect, place some flat WATERTILE2 or 889 sprites at the water level and make them transparent and non-blocking (see sample maps for examples). An underwater player will be able to see out of the water from below, and vice versa.
WATER COLOR AND FOG: To change the appearance of the water, change the pal of the lotag 102 SE.
Pal 0 = normal water, no fog,
Pal 27 = red liquid,
Pal 28 = green liquid
Pal 29 = blue liquid
Pal 30 = normal water with fog
Pal 31 = dark water with fog
Pal 32 = very dark water with fog.
In addition, the shade of the SE alters the visibility of the underwater area (higher shade = less visibility, shade 127 is the maximum).
WATER WITH A CURRENT: To make water with a current, set the XVEL of the SE to the desired speed (96 is about the speed that the player can swim). The water will move in the direction that the SE is facing.
BOBBING WATER: To make water that is able to rise and fall, you must place a red H sprite (tile 2947) in the sector and give the H sprite a lotag of 1. The H should be placed at the same height as the SE. The hitag of the H will determine how far up and down the water moves (it will move 8 z units for every 1 hitag, so a hitag of 1000 will make if move about one player body length), and the ZVEL of the H deterimines how fast the water moves (numbers < 1000 are best).
WATER THAT RISES OR FALLS ON SWITCH ACTIVATION: To make water that rises/falls in response to a switch, set the YVEL of the SE (or however many SEs you want controlled) to some number that is not being used as a lotag for any other effects. Then place a switch and set the YVEL and lotag of the switch to that number. The height that the water will end up at after the switch is thrown will be the height of the H sprite that you placed (which could be either higher or lower than the water SE). If the switch is activated again, the water will move back to its original position. To prevent this, set the hitag on the SE to 1, and the water will only move once.
LOTAG 104 FLOOR AND CEILING TEXTURE PANNING
Set the SE to lotag 104. XVEL of the SE determines the x panning speed (can be positive or negative). YVEL determines y panning speed. Leave ZVEL at 0 if you want only the floor to pan. Set ZVEL to 1 if you want only the ceiling to pan. Set ZVEL to 2 if you want both the floor and ceiling to pan. Note that different sectors may automatically pan in different directions -- this seems to be determined by the direction that the firstwall of the sector is facing.
LOTAG 105 SLEEPING EFFECT
This effect will make the screen fade to black and freeze the player in place when he enters the sector. The screen will then fade back in with the player in a new location. To make the effect, place two lotag 105 SEs in different sectors, and give them each the same hitag. When the player reaches one of these, he will "sleep" and then wake up at the other one, facing the angle of the destination SE.
Additional options: Give the destination SE a pal of 2 and it will take away all of the player's weapons and inventory. Set XVEL on the SE if you want a longer delay before the player falls asleep (XVEL 26 = 1 second). If you set ZVEL on the SE, then it will be destination only (the player will be able to move through the sector without sleeping, but he can be taken there by another SE).
LOTAGS 116 AND 118 ELEVATORS WITH MORE THAN TWO STOPPING POINTS
INSTRUCTIONS:
(1)Place a SECTOREFFECTOR in the elevator sector. Give it a lotag of 116 if you want only the floor of the elevator sector to move, and give it a lotag of 118 if you want the ceiling to move as well.
(2)Set the hitag of the SE to the number of the sound you want it to play when the elevator is activated (#71 is the standard sound).
(3)The shade of the SE is the number of different stops the elevator will make. You probably want the shade to be 3 or higher, since otherwise there is no point in using this effect (the elevator will not function at all if shade is less than 2).
(4)The XVEL of the SE determines the distance the elevator travels between stops. The higher the number, the greater the distance: XVEL * 64 = Z units. This means if you want the elevator to move 32768 Z units between floors (or about three times the player’s height), set XVEL to 512.
(5)The ZVEL of the SE determines the elevator’s speed and initial direction. If ZVEL is negative, the elevator’s initial position in the map editor will be its highest point; if ZVEL is positive the start position is the lowest point. Magnitudes between 256 and 1024 will serve for most purposes. For example, a ZVEL of -1024 means that the elevator starts in the up position and will move pretty quickly between stopping points when activated. IF YOU DON'T WANT THE ELEVATOR TO BE ACTIVATED BY A SWITCH, THEN YOU ARE DONE.
(6)There are two ways to set up elevator operation: operation via the open key, and operation via switches. If you do nothing further, the elevator will be operated by the open key. The disadvantage to the open key method is there is no way to control whether the elevator goes up or down – it must be cycled through all of its positions. Thus, you will probably want to make the elevator operated by switches. To do this, start by assigning a nonzero YVEL to the SE.
(7)Next, place two switch sprites (any of the switch tiles should work). Assign one lotag to the switch that will move the elevator up, and a different lotag to the switch that will move it down. In addition to the normal switches, you can use the Duke Plus buttons with animated up and down arrows. The down switch is tile 8032, the up switch is 8037. These function just like the normal switches, except that you don’t have to set a lotag on them.
(8)Now assign both switches the same YVEL that you assigned to the elevator SE. The YVEL does not need to equal either of the lotag values you gave the switches.
(9)Finally, assign one and only one of the switches an XVEL of 1 – that will make it move the elevator in the opposite direction from the other switch. At this point, your elevator should be operational. Test it in game to see which switch moves it up and which moves it down (you can then reverse the switches by trading their XVEL values, if necessary). You can make another pair of switches for the same elevator. Give the new pair of switches the same lotags as the first pair, and the same YVEL, and make sure one has XVEL of 0 while the other has XVEL of 1. The switches can be placed inside of the elevator and they will move along with it. For best results, use the DP elevator buttons mentioned above.
LOTAG 666 SECTOR OF DEATH
Place an SE and give it a lotag of 666, and any actor killable actor (player, monster, etc.) that falls below the SE in that sector will be annihilated. Useful in multiplayer maps, if you want players to die in a certain area, but don't want to make them fall a great height. If you want the SE to only kill in a certain zone below it (it kills things below it, but only up to a certain distance), then set its ZVEL to the desired distance of death. The distance you set is multiplied by 8 -- e.g. set ZVEL to 1024 and anything up to 8192 build z units below the SE in that sector will be killed.
Duke Plus Sprites
The following effects are created by sprites other than SEs. They are listed in tile number order.
Breakable glass pane sprites.
Place a GLASS sprite (tile #503) and give it a lotag of 1. In game, the first hit from a weapon will crack the glass, and the second will shatter it. (Though the first hit can shatter it if it does enough damage). Rockets can break through the glass and keep going. Glass sprites can be linked by hitag, if the hitag is greater than 0. For example, if you place four glass sprites and give them all a hitag of 1, damaging one will cause all of them to be damaged. This is useful if you want to create a large pane of glass without stretching the sprites.
Invisible Blocking Sprites
Place a sprite of tile #507 and give it a lotag of 1. In game, the sprite will be invisible and blocking, but allow hitscan (bullets) to pass through it. Useful for constructing barriers to prevent the player from entering certain areas without adding walls to the map.
Rain and Snow in outdoor areas.
Place a WATERDRIP sprite (tile #660) somewhere in the map. Then, change the EXTRA tag of the sprite to a nonzero value between -32 and 32 (positive values for rain, negative for snow). The greater the magnitude of this value, the greater the density of the rain or snow. The rain or snow will have the palette and transparency level of the WATERDRIP sprite. You should only place one such sprite in the map (you can place other WATERDRIP sprites, but only set EXTRA on one of them).
Flying helicopters that drop stuff.
Place the second helicopter tile (tile #1338) and set its lotag to the number of things it will spawn (this must be higher than 0 or it will not work at all). Set hitag to the number of ticks it will travel before dropping the spawned items. Set XVEL to the tile number that it will drop (only one tile number per helicopter). This could be the tile number of a monster, item, or anything else. Set EXTRA to the flag value that the spawned sprites will have (useful if it spawns Dukebots or monsters). Spawned sprites will have the same pal as the helicopter as well. Set ZVEL to the quote number that will be displayed when the drop occurs (leave this value at 0 to display no quote). Last but not least, set YVEL to the activation number of the helicopter. It can be activated by an ACTIVATOR or ACTIVATORLOCKED, or any DP sprite that uses activation and has its YVEL set to that number. For example, you could activate the helicopter with a DPTOUCHPLATE that has a YVEL set to the YVEL of the helicopter (but not a regular TOUCHPLATE). Once activated, the helicopter will appear and will move at a slow speed that is not adjustable, and it will move in a straight line until it is unable to move, at which time it will disappear. The angle it will move at is 512 build degrees clockwise of the angle of the sprite (this was necessary because the original sprite is facing sideways).
Coronas
To add a corona to an object (such as a street light) place either a tile 1632, 1633 or 1634 where you want the corona to be, and give the sprite a lotag of 1. In game, the corona will be transparent and will change size depending on the distance from the player. By default, a corona has a minimum size of 12 (xrepeat/yrepeat). If you want the minimum size to be different, set the hitag of the sprite to the desired minimum.
DUKE PLUS TOUCHPLATES.
To make a DPTOUCHPLATE, place a red A sprite (tile #2940) and give it a lotag of 1. Set YVEL on the DPTOUCHPLATE to the tag number that you want it to activate (just like you would set lotag on a normal TOUCHPLATE). It will activate ACTIVATOR, ACTIVATORLOCKED, MASTERSWITCH, RESPAWN, and various DP sprites. DPTOUCHPLATEs are useful for two reasons: 1) it is more compatible with DP effects than a regular TOUCHPLATE. For example, DPTOUCHPLATE can activate a WAYPOINT (see section on bot allies in DPdoc) while a regular TOUCHPLATE cannot. 2) the DPTOUCHPLATE can be made to be triggered only when the player is below it, instead of triggering the moment the player enters its sector. For this feature, give the DPTOUCHPLATE an EXTRA of 1. This is useful if you want the player to be at or near the ground when the activation occurs, instead of just anywhere in the sector.
Dynamic Lights
In Duke Plus, a “dynamic” light is a light source that can move and has various adjustable properties, similar to the Duke Plus flares. Because dynamic lights can impact performance, it is not recommended that they be used as a substitute for normal map shading and lighting effects. They should be used sparingly, and only to do things that would not otherwise be possible. For example, you could place a dynamic light on a moving sector, and it would cause nearby areas to light up as the moving sector passed by. You could also make an ordinary destructible sprite (such as a monster or a breakable object) into a light source.
MAPSTER INSTRUCTIONS: Place a red D sprite (tile #2943) where you want the light to be. Give it a lotag of 1. Give it a hitag corresponding to the picnum that you want it to become when the map loads (for example, if you give it a hitag of 2000, then it will be a PIGCOP that is also a light source). Next, set the YVEL of the sprite to the intensity of the light (values between 30 and 200 are good for most purposes). Finally, set the ZVEL of the sprite if you want the light to flicker (1-100). The size and pal of the sprite will be preserved when it changes picnum.
How Duke Plus lighting works: To use DP lighting effectively, it is helpful to know how it works. First of all, if the lighting system is going to be used, then it is initialized when the map loads. This entails that a new sprite be spawned for each lightable sector (normally, each sector in the map). A map with 2000 sectors would then contain 2000 additional sprites when the game is started (something to keep in mind if your map already has a lot of sprites). What do all of these sprites do? The sprites are light controllers, and each one is responsible for dynamically changing the shading of its sector depending on the position and intensity of the light sources in the map. The light controllers must also remember how the sector is shaded when no dynamic lights are affecting it, so that they can restore normal shading when a DP light is no longer around; this is actually quite tricky, because many sectors do not have static shading to begin with -- they may contain light switches, cyclers, etc. As a mapper, there are two things you need to keep in mind. First, because the light system is sector based, you cannot get a very realistic effect without using relatively small and regular shaped sectors. Second, because of the number of sectors involved and because of all of the math that the light controllers have to do, the DP lighting system can adversely affect performance. Take a look at how the effect is used in the DPEFFECTS.MAP for a good example of its proper use.
Gust Spawner
This creates the effect of small clouds or smoke puffs blowing past. It could be used to make a map that takes place inside of a moving airplane, with the clouds visible through the windows, or it could be used to add atmosphere to any map. The effect is created by placing tile #2946 (the red 'G') and giving it a lotag of 1. The size of the sprite will determine the size of the smoke puffs that it spawns. Pal and shade are transferred to the spawned smoke as well. The puffs will move in the direction that the sprite is facing, and disappear when they hit a wall. The hitag of the sprite is the number of ticks between spawns (26 = one second). The XVEL of the sprite determines the speed at which the smoke will move: valid numbers are between 1 and 100. If you want the smoke clouds to disappear before they hit a wall, set YVEL on the spawner to the number of ticks that the smoke clouds will last.
Jump Pads
To make a jump pad, place a sprite #2949 (the red 'J') in the map, and give it a lotag of 1. The hitag of the sprite will determine the activation distance (if you leave hitag at 0, it will activate when the player gets within 640 BUILD units). The XVEL of the sprite will determine the horizontal velocity of the player when he is jumped by the pad (values between 128 and 1024 are good in most cases). The YVEL of the sprite will determine for how long, in ticks, the jump from the pad will exert a force on the player while he is airborne. If you leave YVEL at 0, it will default to 26 ticks (1 second). It is important to set YVEL to the correct number; if it is too low, the player will not reach the intended destination. The ZVEL of the sprite is the most important and delicate setting; it determines the vertical velocity of the player's jump. Depending on the desired height, this will probably be a value between 512 and 2048. The angle of the sprite will determine the direction that the player moves in (of course, if XVEL is very low, then this won't matter). Finally, set the EXTRA of the jump pad sprite to 1, and it will emit energy pulses showing the trajectory that the player will follow.
Sparker
A sparker will periodically spawn sparks and make random short-circuit sounds. To make a sparker, place a tile #2950
(the red 'K') and give it a lotag of 1. Give it a hitag for the
delay, in ticks, between sparks (the delay will still be random, but
the higher the number the longer the delay).
Ladders
USING LADDERS IN GAME:
Approach the ladder and press forward while facing the general direction of the ladder to go up. Move backwards to come down. You can also grab on to a ladder by jumping to it. If you are at the top of the ladder, you must move backwards, with your back to the ladder, to get on it. Crouching while moving backwards is safe, as is walking, but if you run backwards you will usually miss. Once on the ladder, you can stop any time. But if you turn around too much, you will fall off. If you hold the jump key while on a ladder, you will slide down.
MAKING LADDERS IN MAPSTER:
To make a ladder, you need to place two sprites of tile number 2951 (the letter 'L' in the red font). If these are tagged as ladders, they will become invisible once the game starts.
Set the EXTRA of each sprite to 1, and make sure the pair of sprites has the same hitag.
Place one of the sprites above the other. The higher sprite will be the top of the ladder, the lower sprite the base of the ladder. Make sure that the ladder top is where you want Duke to get off the ladder. That means it must be almost a full Duke height above the ledge, or else Duke will simply fall back down when reaching the top of the ladder. Of course, the graphics you use to represent the ladder do not need to extend above the ledge, only the special sprite defining the ladder top does.
If you want a sound to play while the player is going up and down the ladder, set the lotag of the base ladder sprite to the number of the sound you want played. The vent crawling sound is a good choice.
Additional notes: The x and y coordinates of the base of the ladder will determine the ladder's actual position (the sprite for the top of the ladder is only referenced for its z coordinate, so technically it doesn't matter where you put it, as long as it is above the base). That means that ladders are strictly up and down affairs and cannot be sloped. The angle of the base of the ladder determines the angle that the player is supposed to face when using the ladder. So, if the ladder is up against a wall, then point the ladder sprites at the wall.
Mapster
instructions:
Place
a sprite of tile number 2958 (the red S). In game, the Spawner can be activated in three ways. If
you give the Spawner a
lotag of -1, it will activate as soon as it can "see" the player (just
like a monster). With a lotag of 1, it will activate when the player
enters its sector. If the Spawner has a lotag higher than 1, then it
will be triggered
by an ACTIVATOR or ACTIVATORLOCKED or DUKE PLUS TOUCHPLATE with a YVEL equal to that lotag. If you leave
the lotag at 0, it will not work at all.
Now that you have set the lotag, set the hitag to the tile number of the sprite (e.g. 2000 for PIGCOP) you want it to spawn. Set its shade to the total number of sprites you want it to spawn, or set the shade to a negative value to spawn without end. Setting its pal lower than 26 will make the spawned sprites have that pal. If pal is 26 or higher, then it acts as a delay (in number of ticks) until the first sprite is spawned (this is not the same as the delay between spawns). If the spawned sprites are monsters, you can set the XVEL of the spawner to the tile number of something you want the monsters to spawn when they die (just like you would set it on individual monsters). Normally, spawned sprites use the TRANSPORTERSTAR effect when they spawn in, but you can disable this by setting XVEL on the spawner to -1 (useful if you are spawning something that isn't a monster, such as TRASH). You can also set the EXTRA on the Spawner to set the monster flags of the spawned monsters (again, just like you would set it on the monster sprites). Set ZVEL to the number of ticks in between spawns (130 would be five seconds). Finally, set YVEL if you want it to operate activators and master switches when the last sprite is spawned (YVEL = the lotag it activates).
Boxes that can be picked up, dropped, thrown, piled and stood on
The small box (not so small, really) is tile 3498, and the big box is tile 3500. Pal 0 is the metal version and pal 30 is the wood version. Press use to pick up a small box: then press fire to throw it or press use again to place it. The large boxes cannot be picked up, but they can be pushed (press use while pressing forward against the large box).
Fireflies
These small glowing balls float around randomly and can add atmosphere to a map. Place a tile 4884 in the map and give it a lotag of 1, and it will become a firefly when the game starts (it will automatically be resized). They work well with different palettes.
Saw Blades
In addition to being normal objects that can be picked up by the player, saw blades (tile # 8006) are especially effective when fired from the gravity gun. They do a large amount of damage and bounce off of walls several times as they lose momentum and eventually come to rest.
A Warning about activation tags...
Many Duke Plus sprites use the YVEL tag as an activation number, similar to how switches and other standard sprites use lotag. It is recommended that, whenever possible, the activation number on DP sprites not be shared with the activation number on the regular hardcoded sprites. For example, suppose you have a switch with a lotag of 53, and it opens a door. But you also want the switch to activate a SPAWNER. You could give the switch and the SPAWNER a YVEL of 53, and it should work. But it would be safer to give the switch and SPAWNER a separate YVEL, such as 54 (assuming that 54 is not being used as a lotag or YVEL somewhere else). So in this case, you would give the switch and the door activators a lotag of 53, and you would give the same switch and the SPAWNER a YVEL of 54.
Special Tags
Slippery floors
To make the floor of a sector slippery, give the sector a lotag of 50. Sprite surfaces can be made slippery by setting the lotag of the sprites to 50 (sprites must be floor aligned for this to work)..
Activation by Monsters
Set the YVEL of a monster to make it activate all ACTIVATOR, RESPAWN, ACTIVATORLOCKED and MASTERSWITCH that have lotag equal to the YVEL you set (must be nonzero). The activation occurs when the monster dies.
Sprites that can only be seen when the nightvision goggles are used
Give
a sprite a pal of 66, and it will be not be visible or solid unless
the goggles are on.
This
works on enemies, pickup items, sprite bridges – any sprite at
all.
Pulsating sprites
To make a sprite pulsate in-game (the shade of the sprite will rise and fall), add 70 to its pal. For example, if you want the pulsating sprite to be pal 0 in-game, give it a pal of 70 in mapster. To make a pal 2 pulsating sprite, give it a pal of 72. Next, to change the rate of pulse, set the hitag of the sprite. A hitag of 0 will give a rapid pulse, while 1 is slower, 2 is even slower, and so on. Obviously, do not use this effect on sprites that already have a hitag set for some other purpose.
Tree Cstats
Give a tree sprite (tile #908 or #910) a nonzero lotag, and it will retain whatever cstat you give it in the map (flat, nonblocking, etc.) Normally, trees are hardcoded to become blocking and non flat in-game.