Forum rules - please read before posting.

Toggle hotspot icons via menu

I would like to have a menu element that can toggle AC Game Editor/Settings/Hotspot settings/Display Hotspot icons from "Never" to "Always" and back. How would I accomplish this?

Comments

  • You can change any Manager field's value at runtime through script.

    To get an API reference to a given field, right-click the field's label and choose "Copy script variable". In the case of the Display Hotspot icons field, this is:

    AC.KickStarter.settingsManager.hotspotIconDisplay
    

    You can set this to Never or Always with the lines:

    AC.KickStarter.settingsManager.hotspotIconDisplay = AC.HotspotIconDisplay.Never;
    AC.KickStarter.settingsManager.hotspotIconDisplay = AC.HotspotIconDisplay.Always;
    

    To call this code, you'd place these two lines into two separate functions in a C# script, and then call each as needed using the Object: Call event Action. Details on this technique can be found in this tutorial.

    The difference here is that you'd want this to be called after the user clicks in the Menu. To handle this, create a Toggle element and map its value to a Global Boolean Variable. Assign it an ActionList on click file that then uses the Variable: Check Action to read the Variable's value, and then call the appropriate function as needed.

    If you wanted to have this variable be independent of save-game data (and also survive rebooting the game), set its Link to field to Options Data.

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.