Frictional Games Forum (read-only)
Script - 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: Script (/thread-22376.html)



Script - MaTPlays - 08-09-2013

Hello everybody! It's me again.
I wonder if I'm able to make black screen after touch a script area, put there narration sound, and after this teleport to another map. If someone can create a script and explain him a little, I'll be very grateful. I want to understand how does it working for the future. Thanks!


RE: Script - Tomzzz - 08-09-2013

here you are:

PHP Code:
void OnStart(){AddEntityCollideCallback("Player""areaenter""areaenter"true1);}
void areaenter(string &in asParentstring &in asChildint alState){    FadeOut(5);    PlaySoundAtEntity("""react_sigh.snt""Player"0false);    } 


well thats it as you can see sound start as you enter area so if you want it to start later use Timer command.. change number in fadeout if you want to change black screen duration time..

AddEntityCollideCallback("Player", "areaenter", "areaenter", true, 1);} - if player touch script area which is called areaenter..
void areaenter - this is fuction which happens after touching it
PlaySoundAtEntity - play sound at player position or anywhere else where u want you change script also you can change sound ..

for changing map use this inside void Onstart:
PHP Code:
AddEntityCollideCallback("Player""areaenter""areaenter"true1); 

for changing put this script inside areaenter void:

PHP Code:
ChangeMap("MAPNAME""NAMEOFSTARTPOSITION""STARTSOUND.ogg""ENDSOUND.ogg"); 



RE: Script - MaTPlays - 08-09-2013

Thank you very much, am I able to teleport him to the other map after it?
/edit
I think I got script. Is it this?
void ChangeMap(string& asMapName, string& asStartPos, string& asStartSound, string& asEndSound);
//edit
Ok, you changed your post, I didn't see this Tongue Thanks.


RE: Script - Tomzzz - 08-09-2013

yeah thats it, if you have problems with adding timer (if you are even interested into adding it) just tell me


RE: Script - MaTPlays - 08-09-2013

First I need to record voice acting, but thanks Tongue


RE: Script - Tomzzz - 08-09-2013

check PM i want to talk a little bit about your custom story