Frictional Games Forum (read-only)

Full Version: Scripting help !!! :E
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone, i'm sundayz and i started doing custom story in Amnesia :-)
But the problem is scripting which is very difficult :/
i know the basic etc..
But i wan't to do something and i really don't know how to do it !!!
I wan't my character when he read a letter (letter2 for example) after reading the letter he's teleported to an other map. I wan't to do this without loading when he enter the map and a scary sound [Image: biggrin.gif].
I hope u understand what i wan't to do (I'm french i'm sorry if you don't understand very well...)
I hope u will help me, thanks.
You can't load another map without the loading. You can map the duplicate into the original map so you can teleport there without the loading?
(02-20-2012, 12:52 PM)flamez3 Wrote: [ -> ]You can't load another map without the loading. You can map the duplicate into the original map so you can teleport there without the loading?
Well i mean for example:
you are on a room and after doing something there is a black screen and you see that the room is different (example there is body in the ground or blood etc..)
Make the things you want to come on after you read the note inactive. And use these

FadeOut()
FadeIn()
SetEntityActive()
What you mean ?
Can you if possible make a Script example ? Tongue
void OnStart()
{
SetEntityPlayerInteractCallback("nameofnote", "Scare", true);
}

void Scare(string &in asEntity)
{
SetEntityActive("nameofentity", true);
}

Or if you want to teleport the player to a different part of the map:

void OnStart()
{
SetEntityPlayerInteractCallback("nameofnote", "Scare", true);
}

void Scare(string &in asEntity)
{
TeleportPlayer("nameofPlayerStartArea");
}

Make another start area where you want the player to transport.
(02-20-2012, 02:11 PM)flamez3 Wrote: [ -> ]void OnStart()
{
SetEntityPlayerInteractCallback("nameofnote", "Scare", true);
}

void Scare(string &in asEntity)
{
SetEntityActive("nameofentity", true);
}

Or if you want to teleport the player to a different part of the map:

void OnStart()
{
SetEntityPlayerInteractCallback("nameofnote", "Scare", true);
}

void Scare(string &in asEntity)
{
TeleportPlayer("nameofPlayerStartArea");
}

Make another start area where you want the player to transport
(02-20-2012, 02:11 PM)flamez3 Wrote: [ -> ]Okay Big Grin Thanks a lot bro ! Big Grin !!
(02-20-2012, 02:11 PM)flamez3 Wrote: [ -> ](if someone has an other suggestion for the sound or something tell me please :-) )

For the sound:

PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);


asSoundName - internal name
asSoundFile - the sound to use + extension .snt
asEntity - the entity to create the sound at, can be “Player”
afFadeTime - time in seconds the sound needs to fade
abSaveSound - determines whether a sound should “remember” its state. If true, the sound is never attached to the entity! Also note that saving should on be used on looping sounds!
Okay thanks a lot !


(02-21-2012, 03:22 AM)flamez3 Wrote: [ -> ]For the sound:

PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);


asSoundName - internal name
asSoundFile - the sound to use + extension .snt
asEntity - the entity to create the sound at, can be “Player”
afFadeTime - time in seconds the sound needs to fade
abSaveSound - determines whether a sound should “remember” its state. If true, the sound is never attached to the entity! Also note that saving should on be used on looping sounds!
Rofl what u told me to do don't work i'll give you what i wrote and tell me what is wrong (i really start to script)

void OnStart()
{
AddDebugMessage("OnStart!", false);
SetEntityPlayerInteractCallback("letter3", "Scare", true);
}


void Scare(string &in asEntity)
{
TeleportPlayer("PlayerStartArea_20");
}



My letter is really letter3 and the area i wan't my player to go is this one too these things are not wrong i'm sure.