Forum rules - please read before posting.

How check enable/disable hotpoint?

edited October 29 in Technical Q&A

Hello, I have a question, I have 3 hotspots (2 are enable at once and the third is disable), the task is that the player needs to use the first two so that the third one turns on (and the first two turn off) moreover, using one of the first ones, the second one should be checked, if it has already been activated, then after activating the second one, the third one will appear. In general, this is an easy task, I implemented it using Remember Hotspot, but the function Check Hotspot is enable/disable (similar to Object-Visibility - yes/no) I haven't found if there is such a feature, and if not, can I add it in future updates? thank you!

Comments

  • Do each of the 2 initial Hotspots turn off when used independently?

    Create a Local Integer Variable to record how many of these Hotspots you've turned off. When using either one, run a Variable: Set Action to increase this Variable's value by 1. Then, run a Variable: Check Action to compare it to 2. If it is, then both Hotspots have been used and Hotspot 3 should turn on.

  • Yes, the initial points are turned off when used independently, of course I can do this through variables, but this is a longer way, I thought it was possible to check the ability of the Remember Hotspot function, as it is implemented in the script to Remember Visibility of Objects, it is very convenient

  • edited October 30

    And one more question arose a long time ago, but I forgot to ask it, it's certainly not very important, but if there is an opportunity to suggest how to fix it, it would be great :) In general, if there are several items in the inventory, then the number of items is too close to the edge of the item icon, when the number is two digits, it is not very noticeable, but when there are less than ten items, the figure shifts too much to the edge (screenshot) is there a way to make an indentation from the edge? so that the numbers of the number of items are indented from the edge, I hope I made it clear, thank you :smile:
    https://ibb.co/Z6Sq1239

  • Here's a custom "Hotspot: Check" Action you can plug in with this tutorial:

    using System.Collections.Generic;
    
    namespace AC
    {
    
        [System.Serializable]
        public class ActionHotspotCheck : ActionCheck
        {
    
            public int parameterID = -1;
            public int constantID = 0;
            public Hotspot hotspot;
            protected Hotspot runtimeHotspot;
    
            public override ActionCategory Category { get { return ActionCategory.Hotspot; } }
            public override string Title { get { return "Check"; } }
    
    
            public override void AssignValues(List<ActionParameter> parameters)
            {
                runtimeHotspot = AssignFile<Hotspot>(parameters, parameterID, constantID, hotspot);
            }
    
    
            public override bool CheckCondition()
            {
                return runtimeHotspot && runtimeHotspot.IsOn ();
            }
    
    
    #if UNITY_EDITOR
    
            public override void ShowGUI(List<ActionParameter> parameters)
            {
                ComponentField("Hotspot to check:", ref hotspot, ref constantID, parameters, ref parameterID);
            }
    
    #endif
    
        }
    
    }
    

    is there a way to make an indentation from the edge?

    If your Menu's Source is Unity UI Prefab, you can control the exact positioning of the Text box that displays the value.

  • Thanks Chris! and if possible, please add a Hotspot Check in the next update, I think this is a useful feature.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.