Basics sprites

From EDukeWiki
Revision as of 05:10, 3 May 2009 by One (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Sprites


Now that you understand sectors, it's time to learn about sprites. Sprites make a level much more interactive. A sprite is just an object. Weapons, ammo, enemies, babes, and even Duke himself are all sprites. There are also many 'special sprites', some of which are invisible in the game. These special sprites can do certain things depending on how you tag them. You'll learn about tags in the next section.

Placing

Start a new map and make a sector. It doesn't really matter what size, just as long as you have enough space to move about. In 2D mode, point the mouse cursor somewhere inside your sector and press S. A pink object will appear which has a circle and a tail. This object is a sprite. The tail signifies which direction the sprite is facing. If you look at the sprite in 3D mode, it will be textured as the default brown brick texture.

Pressing S in 3D mode also places a sprite. If the mouse cursor is pointed at the floor or ceiling, the sprite will appear directly on the floor/ceiling. If the mouse cursor is pointed at the wall, the sprite will be placed flat against the wall (this is referred to as 'wall-alignment'). You can change the texture of a sprite just like everything else. Press V on it once, and you'll see a list of all the sprite textures currently being used in the map. Since there are no other sprites in the map, only the brown brick texture will appear in the list. Press V again to get a complete texture list. You can pick anything you want: enemies, guns, lights, bottles, garbage cans... anything.

Customizing

Many of the keypresses that apply to sectors also apply to sprites. Highlight the sprite and press R. The sprite will become wall-aligned. You've just altered its relative alignment. There are three modes of relative alignment, all of which are cycled through using the R key: 3D (always faces the player), wall-alignment, and floor-alignment. Floor-alignment will cause some sprites to look meshed. As a general rule, only textures with square size values will look proper in floor-alignment mode. For example, some compatible texture sizes would be 32x32, 64x128, 32x256, etc. Some incompatible texture sizes would be 13x17, 57x9, 21x55, etc. You can change a sprite's angle in either 2D or 3D mode using < and >.

You can move a sprite up and down using PGUP and PGDN. You can place a sprite directly onto the ceiling or floor using Ctrl + PGUP or Ctrl + PGDN. Note that if a sprite is directly on the floor or ceiling, it will stick to it while it moves. You can shade a sprite with either Keypad + / - or Apostrophe (') + S. You can assign palette values to sprites as well. Use Alt + P and then enter any value from 0-25. Not all palette values cause a colour change. Check the Palette Reference section for details pertaining to the values.

If you walk into the sprite in 3D mode, you will automatically step up onto it. This is because its blocking flag is on. You can tell because it is pink in 2D mode. Most sprites are automatically blocked and hittable in the game. If you want to block or unblock a sprite, press B on it. It will turn blue in 2D mode when the blocking flag is off. Setting the hitscan flag is done with H in 3D mode, and Ctrl + H in 2D mode. Hitscanned sprites appear thick in 2D mode.

Many sprites are oversized by default. You can stretch or shrink a sprite manually using Keypad 2/4/6/8. All 'active' sprites (weapons, enemies, etc.) will automatically adjust themselves when the game starts (or when you reload the map), but I usually resize everything anyway.

Here are just a few more sprite attributes you can modify in 3D mode. If you press C on a sprite, it will center itself in the floor (as if it were floating amidst water). Use T to cycle through three modes of transparency. Pressing 1 on a sprite will make it one-sided (this is only relevant to wall-aligned or floor-aligned sprites). To change a sprite back to being two-sided, just press 1 again. You can also flip sprites. Use F to cycle through the different flip variations. Make sure you play around with all of these keys to get a basic idea of what they actually do.

Finishing Up

When selecting textures, you may notice that many display a name. These are usually special textures which have a function in the game. For example, to select an enemy you would have to select an enemy texture that displays a name. If you wanted to place a pigcop in your level, you would have to texture a sprite with the PIGCOP texture (#2000). If you use an unnamed texture for an enemy, it won't function in the game. Basically, as long as the texture you're using has a name, it will work like it should in the game. There are also other enemy textures such as PIGCOPSTAYPUT. These special textures will determine the enemy's initial position and behaviour.

Note: If you raise an 'active' sprite above the ground (weapons, health, enemies, etc.), it will automatically drop back to the floor in the game as soon as a player sees it. These sprites are coded to do so in the CON files.

Well, that covers the basics of sprites, so you can move on to the Tags section whenever you've had enough fun playing around.