Frictional Games Forum (read-only)

Full Version: Script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
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"); 
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.
yeah thats it, if you have problems with adding timer (if you are even interested into adding it) just tell me
First I need to record voice acting, but thanks Tongue
check PM i want to talk a little bit about your custom story