Implementing NGH in Unity and Adventure Creator

Follow these step-by-step instructions to have in-game hints in your Adventure Creator game

First, install Adventure Creator following its instructions.

Instructions on using this package

  1. Install the package com.nicegamehints.unity.ac through the Package Manager
  2. Create an empty GameObject that will control the hints, name it "NGHHintController".
  3. Attach the NGHMenu component to the GameObject
  4. Select the Mode from the NGHMenu Inspector
  • "Adventure Creator Menu" uses the menus from the AC Menu manager, supports also prefab menus
  • "Adventure Creator Generic" lets you create custom UnityEngine.UI based menus that do not use Adventure Creator menu manager
  1. Adjust the script execution order
  2. Go to Edit > Project Settings > Script Execution Order
  3. Add NGHMenu to the list and load it before Default time

Instructions on using the Adventure Creator Menu mode

In-game hints need two menu views: Guides view and Hints view.

In the Guides view are listed all the active guides at the moment. The user can click one of the guides to see hints regarding that guide. In the Hints view the selected guide is shown as a series of gradual hints. There should be a "Next hint" button to navigate to the next hint in the guide.

First, Attach the AC Menu Manager to the NGHMenu component. AC Menu Manager attached to the NGHMEnu component

The Guides view

  1. Create a prefab menu Canvas. Name it "GuidesMenu". The Canvas should include at least the following UI items:
  • Another Canvas that has a Vertical Layout Group component
  • Inside that Canvas, a Button. This button will be the sample button that will be cloned when listing the active guides. Prefab Guide Menu with the vertical layout group
  1. Create a menu in AC Menu manager. Name it "NGHGuides" and select "Unity Ui Prefab" as the source
  2. Add a button named GuideButton inside the NGHGuides menu.
  • Click type is "Crossfade"
  • Menu to switch to: "NGHHints" (this will be created next)
  1. Attach the prefab to the NGHGuides menu
  2. Drag the GuidesMenu prefab from Assets to Linked Canvas prefab
  3. Drag the button from the prefab to GuideButton Linked button Guides Menu in AC Menu Manager

You should be now able to see the menu in the game. You still need to show the menu somehow. The easiest (for testing) is to have it "Enabled on start".

The Hints view

  1. Create a prefab Canvas. Name it "HintsMenu". The Canvas should include at least following UI items:
  • A text (legacy) element (as of Adventure Creator 1.79.2 you cannot link TMP text to a Menu Label?) that will show the text content of the hint.
  • A button (no need to be legacy) that will show the user the next hint. Will be automatically hidden when there are no more hints.
  • Optional: A text (legacy) showing the current guide title
  • Optional: A RawImage showing an image if the current hint has one
  1. Create a menu in AC Menu Manager. Name it "NGHHints" and select "Unity Ui Prefab" as the source
  2. Add a label named "HintContentText" inside the NGHHints menu
  3. Add a button named "NextHintButton" inside the NGHHints menu
  • On Click type select Custom Script
  1. Attach the prefab to the NGHGuides menu
  2. Drag the HintsMenu prefab from Assets to Linked Canvas prefab
  3. Drag the text from the prefab to HintContentText Linked Text
  4. Drag the button from the prefab to the NextHintButton Linked button
  5. Optional: Add a label named "GuideTitle" inside the NGHHints menu
  • Drag the corresponding text from the prefab to the Linked Text
  1. Optional: Add a graphic named "HintContentImage" inside the NGHHints menu
  • Select UI image type to "Raw Image"
  • Drag the corresponding raw image from the prefab to the Linked Raw Image Hints Menu in AC Menu Manager

You should be now able to click the guide button (set is visible in AC Menu Manager) in the Guides view and it should show you the HintsMenu prefab with default values.

You might want to implement close buttons to each menu but that is outside the scope of this guide.

Attaching the actual hints to the NGHMenu

  1. Create a folder named "ngh" inside Assets
  2. Create a new file named "sample.md" inside the ngh folder
  3. Add following content inside the sample.md file
---
title: A sample guide
---

#
This is the first hint

#
This is the second hint
  1. In NGHMenu component, fill the Hints path with "Assets/ngh/"

If you now open the Guides view, you should see a button with text "A sample guide". You might also see the default guide. You can set it non visible in the AC Menu Manager. When you click the "A sample guide" button you should see the Hints view. It will show you text "This is the first hint". When you click the next hint button you should see text "This is the second hint" and the next hint button becomes invisible.