Frictional Games Forum (read-only)

Full Version: Interactive custom model
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm sorry for all these questions. It will be my last one I promise.

How do I make a custom model interactive? (I made a voice recorder and I want to make it that when you click on it you hear a voice)

On the level editor I clicked on Object and Push but it did not seem to do the trick. (No hand appears when you hover over the voice recorder)
What you could do it very simpel.
Open the lvleditor. add a small blockbox around\ontop the voice recorder.
Then go to the blockbox and go to the Entity TAB then
add a name on the connectionstatechangecallback ( right now add this PlayMusicBox ).
Here is the script you can use.
This is for turning it On pres again will turn OFF press again will turn On etc etc...
---
PHP Code:
            /////StartupSoundFromVoiceRecorder/////
 
void PlayMusicBox(string &in asEntityint alState
{
if(
alState == 1)
{
PlaySoundAtEntity("StopMusicBoxNow""Gramaphoneattic.snt""ScriptArea_2"0.05ffalse);
}

if(
alState == -1)
{
StopSound("StopMusicBoxNow"3);
}

and? :p
There it is Wink

Let me know itf you understand and if it works

I have to go, soccer training...
Let me \ us know if it works, some other amazing guys will take it over from here now.
This should work!
Good luck.
Scriptarea? And I need to use

void SetEntityCallbackFunc(string& asName, string& asCallback);

at void on start, correct?
Yes. I'm awaaaayyyy.
hahaha i'm kidding Wink