Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ending map with a note
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#1
Ending map with a note

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.
10-17-2011, 05:17 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#2
RE: Ending map with a note

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

The Interrogation
Chapter 1

My tutorials
10-17-2011, 05:38 PM
Find
schmupper Offline
Junior Member

Posts: 23
Threads: 1
Joined: Aug 2011
Reputation: 2
#3
RE: Ending map with a note

Think you could use this one:

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

''Oh. My. God. He's DEAD. Quickly, if he hasnt started to smell, give him the kiss of life!''

Clarence - The monkey hater
10-17-2011, 05:38 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#4
RE: Ending map with a note

Can you put that in the:

OnStart()








Will make it easier to understand Smile
10-17-2011, 05:59 PM
Find
schmupper Offline
Junior Member

Posts: 23
Threads: 1
Joined: Aug 2011
Reputation: 2
#5
RE: Ending map with a note

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

}



''Oh. My. God. He's DEAD. Quickly, if he hasnt started to smell, give him the kiss of life!''

Clarence - The monkey hater
10-17-2011, 09:10 PM
Find
A Tricky Carnie Offline
Member

Posts: 72
Threads: 15
Joined: Sep 2011
Reputation: 0
#6
RE: Ending map with a note

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

10-18-2011, 08:50 PM
Find




Users browsing this thread: 1 Guest(s)