![]() | ||
Risen3D Editing Maps Screenshots | ||
![]()
OVERVIEWThe Risen3D scripting method is an interactive custom model based system and requires a basic knowledge of the R3D ( jDoom ) model structure and how it correlates with definition files ( deds ).
feel welcome to use any models contained in the scripted maps available on the Risen3D website.
The door models used in this tutorial not only have hull collision but occlude when closed, these models can be used as a base for any map. Changing skins of these models can give a varied appearance to suit
the theme of any custom map. Other script types used by Risen3D are the SCP_ZOFF and SNDINFO, these will be explained later in this tutorial.
Special Note: Text files of the tutorial's ded and scripts have been provided, these are actually embedded
in the map as lumps, the text files just allow for easier access as a quick reference. MODEL TYPES
There are three basic groups of models Risen3D uses:
of 7000 - 7099, 7100 - 7199. This effectively allows for 200 custom models per map.
the way we get an interactive model to behave in a particular manner is to simply kill it, in other words bring
This principle is not hard to grasp because this is the way Doom handles states to achieve basic sprite technique of stepping through a sequence of states (frames).
SCRIPTING MAP THINGSScript Spot - used to link to an amodel. Action Spot - scripted spawning position. LineDef Spot - used to link an amodel to a triggered linedef. Z-Offset Spot - can alter height and light levels of a model. Ambient Sound - environmental sounds Ambient Trigger - provides a trigger for a dormant ambient sound.
If Doombuilder is your choice of editor, grab the latest Risen3D.cfg for Doombuilder.
SCRIPTING REFERENCESIt is important to use both the R3D_ModelSwitch.txt and R3D_types.txt as further references.
RISEN3D TYPE IDENTIFIERS15504 THING Before Risen3D can determine that scripting is used a 15504 THING must be placed in the map,
this will identify the map as having any of the following ....
15505 THING
Stops model suppression where any of the following sprites are a custom type ...
Special Note: The door key in the tutorial map uses a custom sprite.
SCRIPTING EXAMPLESTo be used in conjunction with the the scripts.wad installed with this tutorial.
Special Note: Script text is highlighted in GREEN
THE WALL VENT
How breaking a wall vent ( or glass window) is achieved .....
SPAWNSTART 7903 7094 17903 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7094 - Wall vent model ID number which was defined in the definition file ( ded ).
This links the 7903 Script Spot to model 7094, the 1 indicates that 7094 is spawned alive.
SETLINE 7703 1 GATE ""The 7703 LineDef Spot is placed on the 8083 triggered linedef.
The SETLINE function ensures the GATE sound will be played if used ( pushed ). The vent's breaking sound is achieved by the 'death sound' of the custom model.
BOOBY TRAP CEILING HATCH
How the booby trap ceiling hatch is achieved .....
SPAWNSTART 7904 7064 1 // LASER TRIP7904 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7064 - Laser trip model ID number which was defined in the definition file ( ded ).
This links the 7904 Script Spot to model 7064, the 1 indicates that 7064 is spawned alive.
SPAWNSTART 7905 7098 1 // CEILING HATCH7905 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7098 - Ceiling hatch model ID number which was defined in the definition file ( ded ).
This links the 7905 Script Spot to model 7098, the 1 indicates that 7098 is spawned alive.
The laser trip is activated by walking over the 8070 triggered linedef ( player walkover ).
ONDEATH 7904 { KILL 7905 0 1 }This is how one amodel can activate ( or KILL ) another, in this case the ceiling hatch ( 7905 ). ONDEATH 7905 { SPAWN 7800 { 9 70 0 0 9 70 35 0 9 70 50 0 } } On activation of the ceiling hatch several soldiers are spawned, this is done by placing the 7800 Action Spot at the desired spawning location. The script allows for 3 shotgun dudes to be spawned 70 map units high at intervals of 0, 35 and 50 tics, the last argument '0' indicates a silent spawn, '1' would indicate teleport fog.
LOCKED DOOR
How the locked door technique is achieved ....
SPAWNSTART 7912 7096 17912 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7096 - Door model ID number which was defined in the definition file ( ded ).
This links the 7912 Script Spot to model 7096, the 1 indicates that 7096 is spawned alive. ONDEATH 7912 { IFKEYS { SB1 } ONLOCKED LOCKED "You need to find the key!" PLAYSOUND DOOR2 0 1 1 } The door can only be activated if the player is in possession of the correct key, in this case the blue skull key (SB1) - see the ModelSwitch.txt reference for the other key designations. Plays the 'DOOR2' sound only once at maximum volume without attenuation.
When in the ONLOCKED state, trying to activate the 7712 linedef will result in the 'LOCKED' sound being played as well as the "You need to find the key!" text being displayed.
Special Notes: The blue skull key ( SB1 ) has been substituted with a custom model. The definition flag 'mf2_hullcollide' gives the door hull collision. The definition flag 'mf2_occlude' ensures everything behind the door is occluded when closed, a linedef must intersect the 7912 Script Spot and the sector that contains the 7912 Script Spot.
LIGHT SWITCH
Light switch effect ....
This script uses the TOGGLEREPLACE function which allows for amodels to be switched between states repeatedly. Here we see how one amodel ( a switch ) controls the behavior of another amodel ( a light ).
SPAWNSTART 7913 7020 1 // Light Switch7913 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7020 - Light switch model ID number which was defined in the definition file ( ded ).
SPAWNSTART 7914 7019 1 // Ceiling light in the off state7914 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7019 - Light off model ID number which was defined in the definition file ( ded ).
ONDEATH 7913 { TOGGLEREPLACE 7914 7018 7019 PLAYSOUND SWITCH 0 1 1 } Each time the light switch ( 7913 ) is activated it toggles a REPLACE function, Script Spot 7914 alternates it's link between models 7018 ( light on ) and 7019 ( light off ). Each time the switch is activated the 'SWITCH' sound is played.
Special Notes: TOGGLEREPLACE forces a RESETMANUAL if not defined.
DOUBLE SLIDING ( SWINGING ) DOORS
Double sliding (or swinging) doors ....
These doors have unique features, they have hull collision and also occlude when closed. They also work in unison as a pair by using the COTRIGGER function.
SPAWNSTART 7916 7006 17916 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7006 - Door ( one of a pair ) model ID number which was defined in the definition file ( ded ).
This links the 7916 Script Spot to model 7006, the 1 indicates that 7006 is spawned alive.
SPAWNSTART 7917 7007 17917 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7007 - Door ( one of a pair ) model ID number which was defined in the definition file ( ded ).
This links the 7917 Script Spot to model 7007, the 1 indicates that 7007 is spawned alive.
COTRIGGER 7916 7917The COTRIGGER function links both Script Spots to act as a pair when triggered. ONDEATH 7916 { PLAYSOUND CREAK 0 1 1 RESURRECT 120 } ONDEATH 7917 { PLAYSOUND CREAK 0 1 1 RESURRECT 120 } On opening the doors play the 'CREAK' sound only once at maximum volume without attenuation. The RESURRECT function delay the closing of the doors by 120 tics. ONRESET 7006 CREAK ONRESET 7007 CREAK The ONRESET function plays the 'CREAK' sound when the doors close.
Special Notes: Studying the THING definition will reveal that the raise state is used, this results in the doors closing after a specified delay. The definition flag 'mf2_hullcollide' gives the door hull collision. The definition flag 'mf2_occlude' ensures everything behind the door is occluded when closed, a linedef must intersect the 7916 Script Spot and the sector that contains the 7916 Script Spot.
SECURITY GATE
One of the more complex scripting methods is deployed with the security gate using the vertical door scripting method. The security gate displays some unique properties, although a model it behaves in the same way as a normal moving sector. This allows for the possibility of more interesting effects such as speed, height and model replacement.
This is how the security gate technique is achieved ....
SPAWNVDOOR 7902 7105 200 70 1607902 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7105 - Security gate model ID number which was defined in the definition file ( ded ). 200 - is the height you wish the sector be. 70 - is the height the model will travel 160 - is the time it takes for the model to rise.
This method does not use model animation but locks a static model into an invisible moving sector.
SETLINE 7702 1 GATE ""The 7702 LineDef Spot is placed on the triggered linedef that opens the gate, note in this case 7702 uses a DEAF flag which means it cannot be triggered until that line is set by the SETTRIGGER function. 1 GATE "" - always play the 'GATE' sound and display text, in this case no text is quoted.
ONDEATH 7902 { PLAYSOUND GATEDETH 0 1 1 } When 7902 is activated it will play the 'GATEDETH' sound only once at maximum volume without attenuation.
So how does the security gate become active ..... When the switch behind the glass ( 7901 ) is activated the security gate model is replaced with another gate model which displays a beeping keypad. ONDEATH 7901 { STOPSOUND 7900 // stops the alarm sound. REPLACE 7902 7099 // replace the security gate model with a // beeping keypad model. SETTRIGGER 7902 8064 // sets the 8064 linedef trigger (player uses). } Special Notes: The sector height is 1 greater than the floor to prevent occlusion. A line special of 8106 is initially used for the SETTRIGGER ( 7902 ) script function. The gate's beeping sound is achieved by using a 'seesound' with the custom model.
EXAMPLES USING THE SCP_ZOFF SCRIPT
Examples of using the SCP_ZOFF script.
Notice how the pictures are set at different heights and have different light settings.
Pictures .... SETDEF 16000 7071 60 20 // picture 1 SETDEF 16001 7071 100 30 // picture 2 SETDEF 16002 7071 255 40 // picture 3 16000 - Z-Offset Spot which can be whatever you like in the range of 16000-16299. 7071 - Picture model ID number which was defined in the definition file ( ded ).
This links the 16000 Z-Offset Spot to the picture model ( 7071 ).
The next argument is the light value, in the case of 16000 this is set at 60 ( 0-255 ). The next argument is the height, in the case of 16000 this is set at 20 ( in map units ).
Ammo stored on shelves at various heights ..... SETDEF 16006 2049 64 16 // Box of shells SETDEF 16007 17 64 16 // Large cell SETDEF 16008 2047 64 70 // small cell SETDEF 16009 2048 64 44 // Box of ammo The ammo model's z-offsets are adjusted to suit the various shelf heights. Shotguns hanging on wall .... SETDEF 16003 2001 100 20 SETDEF 16004 2001 100 40 SETDEF 16005 2001 100 60 Note that the spinning attribute of these models is disabled when SETDEF is used.
EXPLODING ENERGY TUBES
Example of the exploding energy tubes ....
On activation one model is replaced by another, a third dummy model provides the FX effects. Dummy models can be used to trigger other events or provide particle effects as is the case in this example. No model actually exists, however, the dummy model still needs to be defined and Risen3D needs to know that no model exists, for this we use the SPAWNDUMMY function.
SPAWNSTART 7910 7057 17910 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7057 - Energy tube model ID number which was defined in the definition file ( ded ).
This links the 7910 Script Spot to model 7057, the 1 indicates that 7057 is spawned alive. SPAWNSTART 7911 7057 17911 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7057 - Energy tube model ID number which was defined in the definition file ( ded ).
This links the 7911 Script Spot to model 7057, the 1 indicates that 7057 is spawned alive.
SPAWNDUMMY 7918 71197918 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7119 - Dummy model ID number which was defined in the definition file ( ded ).
This links the 7918 Script Spot to dummy model 7119. SPAWNDUMMY 7919 71197919 - Script Spot which can be whatever you like in the range of 7900 -7999, 6900-6999. 7119 - Dummy model ID number which was defined in the definition file ( ded ).
This links the 7919 Script Spot to dummy model 7119. ONDEATH 7910 { REPLACE 7910 7058 KILL 7918 0 1 PLAYSOUND BLOW 0 1 1> } ONDEATH 7911 { REPLACE 7911 7058 KILL 7919 0 1 PLAYSOUND BLOW 0 1 1 } When either 7910 or 7911 Script Spots are activated by gunfire ( line special 8067 ) a model replacement is made of the broken tube ( 7058 ), also the respective dummy model is activated providing the effects. The PLAYSOUND function provides the sound for the exploding energy tube.
Studying the definition file of this model ( 7057 ) will reveal how the repetitive energy sound is achieved by allocating a Doom sound ( DS ) to the 'See sound', in the case of the tubes - See sound = "boscub";
DOOM LINEDEF ACTIONS TRIGGERED BY LINEDEF SPOTS
Doom LineDef actions can also be triggered by model activation, this is achieved by setting certain flags in the appropriate LineDef Spots. In the above example three >LineDef Spots are used for different tasks.
Operating the switch ( 7901 ) .... 1) Replaces the security gate model with one that has a beeping keypad 2) Removes the blocking from linedef 326 ( this was used to provide the locked sound and text ). 3) Open a door ( sector 68 - tag 01 ) by using a 7701 LineDef Spot placed on linedef 322.
It is the third task which is of interest here, examining the LineDef Spot flags associated with both the script line trigger and the Doom line action indicate the following flags are used .....
HARD - used to activate a Doom linedef action
Other LineDef Spot flags are indicated in the R3D_ModelSwitch.txt
Special Notes: Because the 7701 switch trigger uses a 8064 line special, the Doom linedef action must not use either a S1 or SR action which are also USE triggers. This is to avoid conflicts between scripting triggers and normal Doom linedef actions, in the above example a W1 109 Door Open Stay ( fast ) action was used instead of the S1 103 Door Open Stay ( fast ) action.
MOVABLE BARRELS
Try moving the green barrels around by either pushing ( use key ) or shooting them.
This is simply done by defining a special Risen3D flag to the definition file of the barrel model ( 7108 ).
Flags2 = "mf2_pushthing";
Note: the blue barrels do not have this flag defined.
AMBIENT SOUND AND THE SNDINFO SCRIPT
Examining the SNDINFO script, more information can be obtained from the R3D_Ambient.txt
This is the script entry .... drip drip $AMBIENT 1 drip POINT 1.0 CONTINUOUS 0.4 Note: $AMBIENT 1 correlates to the THING 14001 placed in the map.
There are two distinct methods of applying ambient sounds in a Risen3D map. 1) Placing an ambient sound ( 14001 ) directly in the map, 2) Placing a trigger ambient sound ( 13901 ) on a linedef that has a line trigger special.
The example in the tutorial map uses a triggered ambient sound with a 8092 line special ( walkover ). Other triggers used for ambient sounds are 8090 ( use ) and 8091 ( impact )
Special Note: The ambient sound placed in the map is dormant until it's associated trigger is activated, in the case of the above example 14001 would use a trigger of 13901. |
||
risen3d.doom-afterburn.de | http://risen3d.drdteam.org/ |