Duke4.net Forums: Debug Camera for Mappers - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Debug Camera for Mappers  "Potentially useful for others as well as me"

#1

At the suggestion of the Discord server, I have decided to touch up and release this 'tool' in case it is useful to anyone else and, also, largely because I lost my original version and had to start over. This way, it won't be lost as easily.

What is it?
The Debug Camera allows you to place 10 preset cameras in a map, which you can view in a small window at the top right of the screen. The camera can be moved, snapped to the player's location or its location saved to one of the preset slots at any time. This allows level designers to keep watch on other parts of their levels when testing, such as being able to view the insides of a 'target logic' machine, or to figure out what's happening to that one monster that seems to vanish on the other side of the map.

How does it work?
The camera simply uses the 'showview' command in CON.

Single Camera Method
This method is closer to the original 'hardcoded' version I used for Dimension Shift. For this you simply fill in the co-ordinates for the camera using the relevant gamevars at the top of the CON. This will give you a single camera that you can move around, but you won't be able to use it with any of the preset slots.

Preset Method
This method requires no CON editing. Instead you would place Tile 62 in your level, then give it a LOTAG of 95. The HITAG will be from 0 to 9, which corresponds to keys 1 to 0 when in camera control mode (discussed shortly), which act as the preset slots.
The X/Y/Z and ANG of the sprite will be the X/Y/Z and ANG of the camera, and the camera will instantly move to the location of the Tile 62 tagged 0,95 at map start. Use the sprite's EXTRA to set the camera's horizontal position, 100 is straight ahead, the range is -99 to 299.
It is recommended that even if you only want to use a small number of presets, to place the full set of Tile 92's in your map, as you can then save to the remaining, unused ones if needed.
Positions saved in the game will be lost as soon as the level is un-loaded.

Using the cameras
Once you load your map in the game, the camera will draw to the top right of the screen. If the camera is out of bounds, nothing will draw, except perhaps a small dot, which will be green. This is the mode indicator, which works as follows:

Green - Play Mode. The game plays as normal.
Blue - Camera Mode. The player is partially locked and you can move the camera around, or select presets.
Red - Save Mode. You can now temporarily save the camera to an available preset slot.

The controls are as follows - assuming you use EDuke32's default controls:
PgDn - Play Mode.
PgUp - Camera Mode.
E - Save Mode.
0-9 - Select Preset to Load or Save.
ASDW - Move camera on X/Y axis.
Left/Right Arrow - Rotate camera Left or Right.
Home/End - Tilt camera Up or Down.
Insert/Delete - Raise or Lower camera.
Backspace - Move camera to player.

Using presets:
When in Camera Mode, pressing the numeric keys along the top of the keyboard will select a preset, provided the relevant sprite exists in the map. Moving the camera in this mode will not affect the preset location and pressing that number again will restore its original position.
Beware that pressing key 1 refers to the preset with HITAG 0 and pressing 0 refers to the HITAG 9 preset.

When in Save Mode, pressing the numeric keys will save the camera's current position to the relevant slot, provided the relevant sprite exists in the map. If it does, the indicator will turn blue. If it does not, the indicator will remain red and you will either have to use a different slot, or press the PgUp or PgDn keys to exit Save Mode.
Beware that pressing key 1 refers to the preset with HITAG 0 and pressing 0 refers to the HITAG 9 preset.

Controls should be unaffected in Play Mode, aside from the PgUp and PgDn keys. It is only possible to enter Save Mode from Camera Mode.



Download
http://dxzeff.com/trash/thirdeye.zip
To use, simply place the CON in a subdirectory and select it from the dropdown when starting EDuke32. You can also place the CON in your game directory and simply rename or remove it when it isn't required. If it doesn't work, then some other CON is probabl being loaded and preventing this one from running.

Preview
A video showing a quick sample of the code running, in a modified E1L2. Doing this has little use, as the camera is really intended as a tool for level designers, but you can at least see it working.



- The code is messy and a little inefficient. It also has every potential to break. I'm not responsible if something bad happens, though I'd imagine at worst it'd just make EDuke32 act weird until you reset it.
12

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options