Forum rules - please read before posting.

Displaying hotspot labels continuously and hotspot label renaming

1. Is there a way to display hotspot labels continuously and not just when mouse is over the hotspot?

2. Also, I am unable to assign a parameter to the field "New Label" within the action "Hotspot: Rename".  Is there a solution ? 

My game in short is like this,

The player is in charge of repairing a book whose data has been corrupted. That is, letters are missing, word order of the sentence has been disturbed.

Each scene is one sentence.

At the start of each scene, there are some words on the screen, not in order. Also, some letters are missing from some words.


                                      am                A stral an          I



I have made a hotspot for each word. This has proved to be very convenient, as each word can be examined separately, using various use interactions, like "sound" "translate" etc. and also all the data relating to a word , like the missing letters, correct word, word order, sound, translation can be stored in the hotspot connected to that word.

I hope the above two questions can be solved so I can use this method of connecting hotspots to words, it has really made things easy for me.

Comments

  • edited November 2017
    Currently both are only possible through custom code - as there are technical restrictions in place.  The "New label" field can't accept parameters, for example, because the save and translation systems both require a specific, rather than a dynamic, line of text.

    Given that you're using this for a non-standard adventure game, I feel it would probably be wiser to have a custom label solution.  If you want to make use of Hotspot's interaction features, you don't necessarily also need to have that Hotspot's label appear on screen.

    You could conceivably create a Unity UI canvas for each Hotspot (set to appear in World Space so that you could position it in 3D space over them), and then have a custom Action that re-writes the text in the Text component.  I can assist you with writing such an Action if that sounds like a viable alternative.
  • edited November 2017
    The label field parameter I have gotten around, by excluding it from the action list asset. It was luckily the last action of the list, so I will keep that last action scene based, so that I can enter it manually.

    The hotspot label text still  needs to be displayed continuously, I'm glad and relieved to know it's possible to do so through a custom action and unity UI. Thank you so much for offering to help me with it, I look forward to implementing this, with your guidance.

    I am also sending you a two minute video about the gameplay , in case its needed.
  • All right, so since this is a 2D game you don't need to worry about world-space canvases and 3D positions, which does make it a lot easier.

    You can create a new UI Text label for each Hotspot from the top toolbar: GameObject -> UI -> Text.  You should be able to have all your Text components in a single UI Canvas.  This step is purely Unity, no AC - see Unity's own documentation on Unity UI here.

    You'll need the Game and Scene windows arranged side-by-side so that you can edit the UI in the Scene window and match up its position correctly with the Hotspots in the Game window (since the UI acts in it's own co-ordinates).

    Make a new Text component for each Hotspot, and these will then act as your "Hotspot labels", but only in appearance - they won't be controlled by AC.  But moving them to UI Text components will allow you better control over their appearance, animation options etc.

    Then, you should just need a custom Action that changes the label of a Text component.  I've uploaded one to the AC wiki here.  Name the file "ActionTextLabel.cs", and follow the instructions at the top of the "Custom Actions" chapter of the Manual to install it.  It should then appear under Menu: Update text label in your Actions Manager.
  • It works perfectly! 

    Thank you so much Chris.
    Also thanks for the detailed steps and for going one step further and also making it possible to add parameters to this action.

    I wish you'd write an erp software too and solve the many problems in that area.  


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.