Skip to content

How do I...?

Jack Burkhardt edited this page Sep 16, 2022 · 10 revisions

This page is intended to answer some common questions someone may have while working on this project. Tip: Looking at examples content that is already there can help you understand how they are structured and provide a reference for you to work off of!

Note: All of this is based on the current structure of the game. If parts of the game design or technical design change, the information here may no longer be correct. Don't let all this documentation prevent you from changing how things work -- if there's a better way than how I did it, feel free to do it!

How do I add audio to the game?

See Audio System.

How do I add assignments to the game?

See Assignments.

How do I change/add UI for the phone or PC?

As mentioned in the code overview, most parts of the Phone/PC and their apps have one script for the backend system and another for the front end. The front end script is typically a component attached to the prefab for the UI. You are more than welcome to edit the prefabs and scripts for UI, and if you want to do something completely different then you can write totally different code and make new prefabs.

How to I add interactable objects to the scene, like things players can click on?

Add a GameObject to the world canvas for a room (whatever contains your background and other objects in the world space). Give it an Image component and a Simple Tooltip component, if desired. Move that object around the canvas to wherever you want it to be in the world space. Then add one of the following interactable components:

  • SwitchRoom (switches to another room in a scene)
  • Inspectable (shows the internal thoughts of the main character)
  • PopupItem (creates an on-screen popup for viewing things like images or documents)
  • PCScreen (intended to be used for only the PC)
  • Character (a character that can be interacted with)

How do I add flavor text for interactable objects?

To add flavor text/internal dialogue first follow the above instructions to add interactable objects to the scene. Then make a new Yarn node with the same name as the interactable object and add the dialogue you want to appear. You can put all Yarn nodes for all interactable objects in one script or several, so long as they are in the same project so the dialogue runner can find it.

How do I edit/add more dialogue views?

Yarn uses Dialogue Views to present dialogue to the player. This UI presents text, names, and dialogue options. Feel free to modify the default one currently in use or copy and edit it to have multiple views. Check out this guide for more details on making custom views.

How do I add more "rooms" for the player to move between?

First check out the Scene structure. Under Rooms, add a new GameObject with a Canvas and set it to be in World Space. You can then add images to the scene which will represent different parts of that room's space like a background, objects, etc. Make sure the room GameObjects are not on top of one another, or else the game will show multiple rooms at once. You can use SwitchRoom objects to let the player move between rooms.

How do I create popups for objects?

You can make a copy of the PopUp prefab and replace the image in the image view content with whatever image you want. You can also replace the text in the text view with a description of the image. Then make a PopupItem object in the world (details on that above) and add the popups you want to appear to the Popup Item component.

How do I create new criteria options for assignments?

Remember that assignment criteria consist of an action and a target for that action. Make sure whatever action you want to use has a GameEvent for when it is triggered. Then go into Assignments.cs and add an event handler which will call UpdateCriteria when that action is triggered and provides both the action and whatever target/value you want from the event. For examples of this, see the "OnAssignmentDelegate" and other similar functions in Assignments.cs. Then in the ToggleListeners function, add a subscriber and unsubscriber for that event. Again, seeing the examples already there will probably make this much easier to understand.

Clone this wiki locally