Show / Hide Table of Contents

Walkthrough: Creating A Simple Scripted Proposal

To create a proposal, open up the game project in Unity.

  1. In the "Project" window, right-click on the window, then navigate to and select Create → ScriptableObject → Proposal.

Creating a Proposal

Note

The .asset file created from this action can be placed anywhere in the "Assets" folder, although proper file organisation is recommended.

  1. Select the proposal in the "Project" window. The inspector should show the newly created Proposal.

Selecting the Proposal in the Project Window Selected Proposal in the Inspector Window

  1. Attached the desired NPC character (defined by a ProposerInfo asset)

Selecting the ProposerInfo

Tip

Alternatively create your own NPC by creating a new ProposerInfo asset by right-clicking on the project window, then selecting Create → ScriptableObject → Proposer.

See article on the ProposerInfo ScriptableObject for details.

  1. Under the Proposer Behaviour field, select GDA.ProposerBehaviours.ScriptedProposerBehaviour

Selecting the Proposer Behaviour

  1. Under the Scripted Conversations field, add conversation assets with the appropriate keys/name. You can use the image below for reference.

Selecting the Proposer Behaviour

Tip

You can create your own conversation assets by right-clicking on the project window, then selecting Create → ScriptableObject → Conversation.

See article on the Conversation ScriptableObject for details.

Note

For how to use the correct keys to work properly with different ProposerBehaviours, see article on the current ProposerBehaviours for details.

  1. Create a new Product by right-clicking on the project window, then selecting Create → Product → Mask.

Creating a new Product Asset

  1. Select the new mask product, and attach a product generator the Product Generator field.

Attaching a Product Generator

  1. The product should now be generated. In order to generate the product with different specifications, hit the generate Button.

The Generate Button

Tip

Details for Products can be filled in manually, but it is much easier to generate the details with a ProductGenerator first, then editing the details afterwards.

  1. Repeat steps 6-8 to create another Product asset.

  2. Attach the newly created products to the proposal.

Attaching a Product to a Proposal

Tip

You can attach the product by clicking on the circle then selecting the product, or by click-and-dragging the product from the "Project" window into the slot.

  1. Create a new UserGroup by right-clicking on the project window, then selecting Create → ScriptableObjects → UserGroup.

Creating a new UserGroup Asset

  1. Select the new usergroup, and attach a UserArchetype to the User Archetype field.

Attaching a UserArchetype

  1. Choose the desired Size Magnitude, then click on the Regenerate Asset button to populate the details of the user group.

The "Regenerate Asset" button

Tip

Details for UserGroups can be filled in manually, but it is much easier to generate the details with a ProductGenerator first, then editing the details afterwards.

  1. Attach the newly created usergroup to the proposal.

Attaching a UserGroup to a Proposal

  1. The remaining fields State Change A/B, News A/B can be left blank. To learn how to use them, see articles on the Proposal and NewsItem ScriptableObjects respectively.

Including the Proposal in the Game

Now that we have a Proposal, we need to include it into the actual game.

  1. Select a ProposalSequence asset in the "Project" window, or create a new one.
Tip

You can create your own ProposalSequence assets by right-clicking on the project window, then selecting Create → ScriptableObject → ProposalSequence.

See article on the Conversation ProposalSequence for details.

  1. Click the "+" button to add a slot.

Adding a new slot to a ProposalSequence

  1. Expand the new slot.

Expanding the new slot created

  1. Ensure Is Generated is unchecked and attach the Proposal to the Predefined Proposal field

Attaching the Proposal

  1. Select the GamePlayManager in the scene hierarchy.

GamePlayManager in the scene hierarchy

  1. Ensure the relevant ProposalSequence is in the Campaign Sequence field.
    If it is not, then click on the "+" button to add a slot, then add the ProposalSequence to the new slot.

ProposalSequence in the Campaign Sequence

In This Article
Back to top Generated by DocFX