Frictional Games Forum (read-only)
Looking around upon start - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Looking around upon start (/thread-17627.html)

Pages: 1 2


Looking around upon start - The Shanus - 08-10-2012

So I forgot how to make the player look around properly, it would seem. What I want to do, is have the player look at a few objects as he spawns. I tried to make him collide with his own spawn area, as you see, but it didn't work. I'm not sure what to do p: It's 2.30am here so I'll be posting this and checking for replies in the morning. Thanks in advance.
PHP Code:
void OnStart()
{
SetPlayerLampOil(0.35f);
SetPlayerActive(false);
SetPlayerLookSpeedMul(0.2f);
FadeRadialBlurTo(0.5f3.0f);
SetSanityDrainDisabled(true);
SetInventoryDisabled(false);
BlockDefaultHints();
FadeIn(3);
FadePlayerFOVMulTo(11);;
SetPlayerRunSpeedMul(0);
MovePlayerHeadPos(0, -1.5f0100.5f);
SetSanityDrainDisabled(true);
AddEntityCollideCallback("Player""PlayerStartArea_1""lookingaround1"true1); 
}
void lookingaround1(string &in asTimer)
{
StartPlayerLookAt("invisible_box_mass_3"5.0f5.0f"");
AddTimer(""3.0f"StopLook");
}
void StopLook(string &in asTimer
{
  
StopPlayerLookAt();
}
void BlockDefaultHints()
{
    
BlockHint("DarknessDecrease");
    
BlockHint("PickLantern");
    
BlockHint("PickTinderbox");
    
BlockHint("SanityHit");
    
BlockHint("SanityLow");
}

void OnEnter()
{





RE: Looking around upon start - Statyk - 08-10-2012

The syntax is incorrect.

void lookingaround1(string &in asParent, string &in asChild, int alState)


RE: Looking around upon start - Theforgot3n1 - 08-10-2012

(08-10-2012, 01:03 AM)Statyk Wrote: The syntax is incorrect.

void lookingaround1(string &in asParent, string &in asChild, int alState)
And also, double ";" at

FadePlayerFOVMulTo(1, 1);;


RE: Looking around upon start - The Shanus - 08-10-2012

(08-10-2012, 05:04 AM)Theforgot3n1 Wrote:
(08-10-2012, 01:03 AM)Statyk Wrote: The syntax is incorrect.

void lookingaround1(string &in asParent, string &in asChild, int alState)
And also, double ";" at

FadePlayerFOVMulTo(1, 1);;
Changed both, but it didn't fix it p: I think the problem is my callback, no?

EDIT: Yes, the problem was with the callback, but now I have another problem - When he looks at the object, his head rolls and unnaturally turns 90 degrees.


RE: Looking around upon start - Theforgot3n1 - 08-10-2012

(08-10-2012, 08:33 AM)The Shanus Wrote:
(08-10-2012, 05:04 AM)Theforgot3n1 Wrote:
(08-10-2012, 01:03 AM)Statyk Wrote: The syntax is incorrect.

void lookingaround1(string &in asParent, string &in asChild, int alState)
And also, double ";" at

FadePlayerFOVMulTo(1, 1);;
Changed both, but it didn't fix it p: I think the problem is my callback, no?
Code:
void OnStart()
{
SetPlayerLampOil(0.35f);
SetPlayerActive(false); // With SetPlayerActive you can't look around, since it removes ALL player-controls.
//SetPlayerLookSpeedMul(0.2f);
FadeRadialBlurTo(0.5f, 3.0f);
SetSanityDrainDisabled(true);
SetInventoryDisabled(false);
BlockDefaultHints();
FadeIn(3);
FadePlayerFOVMulTo(1, 1);
//SetPlayerRunSpeedMul(0);
MovePlayerHeadPos(0, -1.5f, 0, 10, 0.5f);
//SetSanityDrainDisabled(true); //duplicates?
lookingaround1();
}
void lookingaround1()
{
StartPlayerLookAt("invisible_box_mass_3", 5.0f, 5.0f, ""); // Why not use an area? :)
AddTimer("", 3.0f, "StopLook");
}
void StopLook(string &in asTimer)
{
  StopPlayerLookAt();
}
void BlockDefaultHints()
{
    BlockHint("DarknessDecrease");
    BlockHint("PickLantern");
    BlockHint("PickTinderbox");
    BlockHint("SanityHit");
    BlockHint("SanityLow");
}

void OnEnter()
{

}

Does this work for you?

I honestly don't get what it is you actually need help with.


RE: Looking around upon start - The Shanus - 08-10-2012

(08-10-2012, 08:59 AM)Theforgot3n1 Wrote:
(08-10-2012, 08:33 AM)The Shanus Wrote:
(08-10-2012, 05:04 AM)Theforgot3n1 Wrote:
(08-10-2012, 01:03 AM)Statyk Wrote: The syntax is incorrect.

void lookingaround1(string &in asParent, string &in asChild, int alState)
And also, double ";" at

FadePlayerFOVMulTo(1, 1);;
Changed both, but it didn't fix it p: I think the problem is my callback, no?
Code:
void OnStart()
{
SetPlayerLampOil(0.35f);
SetPlayerActive(false); // With SetPlayerActive you can't look around, since it removes ALL player-controls.
//SetPlayerLookSpeedMul(0.2f);
FadeRadialBlurTo(0.5f, 3.0f);
SetSanityDrainDisabled(true);
SetInventoryDisabled(false);
BlockDefaultHints();
FadeIn(3);
FadePlayerFOVMulTo(1, 1);
//SetPlayerRunSpeedMul(0);
MovePlayerHeadPos(0, -1.5f, 0, 10, 0.5f);
//SetSanityDrainDisabled(true); //duplicates?
lookingaround1();
}
void lookingaround1()
{
StartPlayerLookAt("invisible_box_mass_3", 5.0f, 5.0f, ""); // Why not use an area? :)
AddTimer("", 3.0f, "StopLook");
}
void StopLook(string &in asTimer)
{
  StopPlayerLookAt();
}
void BlockDefaultHints()
{
    BlockHint("DarknessDecrease");
    BlockHint("PickLantern");
    BlockHint("PickTinderbox");
    BlockHint("SanityHit");
    BlockHint("SanityLow");
}

void OnEnter()
{

}

Does this work for you?

I honestly don't get what it is you actually need help with.
Check the bold edit! Big Grin Then maybe you can help [; But thanks for the duplicate. It's for an intro, so I don't want the player to be able to control it - imagine it as a cinematic of sorts.

EDIT: Forget it, I just had to move the box he was looking at.


Looking around, player seems to get bored of it. - The Shanus - 08-10-2012

Hey guys, so I've got my guy looking around, but for some reason, after looking at his right arm, he gets lazy, and decides to just stay looking at it, even though I see nothing wrong with the functions. He doesn't go on to look at his bloody chest or the scientist, and I'm not sure why.

Here's the relevant script:
PHP Code:
AddEntityCollideCallback("Player""corpse_male_1""lookingaround1"true1); 
AddEntityCollideCallback("Player""wakeuparea""wakeup"true1); 
}

void lookingaround1(string &in asParentstring &in asChildint alState
{
StartPlayerLookAt("invisible_box_mass_3"4.0f4.0f"");
AddTimer(""7.0f"lookatleftarm");
}

void wakeup(string &in asParentstring &in asChildint alState
{
FadeOut(0.0f);
AddTimer(""3.0f"wakeup2");
}

void wakeup2(string &in asTimer)
{
FadeIn(4.0f);
}

void lookatleftarm(string &in asTimer)
{
StartPlayerLookAt("invisible_box_mass_4"3.0f3.0f"");
AddTimer(""2.0f"lookatrightarm");
}

void lookatrightarm(string &in asTimer)
{
StartPlayerLookAt("invisible_box_mass_5"3.0f3.0f"");
AddTimer(""2.0f"lookatbloodychest");
}

void lookatbloodychest(string &in asTimer)
{
StartPlayerLookAt("blood_pool_static_2"3.0f3.0f"");
AddTimer(""2.0f"lookatscientist");
}

void lookatscientist(string &in asTimer)
{
StartPlayerLookAt("plane_black_plane_black_1"1.0f2.0f"");
AddTimer(""30.0f"StopLook");
}

void StopLook(string &in asTimer
{
  
StopPlayerLookAt();




RE: Looking around, player seems to get bored of it. - Ongka - 08-10-2012

I think you have to add a StopPlayerLookAt; in the beginning of a new LookAtTimer.



RE: Looking around, player seems to get bored of it. - The Shanus - 08-10-2012

(08-10-2012, 11:42 AM)Ongka Wrote: I think you have to add a StopPlayerLookAt; in the beginning of a new LookAtTimer.
But it works for the first three, so why not for the rest? p:


RE: Looking around, player seems to get bored of it. - Ongka - 08-10-2012

It may also be that this function doesn't work on static objects, because the blood pool is either a decal or static object and the black plane also.
And you don't have to use invisible box masses, you can just use areas for look-ats.