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
Interacting with item then teleporting to another area script?
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: Interacting with item then teleporting to another area script?

Run the script you want to happen inside a block that is executed when you interact with the lever. One way to do this is to go to the lever's entity tab in the level editor. One of the text boxes should say PlayerInteractCallback. Write a name in there (for example InteractLever).

Then go to your script and make the block for it. From what you quoted, it looks like you cut out the top of it. You can place all of what was originally inside that block inside the new block you made, like this:

void InteractLever(string &in asEntity)
{
    FadeOut(0.3);

    AddTimer("scare", 0.3f, "TimerPlayerReact");    
    AddTimer("breath", 2.0f, "TimerPlayerReact");    
    AddTimer("breathl", 4.0f, "TimerPlayerReact");
    AddTimer("breathl", 6.0f, "TimerPlayerReact");

    AddTimer("TeleportHowl", 0.5f, "TimerTeleportHowl");    
    AddTimer("TeleportDone", 3.5f, "TimerTelportDone");

    PlaySoundAtEntity("stomp","scare_wall_stomp","Player", 0, false);
    PlaySoundAtEntity("darkamb","07_amb_breath","Player", 5, true);
    PlaySoundAtEntity("wateramb", "ambience_water_no3d.snt", "sound_idle_1", 5, true);

    FadePlayerFOVMulTo(4.0f, 4.0f);
    SetRadialBlurStartDist(0.1f);
    FadeRadialBlurTo(1.0f, 5.0f);

    StartEffectFlash(0.2, 0.1,0.3);

    FadeGlobalSoundVolume(0, 0.3);
    StopMusic(0.3f, 0);
    StartScreenShake(0.1, 4.7, 0.05, 0.5);

    FadePlayerFOVMulTo(0.5, 3);
}

You can keep the rest as it is right now, and that should be it. Let me know if it works out Smile

(This post was last modified: 02-09-2014, 10:55 PM by Mudbill.)
02-09-2014, 10:53 PM
Find


Messages In This Thread
RE: Interacting with item then teleporting to another area script? - by Mudbill - 02-09-2014, 10:53 PM



Users browsing this thread: 1 Guest(s)