Whoops, there was a bit of a mistake in the previous version where OnHotspotReach was not scoped correctly:
void Start() { this.hotspot = GetComponent<Hotspot>(); // ... EventManager.OnHotspotReach += OnSomeHotspot…
OK, in hopes that this helps someone, here is a simple working of my MonoBehaviour that individual Hotspot2D instances will extend and override:
using AC;using System.Collections.Generic;using UnityEngine;#nullable enablepublic class CTFHotspot : M…
Based on https://adventurecreator.org/forum/discussion/15511/doing-text-based-development-using-ac-as-the-engine-more-like-scumm/, I think the reason OnHotspotReach wasn't firing is because playerAction = PlayerAction.WalkToMarker also needs to be s…
Ah, apparently I didn't need ActionCharPathFind, but playerAction = PlayerAction.WalkToMarker:
Interaction actionList2 = gameObject.AddComponent<Interaction>();ActionSpeech speechAction2 = ActionSpeech.CreateNew_Player("I can't use that.…
Hmm, though when I define the actions for the Use verb like this:
Interaction actionList2 = gameObject.AddComponent<Interaction>();ActionSpeech speechAction2 = ActionSpeech.CreateNew_Player("I can't use that.");Debug.LogError("…
Ah, I see Interaction is a subclass of ActionList and this works:
Interaction actionList = gameObject.AddComponent<Interaction>();ActionSpeech speechAction = ActionSpeech.CreateNew_Player("I can't go downstairs yet.");actionList.act…
For example, I tried:
ActionList actionList = gameObject.AddComponent<ActionList>();ActionSpeech speechAction = ActionSpeech.CreateNew_Player("I can't go downstairs yet.");actionList.actions.Add(speechAction);Button button = new But…
After deleting all of that stuff manually from the .unity file, the interaction is now permanently gone in the GUI and my player character actually walks to the hotspot when clicked again.
Digging into the .unity file, I see all this stuff, which does not seem right:
- target: {fileID: 3949819525447857897, guid: 14fb7f92158b71e48b5c041a45d5f2df, type: 3} propertyPath: provideUseInteraction value: 1 objectReference:…
Taking a step backwards, how does a hotspot have to be configured such that OnHotspotReach is triggered? That is, does the Hotspot have to have a Walk-to Marker associated with it? And does arriving at that marker trigger OnHotspotReach? That is wha…
I'm trying to give you a minimal repro for my issue with OnHotspotReach. I feel like the easiest thing to do would be to make a modification to the demo game, but I don't know how to iterate on it quickly: every time I press the Play button for the …
@ChrisIceBox sorry for the slow reply!
I don't see something named Face after moving?, but I assume you are asking whether I can perform these two steps through the GUI:
* add an interaction for Hotspot2D by hitting the plus button (for Use intera…
With help from ChatGPT, this seems to work, though that < 0.1f is a bit dissatisfying.
using AC;using UnityEngine;public class MyCustomHotspot2D: MonoBehaviour{ private Hotspot hotspot; private Marker markerForHotspot; void Start() {…