Demo Editing/Demo How To Info
- 1 Overview
- 2 How NPCs/Objects/Models Work
- 3 How the Camera Works
- 4 How Movement Works
- 5 How FXs Work
- 6 How To Make Transparent Entities
- 7 How To Make Invisible Models
- 8 How To Create Invasion Effects (Sky & War Walls)
- 9 How To Make Characters Walk
- 10 How To Do "Greenscreening"
- 11 How To Manage Destructible Objects
This page is likely going to go well over the recommended size and need to be broken up into smaller parts.
With a basic understanding of demo code, one can begin to manipulate the demo code, or construct it from scratch, to create different scenes and situations. This section addresses how, in general, certain features and elements of demos function and can be manipulated. Detail is also provided on some of the more specific "tricks" and demo functions frequently discussed by prospective videographers.
Although the information given here discusses how to achieve various ends through direct editing of the demo file, many of these results can also be achieved more easily by using existing demo editing applications (such as the editor applications developed by Zloth and Balshor). See the demo editing section on Additional Information (Links & Resources) for links to known demo editing tools.
How NPCs/Objects/Models Work
Collectively referred to as entities, models constitute all of the NPCs and objects encountered in the game which are neither inherent elements of the map nor a visual component of an FX or MOV animation. Destructible objects, NPCs of all types, pets, and vehicles are all governed by the NPC command and the demo elements attached to and associated with the NPC command.
To properly render an NPC in a demo requires the following demo code:
0 5 NEW "Blood Brother Slammer" 0 5 NPC Thug_Hellion_01 0 5 POS -227.15625 0 130.203125 0 5 PYR 0 -0.380427 -0
All lines associated with a particular NPC must always share the same Entity ID ("5", in this example). Each line, in more detail, can be broken down as follows (for more detail on the individual commands see Understanding Demo Code):
- NEW: The NEW command sets the stage for displaying an NPC, telling the game engine that it about to render a new NPC and attaching a name to that NPC as well as establishing the Entity ID for all subsequent elements. The name can be left blank or empty.
- NPC: The NPC command specifies the name of the model to display.
- POS: The POS command tells the game engine where on the map to render the model for this NPC.
- PYR: The PYR command tells the game engine in what spatial orientation to render the model for this NPC at the position previously specified.
At the most basic level, this is all that is required to render a (stationary) model via a demo. Generally, however, additional commands are also used, even for a basic stationary placement:
0 5 MOV LOITER_READYC 0 0 5 HP 60.00 0 5 HPMAX 60.00
- MOV: The MOV command will specify an animation (action/behavior) for the model to perform. If this is line is not provided, the model will use its default MOV animation (usually the READY MOV).
- HP & HPMAX: These lines are only used for an NPC which can be damaged (attackable NPCs and destructible objects). They are not required otherwise. In the case of destructible objects, these lines may be required to render the model correctly. This will depend on whether the model inherently has a variable appearance which changes as it is damaged. If this is the case, these lines must both be included to correctly display the model.
The simplest method of manipulating models with an existing demo is to straightforwardly replace one model with another. The advantages of this method are that you can have a player character (or NPC) act as a "stand in" for the model you want to appear, record the demo as you want it (minus your intended model), and then simply exchange the model code of one for the other.
As an example, to substitute Statesman for Flower Knight, simply make a demo recording of the Outbreak tutorial mission. Once you are finished recording the demo, find the NEW command for Flower Knight and the subsequent NPC line that specifies her model.
0 17 NEW "Flower Knight" 0 17 NPC Model_Kit_Sung
Once you have found this, substitute the model name for Flower Knight on the NPC command line (Model_Kit_Sung) with the model name for Statesman (Model_Statesman).
0 17 NEW "Flower Knight" 0 17 NPC Model_Statesman
Now play the demo back and instead of Flower Knight fighting by your side you will now be accompanied by Statesman (although "his" dialogue will remain the same and he will still be fighting with a bow and arrows; these are separate elements from the model). You may, at your option, also change the NPC name from "Flower Knight" to "Statesman" (or however else you wish).
Include Player to NPC example w/ how that differs.
Adding New Models
With regards to simply adding a new model, the demo code and command lines already detailed are the essence of what is needed to place a new model. The following steps summarize what is required to produce this code. However, please note that this section does not address the possible complication of model placement being outside the camera POV and assumes that this not an issue (see the next section for further detail concerning the demo camera/POV).
- Choose a unique Entity ID number that is not used anywhere else in your demo.
- Choose the name of the model you want to appear.
- Determine the POS values where you want the model to be placed on your map. Often, this will be the most difficult step. The easiest way to do this is usually to choose a map from "live" game play and make a note of the /loc where you want to place the model.
- Determine the PYR orientation you want the model to have.
- Optionally, pick a MOV animation you want the model to perform.
How the Camera Works
How Movement Works
How FXs Work
How To Make Transparent Entities
Most stealth, invisibility, and transparency FX do not play back in demos. Although the FX commands for these powers are present in the demo recording, they produce no visible change in a model's appearance during demo playback. There are a few exceptions, such as Numina and War Witch (her trainer model), but in these cases the transparency is inherent to the model and not an FX that you can apply to other entities.
However, although none of the standard stealth or transparency powers work in demo playback, there is one transparency FX which does work:
This is the placeable mission objective FX such as you would see for planting bombs in a Mayhem Mission Arson secondary mission. It is this FX which makes these mission objectives transparent until they are activated or clicked on. Although, this FX is normally only used for these SEQ entities, it also function for regular models. The following example shows this FX being applied to Back Alley Brawler in Galaxy City:
0 17 NEW "Back Alley Brawler" 0 17 NPC Model_Back_Alley_Brawler_Trainer 0 17 POS 367 65.921875 -832 0 17 PYR 0 -1.570796 -0 0 17 MOV READY_XARMS 0 0 17 FX Maintained 717 OBJECTIVEOBJECTFX/GHOSTED.FX 0
The FX command line is the only addition being made. This is all that is required to apply this transparency effect to an entity (although applying the standard associated FX lines to be compliant with normal FX conventions may be advisable), as can be seen here:
Note, though, that there are two qualifier to using this FX to achieve transparency:
- The transparency effect pulsates, just as you would see with the mission objectives which normally utilize this effect, so it is not a consistent, steady level of transparency.
- This FX also includes the mission objective audio component (the alert noise to notify you that you are near the objective), so when using this FX to create a demo for video capture, that audio component will be present and must be worked with if the demo's audio is being included as part of the capture.
How To Make Invisible Models
Using Puddle or other invisible models for total invisibility or using FXs "on their own."
Also possible by creating a null costume. See: . This method allows application of MOV effects not possible with Puddle. This method might also allow invisibility effects by applying an aura (costume or FX) to the otherwise null costume.
How To Create Invasion Effects (Sky & War Walls)
The SKY and DYNARRAY commands, including limited information on how each is used during invasion events such as the Rikti World Invasion, are discussed in the Understanding Demo Code section. In further detail, these two command lines are used together for managing the changes to the sky color and operational state of the War Walls.
The sky color is changed during an invasion event by changing the integer values of the first two variables following the SKY command, as follows:
|Sky "Type"||Demo Code||Color|
|Normal/Default Sky||0 SKYFILE SKY 1 0 1.000000||map default (usually Blue)|
|Normal/Default Sky (alternate)||0 SKYFILE SKY 2 0 1.000000||map default (usually Blue)|
|Rikti Invasion Sky||0 SKYFILE SKY 0 1 1.000000||Olive Green|
|Zombie Apocalypse Sky||0 SKYFILE SKY 0 2 1.000000||Dark Red|
The operational state of the War Walls is controlled by the DYNARRAY command by changing the first value of the array data between "100" (for active or "up" War Walls) and "0" (for inactive or "down" War Walls). These command lines, when there is only a single data set attached to the DYNARRAY command, are as follows:
War Walls Active/Up: 0 DYNGROUPS DYNARRAY |100,0 War Walls Inactive/Down: 0 DYNGROUPS DYNARRAY |0,0
When there is more than one element specified by the DYNARRAY command (such as for the pillbox status boards in Atlas Park), then the first data set in the array controls the War Walls (when War Walls are present), like so:
War Walls Active/Up: 0 DYNGROUPS DYNARRAY |100,0|100,0|100,0|100,0|50,0|100,0|50,0|50,0 War Walls Inactive/Down: 0 DYNGROUPS DYNARRAY |0,0|100,0|100,0|100,0|50,0|100,0|50,0|50,0
How To Make Characters Walk
How to make player characters walk. All require replacing player character MOVs with an appropriate NPC walking MOV.
1. The lazy way: Use an existing walking NPC, such as found walking down the street, demorecord and then replace with player character code. If you want the camera to move with the NPC, target & follow (and then erase/replace unwanted entities with Puddles or such).
2. Independent way: Doesn't rely on existing NPC. Demorecord PC and adjust timing/positioning of POS to slow down movement (in addition to replacing MOV).
How To Do "Greenscreening"
1. Using a "null" (or junk) Map name to create endless blue sky and diving deep down the Z axis to hide the clouds (verify). Creates "bluescreen" background. Link to Greenscreen
2. Using Leandro's Splasher program to replace (local only) textures in a supergroup base, you can insert a uniform background texture/color of your choice for possible greenscreening.
How To Manage Destructible Objects
Object-based NPCs that are classed as "destructible" have a variable appearance based on their Health. Sometimes, this variable appearance is as simple as destroyed and not-destroyed, but some destructible objects also have multiple different Health-dependent appearances, including, for example, partly-damaged states. Perhaps the most common example of such a destructible object is the bank vault door found in a Mayhem Mission. This object has an undamaged appearance (Health greater than 50%) and a damaged appearance (Health less than 50%, but greater than 0%).
To make these destructible objects appear correctly in demos, you must assign a Health state to the models using the HP and HPMAX commands. If this is not done, then the game engine will assume that the Health of the objects are zero and will treat the models as "destroyed." This usually, but not always, means that the model of the destructible object will not have a visible appearance in the demo playback.
Hence, if you are adding destructible objects to a demo file (or replacing a non-destructible entity with a destructible one), the associated demo code for these destructible objects must include the HP and HPMAX command lines for them, like so:
0 23 NPC v_destcldrn_cauldron 0 23 MOV READY 0 0 23 HP 150.00 0 23 HPMAX 150.00
Setting the HP equal to HPMAX will give you the default, undestroyed and undamaged appearance for the destructible object. If an object model was not appearing during demo playback when this code was absent, the adding of this code should cause the object to appear. If a destructible object possesses transitional appearances, the value for HP can be adjusted relative to HPMAX to obtain these other states of appearance. However, not all destructible objects have transitional appearances. Examples of destructible objects with multiple transitional appearances include the Paladin Construction model and the Rikti A Bomb (UXB) model.
Not all object models are destructible. Some which are include the text "dest" in the model name, and the presence of this text in the model name typically provides confirmation that an object is destructible. However, there are also destructible models that do not include "dest" in the model name and which provide no indicator in the model name that they are destructible. If in doubt, the HP and HPMAX command lines can be added to the demo code for any model. It will not affect demo playback to add this code to a model which is not destructible.