Frictional Games Forum (read-only)

Full Version: Ending map with a note
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm want my credits to start and my map to end when I pick up a note.

Any suggestion on script?




Found some threads about starting your credits, but none (what I could find) that said anything about notes.
Code:
void SetEntityCallbackFunc(string& asName, string& asCallback);
   Calls a function when the player interacts with a certain entity.
  Callback syntax: void MyFunc(string &in asEntity, string &in type)
  Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc
and
Code:
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
   Starts the end credits screen.    asMusic - the music to play (including .ogg)
  abLoopMusic - determines whether the music should loop
  asTextCat - the category to be used in the .lang file (must be “Ending”)
  asTextEntry - the entry in the .lang file (must be “MainCredits”)
  alEndNum - Amnesia has 3 different endings and displays a code  at the bottom. Determines which code is displayed. 0-2 will display  codes, any other integer will not.
Smile
Think you could use this one:

Code:
void SetEntityCallbackFunc(string& asName, string& asCallback);
   Calls a function when the player interacts with a certain entity.
  Callback syntax: void MyFunc(string &in asEntity, string &in type)
  Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc

And in the MyFunc;
Code:
void StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);
   Starts the end credits screen.    asMusic - the music to play (including .ogg)
  abLoopMusic - determines whether the music should loop
  asTextCat - the category to be used in the .lang file (must be “Ending”)
  asTextEntry - the entry in the .lang file (must be “MainCredits”)
  alEndNum - Amnesia has 3 different endings and displays a code  at the bottom. Determines which code is displayed. 0-2 will display  codes, any other integer will not.
Can you put that in the:

OnStart()








Will make it easier to understand Smile
Code:
void OnStart()
{

SetEntityCallbackFunc(string& asName, string& asCallback);

}

void MyFunc(string &in asEntity, string &in type)
{

StartCredits(string& asMusic, bool abLoopMusic, string& asTextCat, string& asTextEntry, int alEndNum);

}


I did that on one of my maps, it went like this:

Quote:{
SetEntityPlayerInteractCallback("note_4", "Note_mapchanger", true);
}
void Note_mapchanger(string &in asEntity)
{
ChangeMap("map6.map", "PlayerStartArea_1", "", "");}