Frictional Games Forum (read-only)
[MDL ED] Interactive custom model - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [MDL ED] Interactive custom model (/thread-25655.html)



Interactive custom model - goodcap - 07-10-2014

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)


RE: Interactive custom model - DnALANGE - 07-10-2014

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);
}




RE: Interactive custom model - goodcap - 07-10-2014

and? :p


RE: Interactive custom model - DnALANGE - 07-10-2014

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.


RE: Interactive custom model - goodcap - 07-10-2014

Scriptarea? And I need to use

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

at void on start, correct?


RE: Interactive custom model - DnALANGE - 07-10-2014

Yes. I'm awaaaayyyy.


RE: Interactive custom model - goodcap - 07-10-2014

hahaha i'm kidding Wink