Simple (basic) question about global trigger for sound, tied to objects

Started by KyriakosCH, Fri 16/06/2017 10:20:09

Previous topic - Next topic

KyriakosCH

Hi, i would like to have a sound (asomething) play each time any object in any room is "looked at".

How do i script it? I know it will be very easy, but i am not aware of global commands tied to user actions (look at in this case), so pls help :=
This is the Way - A dark allegory. My Twitter!  My Youtube!

Gilbert

Try to look up unhandled_event from the manual, but I think you still need to add the code to each instance when that event is "handled".

KyriakosCH

Thanks :) In that case i can (also) just add the asomething.Play() to each object, i was just hoping there was a way to tie ALL objects to this when looked at ^_^
This is the Way - A dark allegory. My Twitter!  My Youtube!

Snarky

There is. You can add it in the on_mouse_click() handler. Check whether it's over an object (GetLocationType()), and check if the click was a look (exactly how depends on your UI), and if so, play the sound.


SMF spam blocked by CleanTalk