Prefab Comments: Difference between revisions
No edit summary |
|||
(49 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
With most prefabs, it is self-evident what they are but when submitting your own prefabs for use by others it is occasionally helpful, even essential, to add comments. | |||
(Note that you may need to extract provided Dark Mod prefabs first from the zip file darkmod/tdm_prefabs01.pk4 before they are visible to earlier versions of Dark Radiant.) | |||
With most prefabs, it is self-evident what they are but when submitting your own prefabs for use by others it is occasionally helpful, even essential, to add comments. | |||
You can include comments within the prefab. Add the following key/value pair to the worldspawn of the prefab... | |||
editor_description <your description> | |||
If the prefab does not contain any worldspawn then add a tiny brush and texture it nodraw. | |||
For more detailed comments, diagrams, images, etc., please add your comments to this article. | |||
When loading prefabs, depending on your editor version, you need to take care: | |||
# Check changed entity names against any bind, frob_peer, lock_peer used_by spawnargs etc. | |||
# If rotating, check the whole prefab has rotated and how. Model doors may be OK but brush doors you might find they now open the wrong way. | |||
# Add complex prefabs to groups (DR=layer) if your editor provides them to make it easier to move, rotate, retexture, etc. later. | |||
# Disable any filtering so you don't overlook, eg, caulk, nodraw textures. | |||
For general information about prefabs see [[Prefabs]] | |||
Line 21: | Line 42: | ||
Rooms, corridors - these should not be used exactly as they are. We don't want lots of mission lookalikes. Instead use them as a start point then adjust, resize, and retexture. Add new features, remove old ones. | Rooms, corridors - these should not be used exactly as they are. We don't want lots of mission lookalikes. Instead use them as a start point then adjust, resize, and retexture. Add new features, remove old ones. | ||
===Spiral | ===Steps & Stairs: Spiral=== | ||
These consist of a main module: | These consist of a main module: | ||
Line 38: | Line 59: | ||
''models\darkmod\architecture\stairs\'' | ''models\darkmod\architecture\stairs\'' | ||
===Stepladders=== | ===Steps & Stairs: Stepladders=== | ||
There are a rough and a smart version at... | |||
prefabs\architecture\steps,stairs\moveable_stairs | |||
These stepladders can be grabbed and moved around but you have to move in close to grab them from the side or back. This is deliberate as there was a problem: If you could frob them while standing on them you could lift yourself up and fly round like on an unstable jetpack. Unsure if that is fixed. It also 'feels' better to me if you are hugging them close (you wouldn't hold stepladders at arms length.) Alternatively you can push them. It's somewhat of a challenge if you knock them over but it is perfectly possible to lift them up and rotate them - just difficult to get your body out of the way. Once moved you can climb them like any other ladder. The smart version is ideal for places like libraries; the rough one for a workplace. Of course, you can retexture them how you like, or shorten one if you prefer. | |||
==Doors== | |||
===Manhole for sewer etc.=== | |||
'''doors/manhole_round_tiny_rusty.pfb'' is a general purpose sewer entrance. Note that the brush opening is lined with non-solids so the manhole seem a more narrow gap. | |||
''doors/manhole_round_tiny_rusty_windup.pfb'' is the same but with an internal rotary control. This means the manhole cannot be opened or closed from above so the player has to find another route inside but can escape through this route. An alternative is to use a normal locked version of the firt example above and let the player find it inside. | |||
This version might be modified as a pressure hatch in a chemical plant, underwater facility, submarine, etc. | |||
===Trapdoor with padlock=== | |||
''doors\trapdoor_wood_crude_padlocked.pfb'' includes a moveable hasp: The openable part of the padlock, plus two staples: one that is bound to the door, and one that you need to place on your frame/floor. | |||
The padlock can be relocked. If the trapdoor is open then it locks when next closed onto the padlock. Not entirely logical but the alternative would close it when closing the padlock. | |||
The padlock is not a moveable. | |||
Don't overlook the padlock key which is close by. | |||
==Furniture== | |||
===Container Furniture: Cabinets, Wardrobes, Shelf units, Desks=== | |||
There is a range of container furniture: cabinets, wardrobes, shelf units, desk, etc. with opening doors, drawers, working handles, etc. at prefabs\furniture\cabinets | |||
These have separate entities for doors, hinges, mid-shelves, side-shelves, and spindles for easy removal as wardrobe or open shelving. After rotating you should restore the door origins using vertex drag. You may find example model objects included need moving separately after a rotation. | |||
Most can be retextured and modified how you like to convert into a shelf unit or no shelves or whatever. Some are model furniture but with separate openable doors. | |||
[[Image:Cabinets27.jpg|600px|thumb|center]] | |||
<br> | |||
<br> | |||
==Mechanical== | |||
===Clocks=== | |||
There are 4 large plain grey clocks that keep real game-time. They are not very fancy but are meant to be put high on buildings where they cannot be reached. But the time-keeping methods can be applied to fancier clocks. | |||
Prefab: ''mechanical\clocks\clock_nostrike_big_plain_grey.pfb'' | |||
Prefab: ''mechanical\clocks\clock_nostrike_huge_plain_grey.pfb'' | |||
These are big and bigger clocks set at midnight by default and facing west. Works immediately with no script needed but nothing fancy, does not strike the hour, etc. but just shows the time. Includes a clock tick sound which can be deleted if too high on a building to hear. The clocks can be rotated to face any direction with no problem. And of course, you can rotate the hands to set the start time if you don't want midnight. Try 6 degree movements then finer if needed. | |||
Prefab: ''mechanical\clocks\clock_scriptevents_big_plain_grey.pfb'' | |||
Prefab: ''mechanical\clocks\clock_scriptevents_huge_plain_grey.pfb'' | |||
These require a script. One is provided that keeps time and rotates the clock hands, and optionally can trigger any entities at any selected time plus a script that strikes the hour. See [[Clock-Triggered Game Events]] for how to set it up. | |||
===Elevator=== | |||
At | Prefab: ''mechanical\elevators,hoists\elevator_3floors.pfb'' | ||
3-floor elevator prefab that can be reduced to 2-floor or increased without too much difficulty. Basically a brick tower its side walls are sectioned so can easily be resized to make doorways on any side and of course, retextured. Drop it in your map and it works immediately. Details for customising are at [[Elevators, multi-floor#Multi-floor elevator using custom Dark Mod entities]] | |||
===Machine sound system=== | |||
Prefab: ''mechanical\machine_sound_system.pfb'' | |||
With this prefab you can make a triggered sounds system with a start sound, a looping sound and a stop sound. More info in [[Start/Loop/Stop sounds]] | |||
===Switches and Levers=== | |||
These are just simple lever and switch combos ready to go. (A static backplate and a moveable lever). | |||
The rotation and translation are set for a wall mount, and may need adjusting if you mount them horizontally, or at an angle. | |||
===Steam Whistle Alarm=== | |||
TDM 1.03 release | |||
A steam whistle machine, with lever, particles and sound (to alert AI). | |||
===Printing Press=== | |||
TDM 1.03 release | |||
A working printing press with lever, gears and sound. | |||
==Miscellaneous== | |||
===Player drop start delay=== | |||
Many Dark Mod FMs will begin with the thief dropping down from a wall, etc. At game start there seems to be a tiny delay (0.25 seconds?) before the view is rendered so the player only sees the end of the drop, maybe none of it. | |||
'''misc\player_drop_start_delay.pfb'' provides a player start with a platform that is removed after 0.25 of a second. Reduce delay for lower heights. | |||
===StartPack: Common Objectives, Tools, Ammo=== | |||
misc/StartPackObjectives,Tools,Ammo.pfb contains common objectives, player tools and ammo all set up for the mapper. It is then far easier to edit or delete what you don't want rather than set them all up separately from scratch. | |||
Just insert into your map away from anywhere you are likely to build and immediately your mission has default working objectives and lantern, compass, etc in the player's inventory at start, and ammo you can edit. | |||
You MUST remember to delete the parts you don't want to avoid possible conflict. For example if you merge into a map where you already have objectives then delete the objectives entity. If you have a purchase shop set up then delete the Ammo_difficulty_settings in the prefab. | |||
Note that some entity names might change on insertion so check they match where they are named, eg in objectives. | |||
The prefab is a small room containing (note that the contents may be slightly updated/changed from shown here): | |||
'''Player Tools:''' | |||
compass, lantern, spyglass, all four lockpicks. All go in the inventory at start up. Edit/delete as required. | |||
'''Objectives:''' | |||
These are set up in a target_tdm_addobjectives entity. All you need to do is click on menu: Map > Objectives and you will see the common objectives already set up. Just edit or delete what you don't want or you can refer to what is there to make new ones. Change the text description to what you want. | |||
''Steal a special object'' - use this if your mission has a quest to get some special item like Lord Drastik's Sceptor of Death. Edit and change the entity name and the text description of course. | |||
''Trigger with any targetting entity'' is for a custom objective that is not covered by any other method. Any targetting entity can complete this objective. So ''Open the magic door for Bragbo'' - set the door to target the target_tdm_setobjectivestate named CompleteObjective in the prefab and set the objective number in that entity. It will complete the objective when the door opens. Any targetting entity like a lever etc will also do. | |||
''Get Loot'' there is one of these for each difficulty setting. Only one will be visible depending which difficulty is played. Just reword the text how you like and change the value of the loot needed how you like. | |||
''No Killing'' and ''No KOs'' these also are set for special difficulties. Adjust to taste, reword, or delete. | |||
''Go To Room X, eg, When all objectives done, return to start'' In this case you need to move the info_tdm_objective_location entity named StartingPoint from the prefab room to where you want the player to return to and enlarge it to cover the whole area where it is to trigger. You also need to edit the objective to include in its 'enabling objectives' all the other objectives that are NOT 'ongoing' (such as No KOs) This is because they must be completed before returning to the start. If any enabling objectives appear in several difficulties then look at how the loot enabling objectives were done in this prefab. It shows 1 and (2 or 3 or 4) which means Objective 1 MUST be done plus EITHER loot objective 2 or 3 or 4 (only one appears in each difficulty.) | |||
This 'GoTo' objective method can be used for any objective where you want the player to get to a special place, eg 'Find a way to get into the castle'. In which case you probably want to delete the 'Enabling Objectives' entry and rename the StartingPoint' entity (and in the objectives.) | |||
'''Start Ammo/Weapons:''' is set up in the atdm:difficulty_settings entity named Ammo_difficulty_settings in the prefab. (This might be done with a different type of entity at a later stage.) | |||
Select menu: Map>Difficulty. Click on atdm:player_base and you should see listed all the ammo/weapons set by default at 0 for all arrows and 1 for sword and blackjack. Change the value for each to what you want on all three difficulty tabs. | |||
==Nature== | |||
===Skyboxes=== | |||
Here is an explanation on how to use a [[skybox]] | |||
Prefab: ''nature\skyboxes\tdm_sky_starry1.pfb'' | |||
Prefab: ''nature\skyboxes\tdm_sky_starry2.pfb'' | |||
Prefab: ''nature\skyboxes\tdm_sky_storm_thunder.pfb'' | |||
The tdm_sky_storm_thunder.pfb contains a skybox with storm clouds and a simple thunder effect mechanism. See also [[Lightning]]. | |||
Line 48: | Line 227: | ||
{{tutorial-editing}} {{darkradiant}} | {{tutorial-editing}} {{darkradiant}} |
Latest revision as of 20:22, 7 May 2014
(Note that you may need to extract provided Dark Mod prefabs first from the zip file darkmod/tdm_prefabs01.pk4 before they are visible to earlier versions of Dark Radiant.)
With most prefabs, it is self-evident what they are but when submitting your own prefabs for use by others it is occasionally helpful, even essential, to add comments.
You can include comments within the prefab. Add the following key/value pair to the worldspawn of the prefab...
editor_description <your description>
If the prefab does not contain any worldspawn then add a tiny brush and texture it nodraw.
For more detailed comments, diagrams, images, etc., please add your comments to this article.
When loading prefabs, depending on your editor version, you need to take care:
- Check changed entity names against any bind, frob_peer, lock_peer used_by spawnargs etc.
- If rotating, check the whole prefab has rotated and how. Model doors may be OK but brush doors you might find they now open the wrong way.
- Add complex prefabs to groups (DR=layer) if your editor provides them to make it easier to move, rotate, retexture, etc. later.
- Disable any filtering so you don't overlook, eg, caulk, nodraw textures.
For general information about prefabs see Prefabs
Architecture
Fireplace/Chimney
Prefab : architecture\fireplaces\fireplace_humble_corner_double.pfb
- Can be retextured as a whole (ideally while still selected as a prefab)
- Place between between two walls where the caulk indicates or discard one side and use as single.
- Note multiple edge bevels and patches if cutting/reshaping.
- It is likely that some bevels will pass through into different visportal areas in your mission. This is likely to corrupt the texture rendering even though it looks fine in Dark Radiant. Solution: Clone offending bevel(s) and resize to fit either side of floor/ceiling etc. so each bevel is fully within one visportal area. See Patch texture rendering error.
Texture aligns all round except for...
- one small horizontal line at one side of one of the fireplaces - not too noticeable.
- Horizontal line where vertical chimney starts on two sides only. This will be next dividing wall on one side anyway so only affects one side and this will generally be lost in ceiling hopefully. Not severe.
Rooms, corridors
Rooms, corridors - these should not be used exactly as they are. We don't want lots of mission lookalikes. Instead use them as a start point then adjust, resize, and retexture. Add new features, remove old ones.
Steps & Stairs: Spiral
These consist of a main module:
(architecture\steps,stairs\spiral_stairs\stair_spiral_192_main.pfb)
which is stackable to any number of floors each 192 units high (add a few steps in a corridor if your floors are a little different) plus one top model:
(architecture\steps,stairs\spiral_stairs\stair_spiral_192_top.pfb)
At the time of writing, multiple patrolling AI might get stuck at the foot of the stair. This appears to be an AI intelligence issue rather than an actual obstacle. I found if I placed a path_corner at the foot of the stairs, directly opposite the bottom step and targetted from above (ie, its preceding path_corner that targets it being place on a floor above) then the AI were OK. I had three AI patrolling and passing one another on the stair for a long time without problems this way.
architecture\steps,stairs\spiral_stairs\bc_spiralstair_clip.pfb
...is for use as monster clip for AI pathfinding with various models in:
models\darkmod\architecture\stairs\
Steps & Stairs: Stepladders
There are a rough and a smart version at...
prefabs\architecture\steps,stairs\moveable_stairs
These stepladders can be grabbed and moved around but you have to move in close to grab them from the side or back. This is deliberate as there was a problem: If you could frob them while standing on them you could lift yourself up and fly round like on an unstable jetpack. Unsure if that is fixed. It also 'feels' better to me if you are hugging them close (you wouldn't hold stepladders at arms length.) Alternatively you can push them. It's somewhat of a challenge if you knock them over but it is perfectly possible to lift them up and rotate them - just difficult to get your body out of the way. Once moved you can climb them like any other ladder. The smart version is ideal for places like libraries; the rough one for a workplace. Of course, you can retexture them how you like, or shorten one if you prefer.
Doors
Manhole for sewer etc.
'doors/manhole_round_tiny_rusty.pfb is a general purpose sewer entrance. Note that the brush opening is lined with non-solids so the manhole seem a more narrow gap.
doors/manhole_round_tiny_rusty_windup.pfb is the same but with an internal rotary control. This means the manhole cannot be opened or closed from above so the player has to find another route inside but can escape through this route. An alternative is to use a normal locked version of the firt example above and let the player find it inside.
This version might be modified as a pressure hatch in a chemical plant, underwater facility, submarine, etc.
Trapdoor with padlock
doors\trapdoor_wood_crude_padlocked.pfb includes a moveable hasp: The openable part of the padlock, plus two staples: one that is bound to the door, and one that you need to place on your frame/floor.
The padlock can be relocked. If the trapdoor is open then it locks when next closed onto the padlock. Not entirely logical but the alternative would close it when closing the padlock.
The padlock is not a moveable.
Don't overlook the padlock key which is close by.
Furniture
Container Furniture: Cabinets, Wardrobes, Shelf units, Desks
There is a range of container furniture: cabinets, wardrobes, shelf units, desk, etc. with opening doors, drawers, working handles, etc. at prefabs\furniture\cabinets
These have separate entities for doors, hinges, mid-shelves, side-shelves, and spindles for easy removal as wardrobe or open shelving. After rotating you should restore the door origins using vertex drag. You may find example model objects included need moving separately after a rotation.
Most can be retextured and modified how you like to convert into a shelf unit or no shelves or whatever. Some are model furniture but with separate openable doors.
Mechanical
Clocks
There are 4 large plain grey clocks that keep real game-time. They are not very fancy but are meant to be put high on buildings where they cannot be reached. But the time-keeping methods can be applied to fancier clocks.
Prefab: mechanical\clocks\clock_nostrike_big_plain_grey.pfb
Prefab: mechanical\clocks\clock_nostrike_huge_plain_grey.pfb
These are big and bigger clocks set at midnight by default and facing west. Works immediately with no script needed but nothing fancy, does not strike the hour, etc. but just shows the time. Includes a clock tick sound which can be deleted if too high on a building to hear. The clocks can be rotated to face any direction with no problem. And of course, you can rotate the hands to set the start time if you don't want midnight. Try 6 degree movements then finer if needed.
Prefab: mechanical\clocks\clock_scriptevents_big_plain_grey.pfb
Prefab: mechanical\clocks\clock_scriptevents_huge_plain_grey.pfb
These require a script. One is provided that keeps time and rotates the clock hands, and optionally can trigger any entities at any selected time plus a script that strikes the hour. See Clock-Triggered Game Events for how to set it up.
Elevator
Prefab: mechanical\elevators,hoists\elevator_3floors.pfb
3-floor elevator prefab that can be reduced to 2-floor or increased without too much difficulty. Basically a brick tower its side walls are sectioned so can easily be resized to make doorways on any side and of course, retextured. Drop it in your map and it works immediately. Details for customising are at Elevators, multi-floor#Multi-floor elevator using custom Dark Mod entities
Machine sound system
Prefab: mechanical\machine_sound_system.pfb
With this prefab you can make a triggered sounds system with a start sound, a looping sound and a stop sound. More info in Start/Loop/Stop sounds
Switches and Levers
These are just simple lever and switch combos ready to go. (A static backplate and a moveable lever).
The rotation and translation are set for a wall mount, and may need adjusting if you mount them horizontally, or at an angle.
Steam Whistle Alarm
TDM 1.03 release
A steam whistle machine, with lever, particles and sound (to alert AI).
Printing Press
TDM 1.03 release
A working printing press with lever, gears and sound.
Miscellaneous
Player drop start delay
Many Dark Mod FMs will begin with the thief dropping down from a wall, etc. At game start there seems to be a tiny delay (0.25 seconds?) before the view is rendered so the player only sees the end of the drop, maybe none of it.
'misc\player_drop_start_delay.pfb provides a player start with a platform that is removed after 0.25 of a second. Reduce delay for lower heights.
StartPack: Common Objectives, Tools, Ammo
misc/StartPackObjectives,Tools,Ammo.pfb contains common objectives, player tools and ammo all set up for the mapper. It is then far easier to edit or delete what you don't want rather than set them all up separately from scratch.
Just insert into your map away from anywhere you are likely to build and immediately your mission has default working objectives and lantern, compass, etc in the player's inventory at start, and ammo you can edit.
You MUST remember to delete the parts you don't want to avoid possible conflict. For example if you merge into a map where you already have objectives then delete the objectives entity. If you have a purchase shop set up then delete the Ammo_difficulty_settings in the prefab.
Note that some entity names might change on insertion so check they match where they are named, eg in objectives.
The prefab is a small room containing (note that the contents may be slightly updated/changed from shown here):
Player Tools: compass, lantern, spyglass, all four lockpicks. All go in the inventory at start up. Edit/delete as required.
Objectives: These are set up in a target_tdm_addobjectives entity. All you need to do is click on menu: Map > Objectives and you will see the common objectives already set up. Just edit or delete what you don't want or you can refer to what is there to make new ones. Change the text description to what you want.
Steal a special object - use this if your mission has a quest to get some special item like Lord Drastik's Sceptor of Death. Edit and change the entity name and the text description of course.
Trigger with any targetting entity is for a custom objective that is not covered by any other method. Any targetting entity can complete this objective. So Open the magic door for Bragbo - set the door to target the target_tdm_setobjectivestate named CompleteObjective in the prefab and set the objective number in that entity. It will complete the objective when the door opens. Any targetting entity like a lever etc will also do.
Get Loot there is one of these for each difficulty setting. Only one will be visible depending which difficulty is played. Just reword the text how you like and change the value of the loot needed how you like.
No Killing and No KOs these also are set for special difficulties. Adjust to taste, reword, or delete.
Go To Room X, eg, When all objectives done, return to start In this case you need to move the info_tdm_objective_location entity named StartingPoint from the prefab room to where you want the player to return to and enlarge it to cover the whole area where it is to trigger. You also need to edit the objective to include in its 'enabling objectives' all the other objectives that are NOT 'ongoing' (such as No KOs) This is because they must be completed before returning to the start. If any enabling objectives appear in several difficulties then look at how the loot enabling objectives were done in this prefab. It shows 1 and (2 or 3 or 4) which means Objective 1 MUST be done plus EITHER loot objective 2 or 3 or 4 (only one appears in each difficulty.)
This 'GoTo' objective method can be used for any objective where you want the player to get to a special place, eg 'Find a way to get into the castle'. In which case you probably want to delete the 'Enabling Objectives' entry and rename the StartingPoint' entity (and in the objectives.)
Start Ammo/Weapons: is set up in the atdm:difficulty_settings entity named Ammo_difficulty_settings in the prefab. (This might be done with a different type of entity at a later stage.)
Select menu: Map>Difficulty. Click on atdm:player_base and you should see listed all the ammo/weapons set by default at 0 for all arrows and 1 for sword and blackjack. Change the value for each to what you want on all three difficulty tabs.
Nature
Skyboxes
Here is an explanation on how to use a skybox
Prefab: nature\skyboxes\tdm_sky_starry1.pfb
Prefab: nature\skyboxes\tdm_sky_starry2.pfb
Prefab: nature\skyboxes\tdm_sky_storm_thunder.pfb
The tdm_sky_storm_thunder.pfb contains a skybox with storm clouds and a simple thunder effect mechanism. See also Lightning.
Readables
There is an extensive selection of readable books, scroll, sheets, etc. For details see Readables Prefabs