Creating a Dungeon: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 17: | Line 17: | ||
# Use the lists below the editor to find a mesh to add (entry starting with [M]). Double click it to add the mesh. | # Use the lists below the editor to find a mesh to add (entry starting with [M]). Double click it to add the mesh. | ||
# With a mesh selected you can shift+drag to clone. Ctrl+z will undo the last position of your selected object. | # With a mesh selected you can shift+drag to clone. Ctrl+z will undo the last position of your selected object. | ||
# Use W E R to switch between manipulation modes. | # Use W E R to switch between manipulation modes. You can use F to drop something to ground. | ||
# For ambiance you can look through https://dev.fetishquest.com/media/audio/ambiance/ | # For ambiance you can look through https://dev.fetishquest.com/media/audio/ambiance/ | ||
Line 53: | Line 53: | ||
== Creating Levers == | == Creating Levers == | ||
Levers use a system called dungeon vars or dVars for short. You can see vars in the dungeon editor. This is a JSON object which letsy ou set default values, such as {"lever":0}. However, these can be created on the fly by using dVar game actions. | |||
=== One lever by template === | |||
If you only want to create one lever in a dungeon, you can use existing templates. This automatically creates and updates a dvar called "lever". | |||
# Add a lever to your scene: Dungeon > Door > [M] WallLever. If you want to put it on the floor, you can rotate it. | |||
# Double click the lever and click library on game actions. | |||
# Search for lever and pick genericDungeonLever | |||
# Go to the door and find the door you want to be locked | |||
# You cannot not use the quick door selection with a locked door. Instead, click Unique on Game Actions. | |||
# Set the GameAction type to door, then select the room. In conditions, add from library and select dungeonLeverGeneric. | |||
# Done! The lever will now toggle the "lever" dVar automatically when you use it, and the door will be unlocked when the dVar is set to 1. | |||
=== Multiple levers === | |||
# (Optional) For simplicity, I suggest you add your custom levers in the vars JSON object in the dungeon editor. Ex if you want a lever that opens a basement door and an attic door. You could set it to {"lever_basement":0, "lever_attic":0}. We'll assume you've set it as such going forward. | |||
# After adding the lever (Dungeon > Door [M] WallLever), edit it and either create a unique game action, or a new library game action. For the sake of the tutorial I'll create one and level it "lever_basement". | |||
# Set type to lever, and ID to "lever_basement" | |||
# When you use the lever, it'll automatically toggle the value of the "lever_basement" dvar in the active dungeon. | |||
# Edit the locked and create a unique GameAction. | |||
# Set the type to door, the room to the room to go to, and in condition create a unique condition or from library. I'll click Library and create a new one from there. | |||
# I'll set the condition label to lever_basement, and description "Checks if lever_basement dvar is 1 in active dungeon." | |||
# Set the type to dungeonVar. Leave the dungeon blank to check the active dungeon's dVars (though you can specify a dungeon if you want to check if a lever is pulled in a specific dungeon). | |||
# Set the dvar to lever_basement, and the value to 1 (since the lever type game action toggles between 0 and 1). | |||
# If you want to add one for the attic, repeat the steps but use lever_attic instead of lever_basement. | |||
Note: If the door to be unlocked is in the same room: Edit the lever mesh. In game actions under your lever game action, add refresh_meshes, since door states are generally only updated when entering the room. |
Revision as of 22:50, 15 September 2023
Create the Dungeon Asset
- Click the dungeon button on the left to bring up a listing.
- Click new.
- Give your dungeon a UNIQUE label. WARNING: DO NOT CHANGE A LABEL AFTER SETTING IT.
- Click the question mark in the window header for more information on the dungeon fields.
- Free roam is great for non-linear dungeons and outdoor areas such as forests and towns, since it disables the automatic exit marker.
- Scroll down and view the room editor. Use the dropdown menu on the top right to change floor.
- Click the entrance tile to enter the room editor of the first cell (room).
Editing a Room
Basics
- The first thing you might want to do is check whether the cell is outdoors or indoors. Outdoors will enable outdoor lighting and also rain effects.
- Next go through the list of room meshes to create the main room layout. You can rotate it by using room asset rotation in whole degrees.
- Use the lists below the editor to find a mesh to add (entry starting with [M]). Double click it to add the mesh.
- With a mesh selected you can shift+drag to clone. Ctrl+z will undo the last position of your selected object.
- Use W E R to switch between manipulation modes. You can use F to drop something to ground.
- For ambiance you can look through https://dev.fetishquest.com/media/audio/ambiance/
Adding Treasures & Pickups
- You can find containers under Generic > Containers. Let's start by adding [M] ChestInteractive
- Double click the chest to bring up the mesh properties.
- You can set a respawn value in in-game seconds if you want it to respawn.
- Under Game Actions click library and search for autoloot. Autoloot is the recommended way to add random loot to chests. Higher quality gives better items.
- Next add [M] LootBag and double click to bring up its properties.
- Check "Hide if non-interactive" to make it go away when fully looted. You can create a loot action by going clicking Library and New (recommended if you want to use this set of items in multiple containers), or click Unique if you intend for very specific items to be looted and only in this bag.
- Under type select "loot". Enter a min and a max amount of items to give. Then click library and select what items should be contained.
- Some containers such as Nature > Containers > [M] RazzyBerries have preset loot game actions you can use. Select library and then search for loot_razzyberries, and you can use that on all your razzyberry containers.
- If you intend for there to be NPCs, you'll want to add player markers for each NPC. I recommend 4-6 markers. You can find markers in Generic > Marker > [M] Player
- To tie a marker to a specific NPC, double click the marker and set its name to the label of the NPC you want to show up there. Note that you also have to add said player to the encounter.
- Click library on Encounters and select an encounter to start once a player reaches that cell. If you add multiple encounters, it will pick the first viable encounter
Adding additional rooms
- Go back to the dungeon editor and click a direction to add a room in that direction. Note that dungeons function on a grid and you can't have two rooms on the same spot. This is for the procedural dungeon generator to work, and for dungeons to show the exit indicator on doors. You have the cardinal directions and up/down.
- When connecting a room this way, it'll copy the ambiance/outdoors/room mesh/ambient light settings of the tile you went from.
Connecting rooms
- Edit one of the rooms and add a door (many asset groups have a door category) or a direction marker (Generic > Shapes > [M] DirArrow).
- The easiest way is to add a quick door from the quick door dropdown.
- If you want to lock the door until certain conditions are met, create a new GameAction of type "door". Then select the room, and add conditions.
- Doors are often colored red until you set them up with a game action.
- Doors will automatically be named based on the cardinal direction of the cell you're connecting to. But you can override that by changing the mesh's name.
Connecting Dungeons
- Edit your door or direction mesh and create a new unique GameAction. Set the type to "exit", select the dungeon you want to go to, and the room. You can also set a travel time in seconds, which is mostly useful when connecting outdoor areas.
- If you want to connect official content to your modded areas, you can create an extension by opening an existing dungeon, then adding a mesh the usual way and connecting it. Hijacking an existing door mesh from the official mod is not recommended, even if it's not currently used.
Creating Levers
Levers use a system called dungeon vars or dVars for short. You can see vars in the dungeon editor. This is a JSON object which letsy ou set default values, such as {"lever":0}. However, these can be created on the fly by using dVar game actions.
One lever by template
If you only want to create one lever in a dungeon, you can use existing templates. This automatically creates and updates a dvar called "lever".
- Add a lever to your scene: Dungeon > Door > [M] WallLever. If you want to put it on the floor, you can rotate it.
- Double click the lever and click library on game actions.
- Search for lever and pick genericDungeonLever
- Go to the door and find the door you want to be locked
- You cannot not use the quick door selection with a locked door. Instead, click Unique on Game Actions.
- Set the GameAction type to door, then select the room. In conditions, add from library and select dungeonLeverGeneric.
- Done! The lever will now toggle the "lever" dVar automatically when you use it, and the door will be unlocked when the dVar is set to 1.
Multiple levers
- (Optional) For simplicity, I suggest you add your custom levers in the vars JSON object in the dungeon editor. Ex if you want a lever that opens a basement door and an attic door. You could set it to {"lever_basement":0, "lever_attic":0}. We'll assume you've set it as such going forward.
- After adding the lever (Dungeon > Door [M] WallLever), edit it and either create a unique game action, or a new library game action. For the sake of the tutorial I'll create one and level it "lever_basement".
- Set type to lever, and ID to "lever_basement"
- When you use the lever, it'll automatically toggle the value of the "lever_basement" dvar in the active dungeon.
- Edit the locked and create a unique GameAction.
- Set the type to door, the room to the room to go to, and in condition create a unique condition or from library. I'll click Library and create a new one from there.
- I'll set the condition label to lever_basement, and description "Checks if lever_basement dvar is 1 in active dungeon."
- Set the type to dungeonVar. Leave the dungeon blank to check the active dungeon's dVars (though you can specify a dungeon if you want to check if a lever is pulled in a specific dungeon).
- Set the dvar to lever_basement, and the value to 1 (since the lever type game action toggles between 0 and 1).
- If you want to add one for the attic, repeat the steps but use lever_attic instead of lever_basement.
Note: If the door to be unlocked is in the same room: Edit the lever mesh. In game actions under your lever game action, add refresh_meshes, since door states are generally only updated when entering the room.