Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting help !!! :E
Author Message
Sundayz Offline
Junior Member

Posts: 6
Joined: Feb 2012
Reputation: 0
Post: #1
Scripting help !!! :E

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.
02-20-2012 12:41 PM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,285
Joined: Apr 2011
Reputation: 57
Post: #2
RE: Scripting help !!! :E

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
Find all posts by this user Quote this message in a reply
Sundayz Offline
Junior Member

Posts: 6
Joined: Feb 2012
Reputation: 0
Post: #3
RE: Scripting help !!! :E

(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..)
02-20-2012 12:56 PM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,285
Joined: Apr 2011
Reputation: 57
Post: #4
RE: Scripting help !!! :E

Make the things you want to come on after you read the note inactive. And use these

FadeOut()
FadeIn()
SetEntityActive()

(This post was last modified: 02-20-2012 01:13 PM by flamez3.)
02-20-2012 01:12 PM
Find all posts by this user Quote this message in a reply
Sundayz Offline
Junior Member

Posts: 6
Joined: Feb 2012
Reputation: 0
Post: #5
RE: Scripting help !!! :E

What you mean ?
Can you if possible make a Script example ? Tongue
02-20-2012 01:40 PM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,285
Joined: Apr 2011
Reputation: 57
Post: #6
RE: Scripting help !!! :E

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.

(This post was last modified: 02-20-2012 02:11 PM by flamez3.)
02-20-2012 02:11 PM
Find all posts by this user Quote this message in a reply
Sundayz Offline
Junior Member

Posts: 6
Joined: Feb 2012
Reputation: 0
Post: #7
RE: Scripting help !!! :E

(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 :-) )
02-20-2012 06:09 PM
Find all posts by this user Quote this message in a reply
flamez3 Offline
Posting Freak

Posts: 1,285
Joined: Apr 2011
Reputation: 57
Post: #8
RE: Scripting help !!! :E

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!

(This post was last modified: 02-21-2012 03:22 AM by flamez3.)
02-21-2012 03:22 AM
Find all posts by this user Quote this message in a reply
Sundayz Offline
Junior Member

Posts: 6
Joined: Feb 2012
Reputation: 0
Post: #9
RE: Scripting help !!! :E

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.
(This post was last modified: 02-21-2012 12:05 PM by Sundayz.)
02-21-2012 11:47 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)