-
Notifications
You must be signed in to change notification settings - Fork 0
Assignments
Assignments contain the following fields:
- A name
- A concise descriptor of the assignment
- A list of completion criteria
- A list of activation criteria, which can be used in place of a release time
- An assignment type (General, PlayerOnly, Timed, Emergency, Player Timed, Player Emergency)
- An assignment state (Inactive, Active, Completed, Failed)
- A release time, which can be used in place of activation criteria
- A due time, for timed assignments only
They also contain these fields primarily for delegation:
- The name of a required skill for that assignment
- The level of a required skill for that assignment
- The base time it takes an NPC to complete that assignment
Here's an example of a serialized assignment with all fields:
{
"Name": "Meetings, meetings!",
"Descriptor": "Head over to the conference room.",
"CompletionCriteria": [
{
"Type": "interact",
"Value": "MeetingRoomDoor",
"Fulfilled": false
}
],
"ActivationCriteria": [],
"Type": 0,
"State": 1,
"ReleaseTime": "00:00:00",
"DueTime": "00:00:00",
"RequiredSkillLevel": 0,
"RequiredSkillName": "",
"TimeToComplete": "00:00:00",
"IsTimed": false,
"Over": false,
"Completed": false,
"IsActive": true,
"CanDelegate": true
}The assignment system has a list of criteria which it checks for in order to determine completion or trigger its activation. Each criteria has an "action" (what the player has to do) and a "target" (what the player has to do that action to). Below is a list of every criteria action and what a valid target for that action would be:
| Action | Target |
|---|---|
| open_email | A subject line for an email that must be read. |
| interact | Name of a scene object that must be interacted with (anything that implements IInteractable or derived components). |
| complete_assignment | Name of an assignment which must be completed. |
| unlock_pc | None. Will always be the PC in the scene. |
| converse | Name of a character that needs to be spoken to (in-person). |
| make_call | Name of a character that needs to be called. |
| do_search | A search query that must be used in the PC search function. |
| view_screen_pc | Name of a PC screen that must be opened/viewed. |
| view_screen_phone | Name of a phone screen that must be opened/viewed. |
| delegate_assignment | Name of an assignment to be delegated. |
The idea behind the design of the current assignment system is that assignments operate mostly autonomously of other game systems. They will listen for their own criteria, activate and deactivate themselves when need be, etc. All that other systems will likely need to do is fetch their data.
However, there are situations when you want to manually do something to an assignment. There are several functions for this:
-
AssignmentManager.ActivateAssignmentor<<activate_assignment>> -
AssignmentManager.CompleteAssignmentor<<complete_assignment>> -
AssignmentManager.FailAssignmentor<<fail_assignment>>
There's also assignment delegation, but more info on that is below.
The player can delegate assignments to NPCs for them to complete, but there are some rules about this:
- The character must be able to accept delegations (this can be toggled on and off for certain characters)
- The current time must be within that character's working hours
- The assignment must not be a player-only assignment
If one of these criteria are not met, the delegation will fail outright. If all is good, the Character will calculate the completion speed modifier and apply it to the TimeToComplete for the assignment. Then the NPC will attempt to "work" on the assignment every game time step. Once the time to complete runs out, the assignment is considered completed.
However, there are a couple of caveats to this behavior. If the NPC does not have the skill level to complete the delegated assignment (i.e the modifier is 0), the NPC will attempt the assignment for half of the TimeToComplete before giving up. Additionally, if multiple assignments are delegated to one NPC, a time penalty will be applied to all current assignments. This penalty will stack as more assignments are delegated and will be removed as assignments are completed/undelegated.
(Is undelegating even a word? It is now!)
You can use Yarn commands such as <<delegate_assignment>>, <<undelegate_assignment>>, and <<toggle_delegation>> to manage assignments. Code counterparts to these include AssignmentManager.DelegateAssignment, AssignmentManager.UndelegateAssignment, and CharacterManager.ToggleCharacterDelegation.
- Any remaining active assignments at the end of a chapter will be automatically failed.