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
Custom Story Ending. Needing Halp.
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#1
Custom Story Ending. Needing Halp.

So, I'm right at the end of my custom story, I'm at the last room and I want to make it so you unlock a door with a key ("special_orb_room_door_1" Yes, It's Static) Then have it go to the credits, How would I put all this together?

N00B
06-06-2014, 09:11 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#2
RE: Custom Story Ending. Needing Halp.

Here's one I used for my mod (taking it straight away from the code)

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetPlayerActive(false);
    PlaySoundAtEntity("derp", "unlock_door", "Player", 0.0f, false);
    FadeOut(4);
    
    AddTimer("", 1.0f, "TimerEndConversion");
}
void TimerEndConversion(string &in asTimer)
{
    float fEventSpeed = 1.0f;    //The speed of the event
    AddLocalVarInt("fEventSpeed", 1);        //Steps through the timer
    
    switch(GetLocalVarInt("fEventSpeed")){
        case 1:
            PlaySoundAtEntity("derp", "door_level_cellar_open", "Player", 0.0f, false);
            StopMusic(2.0f, 0);
            fEventSpeed = 3.0f;
        break;
        case 2:
            PlayMusic("27_puzzle_passage.ogg", false, 0.8f, 0.5f, 9, false);
            fEventSpeed = 11.0f;
        break;
        case 3:
            SetMessage("Ch05Lvl35", "TheEnd", 0);
            fEventSpeed = 5.0f;
        break;
        case 4:
            //Time to end it all
            StartCredits();
        break;
    }
    
    if(GetLocalVarInt("fEventSpeed") < 4) AddTimer("", fEventSpeed, "TimerEndConversion");
}

//This has to check how many easter eggs the player has found
void StartCredits()
{
    
    StartCredits("credits_music.ogg", true, "Credits", "Credits_NoEasterEgg", 0);
}

Derp.
06-06-2014, 09:13 PM
Find
Aglowglint11 Offline
Junior Member

Posts: 31
Threads: 8
Joined: Mar 2014
Reputation: 0
#3
RE: Custom Story Ending. Needing Halp.

(06-06-2014, 09:13 PM)Neelke Wrote: Here's one I used for my mod (taking it straight away from the code)

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
    SetPlayerActive(false);
    PlaySoundAtEntity("derp", "unlock_door", "Player", 0.0f, false);
    FadeOut(4);
    
    AddTimer("", 1.0f, "TimerEndConversion");
}
void TimerEndConversion(string &in asTimer)
{
    float fEventSpeed = 1.0f;    //The speed of the event
    AddLocalVarInt("fEventSpeed", 1);        //Steps through the timer
    
    switch(GetLocalVarInt("fEventSpeed")){
        case 1:
            PlaySoundAtEntity("derp", "door_level_cellar_open", "Player", 0.0f, false);
            StopMusic(2.0f, 0);
            fEventSpeed = 3.0f;
        break;
        case 2:
            PlayMusic("27_puzzle_passage.ogg", false, 0.8f, 0.5f, 9, false);
            fEventSpeed = 11.0f;
        break;
        case 3:
            SetMessage("Ch05Lvl35", "TheEnd", 0);
            fEventSpeed = 5.0f;
        break;
        case 4:
            //Time to end it all
            StartCredits();
        break;
    }
    
    if(GetLocalVarInt("fEventSpeed") < 4) AddTimer("", fEventSpeed, "TimerEndConversion");
}

//This has to check how many easter eggs the player has found
void StartCredits()
{
    
    StartCredits("credits_music.ogg", true, "Credits", "Credits_NoEasterEgg", 0);
}

Where did you put the name of the door in that Script lol? And Yeah, I might try something like that If I can figure it out.

N00B
06-06-2014, 10:01 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#4
RE: Custom Story Ending. Needing Halp.

void OnStart()
{
     AddUseItemCallback("derp", "key_study_1", "level_celler_1", "UseKeyOnDoor", false);
}

Derp.
(This post was last modified: 06-06-2014, 11:26 PM by Neelke.)
06-06-2014, 11:25 PM
Find




Users browsing this thread: 1 Guest(s)