NPC Hidden Treasure Blueprint [Treasure Hunt - Build Jam]

[Note: I didn’t realise I needed to post to the forum for a Blueprint so I’m posting this after the deadline]

Here is what I posted on itch.io before the deadline - here

Search for: NPCHiddenTreasureBlueprint by IorekByrnison

Treasure Hunt with NPCs -

  • Treasure Controller - a locator object that has a script with properties that allow you to set items such as the sound the magical objects in the environment make, the effect they have running, the sounds that appear when you interact etc.

  • Most importantly the Treasure Controller indicates which item is the Treasure

  • Hidden Treasure Package - this package contains:

+a magical Object which you can adjust to suit your environment

+a treasure chest which will only be shown if the item is hiding the treasure

+an NPC that will point to the real treasure if not behind this object

Following is additional information that may be useful to anyone wanting to use the blueprint but was not submitted before the deadline:

Aim of the blueprint: Allow you to create a game environment where some objects (meshes) within the environment are ‘magical’ and may or may not contain hidden treasure. The treasure can will only be hidden behind one of the objects (per group of objects).

Mechanics: If you interact (‘E’ on keyboard) with a magical object which can be spotted because it has an effect on it (default: magical sparks) then either a treasure object (default:chest) or an NPC (default:NPC 01 character) emoting (default: pointing) in the direction of where the treasure will appear.

Sound: Magical objects can make a custom sound (default: humming noise). When you interact with a magical object, a custom sound will also play (default for no treasure: explosion, default for treasure: adventure music)

Custom properties you may want to set:
Treasure Controller [one per group of magical objects]

  • Treasure Entity: Drag and drop a magical object to set which on hides the treasure
  • Magical Effect / Sound: Effect and Sound that emit from all magical objects
  • Treasure Effect / Sound: Effect and Sound asset that play when interacting with a magical object indicated by TreasureEntity property
  • Disappear Effect / Sound: Effect and Sound asset that play when interacting with a magical object with no treasure
  • Clues 01-03 [For future feature - not implemented yet / in time for Jam]

Hidden Treasure Package

  • Treasure Controller: Drag and drop the Treasure Controller locator you wish this magical object to be grouped with

Magical Object (Mesh)

  • [redundant] Treasure Controller: Drag and drop the Treasure Controller locator you wish this magical object to be grouped with
  • NPC Treasure Guide: Points to the appropriate TreasureGuide NPC entity. Drag the associated Treasure Guide entity into this box.
  • Treasure Chest: Contains a reference to the appropriate Treasure Chest entity.
  • NPC Emote: EmoteAsset that indicates what Emote the NPC should do when they appear (default: pointing)

NPC

  • NPC Emote: sets the Emote the NPC will play when the appear (default:pointing)

Known Issues:

  • Not checking for nils will cause issues if property fields left empty
  • PlayEmote is called by the MagicalObject and by the NPC
  • Code needs more comments
  • Clues mechanism is not implemented even though properties are there

Intended / envisaged use:

  • Create an environment and adjust magical object meshes so they blend in with the environment.
  • Spread the magical objects out wide enough so it is not obvious where the NPC is pointing
  • Add scoring / countdown mechanism so that the treasure has to be found in a certain time
  • Put the player furthest from the treasure so they are less likely to find that first

Possible ways to extend:

  • You could then set up an appropriate ‘on interact’ call to do something with the treasure (collect it, open it, restart the hunt).
  • You could implement the clues so that an NPC gives one of the clues from the list contained in the controller properties.
  • You could have multiple groups of magical objects with one treasure in each group.
2 Likes

This is nice! hahaha i jumped about 40 feet in the air on the Npc surprise! :rofl: I love that the NPC directs us to the next treasure! and the Chest looked super magical! I think is great fun to get the npcs actively involved in our games and 100 a clever helper along the treasure hunting journey! the bushes glimmering is pretty awesome use of that vfx :sparkles: I could think of a million ways to implement in my games! Absolutely going to add this to Pirates and Charming Forge! :boom: :rofl:

1 Like

Thanks so much @Nya_Alchemi - the feedback really means loads to me. I didn’t have a lot of time and coding skills very rusty but was fun thinking of an idea with my son. He’s a big [other platform :laughing: ] fan so is good at thinking of mini-games. Love to see what you end up doing with it :+1: do share.

other place :wink: builders/players can be absolute wizards!
Giving some of the best feedback and insight to player expectations. Variety in experience keeps a platform from a shared brain vibe!
Love to hear when other families & friends collaborate together in Crayta! :sparkles:

1 Like

Thanks again. I’ve edited out the R___x word - don’t want to upset the mods :upside_down_face: