Forum rules - please read before posting.

Best method for sound when interaction icon appears?

Hi, I know how to play a sound when entering a hotspot. But how to play a sound when e.g. showing the "Use" oder the "Look" icon? If I could run an action list when showing the icons, I would be glad. But I did not find a hook for that. The background: I make games for disabled people that can not use the mouse. They have to get an instant audio feedback when seeing/ changing the icon. How to get that? Thanks for help!

Comments

  • That is not currently possible.  What interaction method are you using?  A shot of your Settings Manager would be very useful.
  • This is the important part of my settings manager. I need to find a way how to play an audio file saying "use key" or "look at door" when the user switches through the possible interaction icons at a hotspot. Most of my players are blind, so there would be no other way for me. I understand, that it is not possible by default. So, where is the best hook to implement this?


    image
  • edited May 2015
    The code to change the icon when cycling cursors is in PlayerInteraction.cs' SetNextInteraction function (starting around line 1281).

    This function calculates a new value for the "interactionIndex" variable, which is used to access the correct Hotspot interaction:

    myHotspot.useButtons [interactionIndex]

    would return the associated Button class on myHotspot.

    Now, the currently selected Hotspot can be retrieved through:

    AC.KickStarter.playerInteraction.GetActiveHotspot ();

    And the Button class contains an iconID integer, which represents which "icon" that particular interaction it has (Use/Look etc).  You should therefore be able to use this to work out which sound to play:

    AC.KickStarter.playerInteraction.GetActiveHotspot ().useButtons [interactionIndex].iconID;

    Will return e.g. 0 for Use, 1 for Look etc.
  • edited May 2015
    Thank you, that works! I guess starting a prepared Action List inside of the code would be the best method?
  • Yes - you can call an ActionList asset with AdvGame.RunActionListAsset function - see the manual's section 12.7.
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.