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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Camera angle turns upside down
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#1
Camera angle turns upside down

I made a script where a corridor collapses and the screen fades out for a sec. When the screen is back on, the camera is upside down. I have no idea what causes this. But you guys might be able to help me.

The script (if now necessary):

void TimerCollapse(string &in asTimer)
{
FadeOut(0.3);

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

FadePlayerFOVMulTo(0.5, 3);

PlaySoundAtEntity("rumble", "general_rock_rumble_no3d.snt", "Player", 0.5f, true);
AddTimer("1", 1.0f, "TimerCaveIn");
AddTimer("3", 3.0f, "TimerCaveIn");

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

StartEffectFlash(0.2, 0.1,0.3);
SetPlayerActive(false);

AddTimer("caveindone", 3.5f, "TimerCaveInDone");

SetPlayerCrouchDisabled(true);
SetPlayerJumpDisabled(true);
}

void TimerCaveInDone(string &in asTimer)
{
float fCaveInSpeed = 1.0f;
AddLocalVarInt("fCaveInSpeed", 1);

switch(GetLocalVarInt("fCaveInSpeed")){
case 1:
FadeIn(2.0f);
MovePlayerHeadPos(0.0f, 0.8f, 0.5f, 0.8f, 0.8f);
FadePlayerRollTo(30.0f, 2.0f, 2.0f);
StartPlayerLookAt("AreaLook_1", 1.2f, 1.2f, "");
PlayMusic("15_event_elevator.ogg", false, 1.0f, 0.5f, 10, false);
//To avoid it happen again
SetLevelDoorLocked("level_engine_1", true);
SetEntityPlayerInteractCallback("level_engine_1", "InteractCollapsedDoor", false);
fCaveInSpeed = 1.0f;
break;
case 2:
PlaySoundAtEntity("cloth1", "player_crouch", "Player", 0.2f, false);
MovePlayerHeadPos(0.0f, 0.8f, 0.5, 1.2f, 1.2f);
fCaveInSpeed = 1.5f;
break;
case 3:
StartPlayerLookAt("AreaLook_2", 0.5f, 0.5f, "");
FadeOut(5.0f);
PlaySoundAtEntity("sight1", "react_sigh", "Player", 0.5f, false);
fCaveInSpeed = 2.0f;
break;
case 4:
StartPlayerLookAt("AreaLook_3", 2.5f, 2.5f, "");
FadeIn(2.0f);
FadePlayerRollTo(30.0f, 6.0f, 6.0f);
break;
case 5:
PlaySoundAtEntity("sight1", "react_sigh", "Player", 0.5f, false);
StartPlayerLookAt("AreaLook_1", 0.5f, 0.5f, "");
FadePlayerRollTo(30.0f, 10.0f, 10.0f);
FadeOut(3.0f);
break;
case 6:
PlaySoundAtEntity("cloth2", "player_climb", "Player", 0.2f, false);
MovePlayerHeadPos(0.0f, 0.5f, 0.25f, 0.5f, 0.5f);
fCaveInSpeed = 0.5f;
break;
case 7:
FadePlayerRollTo(0.0f, 15.0f, 15.0f);
fCaveInSpeed = 2.0f;
break;
case 8:
PlaySoundAtEntity("sight2", "react_sigh", "Player", 0.4f, false);
FadeIn(2.0f);
FadePlayerRollTo(30.0f, 8.0f, 8.0f);
MovePlayerHeadPos(0.0f, 0.8f, 0.5f, 0.7f, 0.5f);
PlaySoundAtEntity("cloth3", "player_crouch", "Player", 0.2f, false);
break;
case 9:
StartPlayerLookAt("AreaLook_1", 1.0f, 0.5f, "");
fCaveInSpeed = 0.5f;
break;
case 10:
FadePlayerRollTo(30, 30.0f, 30.0f);
PlaySoundAtEntity("cloth4", "player_stand", "Player", 0.2f, false);
fCaveInSpeed = 0.5f;
break;
case 11:
FadePlayerRollTo(0, 0.0f, 0.0f);
PlaySoundAtEntity("cloth5", "player_climb", "Player", 0.5f, false);
fCaveInSpeed = 0.5f;
break;
case 12:
StartPlayerLookAt("AreaLook_2", 1.5f, 1.5f, "");
fCaveInSpeed = 1.0f;
break;
case 13:
SetPlayerCrouchDisabled(false);
SetPlayerJumpDisabled(false);
FadePlayerRollTo(0, 8.0f, 8.0f);
MovePlayerHeadPos(0.0f, 0.0f, 0.0f, 0.8f, 0.8f);
break;
case 14:
SetPlayerActive(true);
break;
}

if(GetLocalVarInt("fCaveInSpeed") < 14) AddTimer("", fCaveInSpeed, "TimerCaveInDone");
}

void TimerCaveIn(string &in asTimer)
{
if(asTimer == "1"){
CreateParticleSystemAtEntity("cavein", "ps_break_cavein_local", "cave_in", false);
PlaySoundAtEntity("caveins", "explosion_rock_large", "cave_in", 0.0f, false);
TeleportPlayer("PlayerStartArea_5");
}
else if(asTimer == "3"){
StopSound("rumble", 3.0f);
}
}
(This post was last modified: 10-29-2013, 06:40 PM by Neelke.)
10-29-2013, 03:03 PM
Find
saito100 Offline
Junior Member

Posts: 15
Threads: 8
Joined: Jul 2013
Reputation: 0
#2
RE: Camera angle turns upside down

I'll take another look at this later, but I believe for "PlaySoundAtEntity("rumble", "general_rock_rumble_no3d.snt", "Player", 0.5f, true);" you can put "general_rock_rumble.ogg" you can play it without 3d by using this "PlayGuiSound("general_rock_rumble.snt", 0.5f);" if it might save you making that custom snt file.
(This post was last modified: 11-05-2013, 04:45 PM by saito100.)
11-04-2013, 05:21 PM
Find
Icaab2608 Offline
Member

Posts: 85
Threads: 37
Joined: Jul 2013
Reputation: 0
#3
RE: Camera angle turns upside down

(10-29-2013, 03:03 PM)Neelke Wrote: I made a script where a corridor collapses and the screen fades out for a sec. When the screen is back on, the camera is upside down. I have no idea what causes this. But you guys might be able to help me.

The script (if now necessary):

void TimerCollapse(string &in asTimer)
{
FadeOut(0.3);

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

FadePlayerFOVMulTo(0.5, 3);

PlaySoundAtEntity("rumble", "general_rock_rumble_no3d.snt", "Player", 0.5f, true);
AddTimer("1", 1.0f, "TimerCaveIn");
AddTimer("3", 3.0f, "TimerCaveIn");

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

StartEffectFlash(0.2, 0.1,0.3);
SetPlayerActive(false);

AddTimer("caveindone", 3.5f, "TimerCaveInDone");

SetPlayerCrouchDisabled(true);
SetPlayerJumpDisabled(true);
}

void TimerCaveInDone(string &in asTimer)
{
float fCaveInSpeed = 1.0f;
AddLocalVarInt("fCaveInSpeed", 1);

switch(GetLocalVarInt("fCaveInSpeed")){
case 1:
FadeIn(2.0f);
MovePlayerHeadPos(0.0f, 0.8f, 0.5f, 0.8f, 0.8f);
FadePlayerRollTo(30.0f, 2.0f, 2.0f);
StartPlayerLookAt("AreaLook_1", 1.2f, 1.2f, "");
PlayMusic("15_event_elevator.ogg", false, 1.0f, 0.5f, 10, false);
//To avoid it happen again
SetLevelDoorLocked("level_engine_1", true);
SetEntityPlayerInteractCallback("level_engine_1", "InteractCollapsedDoor", false);
fCaveInSpeed = 1.0f;
break;
case 2:
PlaySoundAtEntity("cloth1", "player_crouch", "Player", 0.2f, false);
MovePlayerHeadPos(0.0f, 0.8f, 0.5, 1.2f, 1.2f);
fCaveInSpeed = 1.5f;
break;
case 3:
StartPlayerLookAt("AreaLook_2", 0.5f, 0.5f, "");
FadeOut(5.0f);
PlaySoundAtEntity("sight1", "react_sigh", "Player", 0.5f, false);
fCaveInSpeed = 2.0f;
break;
case 4:
StartPlayerLookAt("AreaLook_3", 2.5f, 2.5f, "");
FadeIn(2.0f);
FadePlayerRollTo(30.0f, 6.0f, 6.0f);
break;
case 5:
PlaySoundAtEntity("sight1", "react_sigh", "Player", 0.5f, false);
StartPlayerLookAt("AreaLook_1", 0.5f, 0.5f, "");
FadePlayerRollTo(30.0f, 10.0f, 10.0f);
FadeOut(3.0f);
break;
case 6:
PlaySoundAtEntity("cloth2", "player_climb", "Player", 0.2f, false);
MovePlayerHeadPos(0.0f, 0.5f, 0.25f, 0.5f, 0.5f);
fCaveInSpeed = 0.5f;
break;
case 7:
FadePlayerRollTo(0.0f, 15.0f, 15.0f);
fCaveInSpeed = 2.0f;
break;
case 8:
PlaySoundAtEntity("sight2", "react_sigh", "Player", 0.4f, false);
FadeIn(2.0f);
FadePlayerRollTo(30.0f, 8.0f, 8.0f);
MovePlayerHeadPos(0.0f, 0.8f, 0.5f, 0.7f, 0.5f);
PlaySoundAtEntity("cloth3", "player_crouch", "Player", 0.2f, false);
break;
case 9:
StartPlayerLookAt("AreaLook_1", 1.0f, 0.5f, "");
fCaveInSpeed = 0.5f;
break;
case 10:
FadePlayerRollTo(30, 30.0f, 30.0f);
PlaySoundAtEntity("cloth4", "player_stand", "Player", 0.2f, false);
fCaveInSpeed = 0.5f;
break;
case 11:
FadePlayerRollTo(0, 0.0f, 0.0f);
PlaySoundAtEntity("cloth5", "player_climb", "Player", 0.5f, false);
fCaveInSpeed = 0.5f;
break;
case 12:
StartPlayerLookAt("AreaLook_2", 1.5f, 1.5f, "");
fCaveInSpeed = 1.0f;
break;
case 13:
SetPlayerCrouchDisabled(false);
SetPlayerJumpDisabled(false);
FadePlayerRollTo(0, 8.0f, 8.0f);
MovePlayerHeadPos(0.0f, 0.0f, 0.0f, 0.8f, 0.8f);
break;
case 14:
SetPlayerActive(true);
break;
}

if(GetLocalVarInt("fCaveInSpeed") < 14) AddTimer("", fCaveInSpeed, "TimerCaveInDone");
}

void TimerCaveIn(string &in asTimer)
{
if(asTimer == "1"){
CreateParticleSystemAtEntity("cavein", "ps_break_cavein_local", "cave_in", false);
PlaySoundAtEntity("caveins", "explosion_rock_large", "cave_in", 0.0f, false);
TeleportPlayer("PlayerStartArea_5");
}
else if(asTimer == "3"){
StopSound("rumble", 3.0f);
}
}
Here's a script should be:
void OnStart ()
{
AddEntityCollideCallback("Player", "Collapse", "TimerCollapse", true, 0);
}
void TimerCollapse(string &in asParent, string &in asChild, int alState)
{
FadeOut(0.3);
StopMusic(0.3f, 0);
StartScreenShake(0.1, 4.7, 0.05, 0.5);
FadePlayerFOVMulTo(0.5, 3);
PlaySoundAtEntity("rumble", "general_rock_rumble_no3d.snt", "Player", 0.5f, true);
FadePlayerFOVMulTo(4.0f, 4.0f);
SetRadialBlurStartDist(0.1f);
FadeRadialBlurTo(1.0f, 5.0f);
StartEffectFlash(0.2, 0.1,0.3);
SetPlayerActive(false);
SetPlayerCrouchDisabled(true);
SetPlayerJumpDisabled(true);
AddTimer("caveindone", 3.5f, "TimerCaveInDone");
AddTimer("1", 1.0f, "TimerCaveIn");
AddTimer("3", 3.0f, "TimerCaveIn");
}




void TimerCaveInDone(string &in asTimer)
{
float fCaveInSpeed = 1.0f;
AddLocalVarInt("fCaveInSpeed", 1);




switch(GetLocalVarInt("fCaveInSpeed")){
case 1:
FadeIn(2.0f);
MovePlayerHeadPos(0.0f, 0.8f, 0.5f, 0.8f, 0.8f);
FadePlayerRollTo(30.0f, 2.0f, 2.0f);
StartPlayerLookAt("AreaLook_1", 1.2f, 1.2f, "");
PlayMusic("15_event_elevator.ogg", false, 1.0f, 0.5f, 10, false);
//To avoid it happen again
SetLevelDoorLocked("level_engine_1", true);
SetEntityPlayerInteractCallback("level_engine_1", "InteractCollapsedDoor", false);
fCaveInSpeed = 1.0f;
break;
case 2:
PlaySoundAtEntity("cloth1", "player_crouch", "Player", 0.2f, false);
MovePlayerHeadPos(0.0f, 0.8f, 0.5, 1.2f, 1.2f);
fCaveInSpeed = 1.5f;
break;
case 3:
StartPlayerLookAt("AreaLook_2", 0.5f, 0.5f, "");
FadeOut(5.0f);
PlaySoundAtEntity("sight1", "react_sigh", "Player", 0.5f, false);
fCaveInSpeed = 2.0f;
break;
case 4:
StartPlayerLookAt("AreaLook_3", 2.5f, 2.5f, "");
FadeIn(2.0f);
FadePlayerRollTo(30.0f, 6.0f, 6.0f);
break;
case 5:
PlaySoundAtEntity("sight1", "react_sigh", "Player", 0.5f, false);
StartPlayerLookAt("AreaLook_1", 0.5f, 0.5f, "");
FadePlayerRollTo(30.0f, 10.0f, 10.0f);
FadeOut(3.0f);
break;
case 6:
PlaySoundAtEntity("cloth2", "player_climb", "Player", 0.2f, false);
MovePlayerHeadPos(0.0f, 0.5f, 0.25f, 0.5f, 0.5f);
fCaveInSpeed = 0.5f;
break;
case 7:
FadePlayerRollTo(0.0f, 15.0f, 15.0f);
fCaveInSpeed = 2.0f;
break;
case 8:
PlaySoundAtEntity("sight2", "react_sigh", "Player", 0.4f, false);
FadeIn(2.0f);
FadePlayerRollTo(30.0f, 8.0f, 8.0f);
MovePlayerHeadPos(0.0f, 0.8f, 0.5f, 0.7f, 0.5f);
PlaySoundAtEntity("cloth3", "player_crouch", "Player", 0.2f, false);
break;
case 9:
StartPlayerLookAt("AreaLook_1", 1.0f, 0.5f, "");
fCaveInSpeed = 0.5f;
break;
case 10:
FadePlayerRollTo(30, 30.0f, 30.0f);
PlaySoundAtEntity("cloth4", "player_stand", "Player", 0.2f, false);
fCaveInSpeed = 0.5f;
break;
case 11:
FadePlayerRollTo(0, 0.0f, 0.0f);
PlaySoundAtEntity("cloth5", "player_climb", "Player", 0.5f, false);
fCaveInSpeed = 0.5f;
break;
case 12:
StartPlayerLookAt("AreaLook_2", 1.5f, 1.5f, "");
fCaveInSpeed = 1.0f;
break;
case 13:
SetPlayerCrouchDisabled(false);
SetPlayerJumpDisabled(false);
FadePlayerRollTo(0, 8.0f, 8.0f);
MovePlayerHeadPos(0.0f, 0.0f, 0.0f, 0.8f, 0.8f);
break;
case 14:
SetPlayerActive(true);
break;
}




if(GetLocalVarInt("fCaveInSpeed") < 14) AddTimer("", fCaveInSpeed, "TimerCaveInDone");
}




void TimerCaveIn(string &in asTimer)
{
if(asTimer == "1"){
CreateParticleSystemAtEntity("cavein", "ps_break_cavein_local", "cave_in", false);
PlaySoundAtEntity("caveins", "explosion_rock_large", "cave_in", 0.0f, false);
TeleportPlayer("PlayerStartArea_5");
}
else if(asTimer == "3"){
StopSound("rumble", 3.0f);
}
}
11-05-2013, 07:27 PM
Find
Neelke Offline
Senior Member

Posts: 668
Threads: 82
Joined: Apr 2013
Reputation: 26
#4
RE: Camera angle turns upside down

Could you please tell me what you changed? I wanna know what you did so I might not do that same mistake again.
11-05-2013, 07:57 PM
Find
Icaab2608 Offline
Member

Posts: 85
Threads: 37
Joined: Jul 2013
Reputation: 0
#5
RE: Camera angle turns upside down

(11-05-2013, 07:57 PM)Neelke Wrote: Could you please tell me what you changed? I wanna know what you did so I might not do that same mistake again.
Ok:
void OnStart ()
{
AddEntityCollideCallback("Player", "Collapse", "TimerCollapse", true, 0);
}
void TimerCollapse(string &in asParent, string &in asChild, int alState)
{
FadeOut(0.3);
StopMusic(0.3f, 0);
StartScreenShake(0.1, 4.7, 0.05, 0.5);
FadePlayerFOVMulTo(0.5, 3);
PlaySoundAtEntity("", "general_rock_rumble_no3d.snt", "Player", 0.5, true);
FadePlayerFOVMulTo(4.0f, 4.0f);
SetRadialBlurStartDist(0.1f);
FadeRadialBlurTo(1.0f, 5.0f);
StartEffectFlash(0.2, 0.1,0.3);
SetPlayerActive(false);
SetPlayerCrouchDisabled(true);
SetPlayerJumpDisabled(true);
AddTimer("caveindone", 3.5f, "TimerCaveInDone");
AddTimer("1", 1.0f, "TimerCaveIn");
AddTimer("3", 3.0f, "TimerCaveIn");
}
void TimerCaveInDone(string &in asTimer)
{
float fCaveInSpeed = 1.0f;
AddLocalVarInt("fCaveInSpeed", 1);
switch(GetLocalVarInt("fCaveInSpeed")){
case 1:
FadeIn(2.0f);
MovePlayerHeadPos(0.0f, 0.8f, 0.5f, 0.8f, 0.8f);
FadePlayerRollTo(30.0f, 2.0f, 2.0f);
StartPlayerLookAt("AreaLook_1", 1.2f, 1.2f, "");
PlayMusic("15_event_elevator.ogg", false, 1.0, 0.5, 10, false);
//To avoid it happen again
SetLevelDoorLocked("level_engine_1", true);
SetEntityPlayerInteractCallback("level_engine_1", "InteractCollapsedDoor", false);
fCaveInSpeed = 1.0f;
break;
case 2:
PlaySoundAtEntity("cloth1", "player_crouch", "Player", 0.2, false);
MovePlayerHeadPos(0.0f, 0.8f, 0.5, 1.2f, 1.2f);
fCaveInSpeed = 1.5f;
break;
case 3:
StartPlayerLookAt("AreaLook_2", 0.5f, 0.5f, "");
FadeOut(5.0f);
PlaySoundAtEntity("sight1", "react_sigh", "Player", 0.5f, false);
fCaveInSpeed = 2.0f;
break;
case 4:
StartPlayerLookAt("AreaLook_3", 2.5f, 2.5f, "");
FadeIn(2.0);
FadePlayerRollTo(30.0f, 6.0f, 6.0f);
break;
case 5:
PlaySoundAtEntity("sight1", "react_sigh", "Player", 0.5, false);
StartPlayerLookAt("AreaLook_1", 0.5f, 0.5f, "");
FadePlayerRollTo(30.0f, 10.0f, 10.0f);
FadeOut(3.0);
break;
case 6:
PlaySoundAtEntity("cloth2", "player_climb", "Player", 0.2, false);
MovePlayerHeadPos(0.0f, 0.5f, 0.25f, 0.5f, 0.5f);
fCaveInSpeed = 0.5f;
break;
case 7:
FadePlayerRollTo(0.0f, 15.0f, 15.0f);
fCaveInSpeed = 2.0f;
break;
case 8:
PlaySoundAtEntity("sight2", "react_sigh", "Player", 0.4, false);
FadeIn(2.0);
FadePlayerRollTo(30.0f, 8.0f, 8.0f);
MovePlayerHeadPos(0.0f, 0.8f, 0.5f, 0.7f, 0.5f);
PlaySoundAtEntity("cloth3", "player_crouch", "Player", 0.2, false);
break;
case 9:
StartPlayerLookAt("AreaLook_1", 1.0f, 0.5f, "");
fCaveInSpeed = 0.5f;
break;
case 10:
FadePlayerRollTo(30, 30.0f, 30.0f);
PlaySoundAtEntity("cloth4", "player_stand", "Player", 0.2, false);
fCaveInSpeed = 0.5f;
break;
case 11:
FadePlayerRollTo(0, 0.0f, 0.0f);
PlaySoundAtEntity("cloth5", "player_climb", "Player", 0.5, false);
fCaveInSpeed = 0.5f;
break;
case 12:
StartPlayerLookAt("AreaLook_2", 1.5f, 1.5f, "");
fCaveInSpeed = 1.0f;
break;
case 13:
SetPlayerCrouchDisabled(false);
SetPlayerJumpDisabled(false);
FadePlayerRollTo(0, 8.0f, 8.0f);
MovePlayerHeadPos(0.0f, 0.0f, 0.0f, 0.8f, 0.8f);
break;
case 14:
SetPlayerActive(true);
break;
}
if(GetLocalVarInt("fCaveInSpeed") < 14) AddTimer("", fCaveInSpeed, "TimerCaveInDone");
}
void TimerCaveIn(string &in asTimer)
{
if(asTimer == "1"){
CreateParticleSystemAtEntity("cavein", "ps_break_cavein_local", "cave_in", false);
PlaySoundAtEntity("caveins", "explosion_rock_large", "cave_in", 0.0f, false);
TeleportPlayer("PlayerStartArea_5");
}
else if(asTimer == "3"){
StopSound("rumble", 3.0f);
}
}
Next, I think you'll all understand.
If that fails, it is better to download notepad:http://wiki.frictionalgames.com/hpl2/thi...xt/notepad.
11-06-2013, 05:43 PM
Find




Users browsing this thread: 2 Guest(s)