The Shanus
Member
Posts: 134
Threads: 15
Joined: Jun 2012
Reputation:
3
|
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.
void OnStart() { SetPlayerLampOil(0.35f); SetPlayerActive(false); 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); AddEntityCollideCallback("Player", "PlayerStartArea_1", "lookingaround1", true, 1); } void lookingaround1(string &in asTimer) { StartPlayerLookAt("invisible_box_mass_3", 5.0f, 5.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() {
}
(This post was last modified: 08-10-2012, 09:22 AM by The Shanus.)
|
|
08-10-2012, 12:29 AM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
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 |
|
Theforgot3n1
Member
Posts: 192
Threads: 20
Joined: Apr 2012
Reputation:
6
|
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);;
|
|
08-10-2012, 05:04 AM |
|
The Shanus
Member
Posts: 134
Threads: 15
Joined: Jun 2012
Reputation:
3
|
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.
(This post was last modified: 08-10-2012, 08:56 AM by The Shanus.)
|
|
08-10-2012, 08:33 AM |
|
Theforgot3n1
Member
Posts: 192
Threads: 20
Joined: Apr 2012
Reputation:
6
|
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.
(This post was last modified: 08-10-2012, 09:00 AM by Theforgot3n1.)
|
|
08-10-2012, 08:59 AM |
|
The Shanus
Member
Posts: 134
Threads: 15
Joined: Jun 2012
Reputation:
3
|
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! 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.
(This post was last modified: 08-10-2012, 09:21 AM by The Shanus.)
|
|
08-10-2012, 09:10 AM |
|
The Shanus
Member
Posts: 134
Threads: 15
Joined: Jun 2012
Reputation:
3
|
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: AddEntityCollideCallback("Player", "corpse_male_1", "lookingaround1", true, 1); AddEntityCollideCallback("Player", "wakeuparea", "wakeup", true, 1); }
void lookingaround1(string &in asParent, string &in asChild, int alState) { StartPlayerLookAt("invisible_box_mass_3", 4.0f, 4.0f, ""); AddTimer("", 7.0f, "lookatleftarm"); }
void wakeup(string &in asParent, string &in asChild, int 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.0f, 3.0f, ""); AddTimer("", 2.0f, "lookatrightarm"); }
void lookatrightarm(string &in asTimer) { StartPlayerLookAt("invisible_box_mass_5", 3.0f, 3.0f, ""); AddTimer("", 2.0f, "lookatbloodychest"); }
void lookatbloodychest(string &in asTimer) { StartPlayerLookAt("blood_pool_static_2", 3.0f, 3.0f, ""); AddTimer("", 2.0f, "lookatscientist"); }
void lookatscientist(string &in asTimer) { StartPlayerLookAt("plane_black_plane_black_1", 1.0f, 2.0f, ""); AddTimer("", 30.0f, "StopLook"); }
void StopLook(string &in asTimer) { StopPlayerLookAt(); }
|
|
08-10-2012, 11:32 AM |
|
Ongka
Member
Posts: 225
Threads: 3
Joined: Nov 2010
Reputation:
20
|
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.
|
|
08-10-2012, 11:42 AM |
|
The Shanus
Member
Posts: 134
Threads: 15
Joined: Jun 2012
Reputation:
3
|
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:
|
|
08-10-2012, 11:45 AM |
|
Ongka
Member
Posts: 225
Threads: 3
Joined: Nov 2010
Reputation:
20
|
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.
|
|
08-10-2012, 12:25 PM |
|
|