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
Looking around upon start
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#1
Looking around upon start

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: (Select All)
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()
{



[Image: theshanusyoutube.jpg]
(This post was last modified: 08-10-2012, 09:22 AM by The Shanus.)
08-10-2012, 12:29 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Looking around upon start

The syntax is incorrect.

void lookingaround1(string &in asParent, string &in asChild, int alState)
08-10-2012, 01:03 AM
Find
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#3
RE: Looking around upon start

(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);;

Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
08-10-2012, 05:04 AM
Website Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#4
RE: Looking around upon start

(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.

[Image: theshanusyoutube.jpg]
(This post was last modified: 08-10-2012, 08:56 AM by The Shanus.)
08-10-2012, 08:33 AM
Find
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#5
RE: Looking around upon start

(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?
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.

Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
(This post was last modified: 08-10-2012, 09:00 AM by Theforgot3n1.)
08-10-2012, 08:59 AM
Website Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#6
RE: Looking around upon start

(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?
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.

[Image: theshanusyoutube.jpg]
(This post was last modified: 08-10-2012, 09:21 AM by The Shanus.)
08-10-2012, 09:10 AM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#7
Looking around, player seems to get bored of it.

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: (Select All)
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();


[Image: theshanusyoutube.jpg]
08-10-2012, 11:32 AM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#8
RE: Looking around, player seems to get bored of it.

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

[Image: 18694.png]
08-10-2012, 11:42 AM
Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#9
RE: Looking around, player seems to get bored of it.

(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:

[Image: theshanusyoutube.jpg]
08-10-2012, 11:45 AM
Find
Ongka Offline
Member

Posts: 225
Threads: 3
Joined: Nov 2010
Reputation: 20
#10
RE: Looking around, player seems to get bored of it.

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.

[Image: 18694.png]
08-10-2012, 12:25 PM
Find




Users browsing this thread: 3 Guest(s)