// QuestGiver.cs // Click this object (a character, a sign, a notice board) to be offered a quest. Set the quest up in the Scene Editor // (Windows -> Quests) with "How players get it: A script offers it", then type its title in Quest. // Optional: a Marker object (a "!" above the character) that only players who can still take the quest see. using IHXR.Simulation; public class QuestGiver : ScriptBase { [Tooltip("The quest's title (or id) from Windows -> Quests.")] public string Quest = ""; public string ClickHint = "Talk"; [Tooltip("Optional: shown only to players who have not taken the quest yet.")] public SceneObject Marker; public override void Start() { MakeInteractable(click => OfferQuest(click.Username, Quest), true, null, true, 10f, ClickHint); // Joined: a player arrived. The other events: their quest changed. Either way, update their marker. if (Marker != null && !Marker.IsNull) ListenForQuest(Quest, quest => SetObjectVisible(Marker, quest.State == QuestState.NotStarted || quest.State == QuestState.Offered, quest.Username)); } }