The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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?
Artsy Offline
Member

Posts: 213
Threads: 10
Joined: Feb 2014
Reputation: 9
#1
Interacting with item then teleporting to another area script?

Hello there,
I'm working on a custom story and had this cool idea for something which requires script.
It's basically like this:
the player interacts with the lever, the screen fades black and then the player teleports to another area.
I've found script from the Cellar Archives from TDD, which is exactly what I want:

Quote: 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);
}

void TimerPlayerReact(string &in asTimer)
{
if(asTimer == "scare"){
PlayGuiSound("react_scare", 1.0f);
}
else if(asTimer == "breath"){
PlayGuiSound("react_breath", 0.8f);
}
else if(asTimer == "breathl"){
PlayGuiSound("react_breath", 0.5f);
}
}

void TimerTeleportHowl(string &in asTimer)
{
PlaySoundAtEntity("howl","guardian_activated.snt","Player", 0, false);
SetPlayerActive(false);
SetFogActive(true);
}

void TimerTelportDone(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_3");
FadeGlobalSoundVolume(1,2);
SetPlayerActive(true);
FadePlayerFOVMulTo(1.0f, 0.5f);
FadeRadialBlurTo(0.0f, 1.0f);
FadeIn(1.3);

FadePlayerFOVMulTo(1, 1);

StartUpDarkSide();
}

But - I really do want the player to interact with the lever first, before the screen fades black. Help?

Can you give me an example?
02-09-2014, 10:13 PM
Find


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



Users browsing this thread: 1 Guest(s)