Frictional Games Forum (read-only)
Ending map with a note - 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: Ending map with a note (/thread-10816.html)



Ending map with a note - i3670 - 10-17-2011

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.



RE: Ending map with a note - Elven - 10-17-2011

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



RE: Ending map with a note - schmupper - 10-17-2011

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.



RE: Ending map with a note - i3670 - 10-17-2011

Can you put that in the:

OnStart()








Will make it easier to understand Smile



RE: Ending map with a note - schmupper - 10-17-2011

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);

}





RE: Ending map with a note - A Tricky Carnie - 10-18-2011

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", "", "");}