Ungotter
Junior Member
Posts: 11
Threads: 3
Joined: Sep 2012
Reputation:
0
|
Making two StartPlayerLookAt one after the other?
I feel like I'm being a burden by using these forums almost frequently, but I'm really stuck right now.
My goal here is to have a player look at something, then after that is done, look behind him, so this happens pretty much immediately after the first look is done. Yes, I did post a thread asking how to do the whole thing this is based around, but this is a new problem completely.
What happens is that the player doesn't look a second time, the sound plays and everything works as should, except the second StartPlayLookAt. Can anyone explain why this doesn't work? Please I've been trying to get this to work for hours last night and hours today, I've gone through the script functions on the wiki and found nothing.
void OnStart()
{
AddDebugMessage("OnStart!", false);
AddEntityCollideCallback("Player", "BottleFallArea", "BottleFall", true, 1);
AddEntityCollideCallback("Player", "BodyAlley", "BodyAlleyScare", true, 1);
}
void OnEnter()
{
AddDebugMessage("OnEnter!", false);
}
void OnLeave()
{
AddDebugMessage("OnLeave!", false);
}
void BottleFall(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("wine02_1", true);
}
void BodyAlleyScare(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("corpse_male_1", 4.0f, 4.0f, "");
GiveSanityDamage(5.0f, true);
AddTimer("BodyAlleyTimer", 3.0f, "Timer_01");
}
void Timer_01(string &in asTimer)
{
StopPlayerLookAt();
StartPlayerLookAt("stairs_railing_worn_11", 4.0f, 4.0f, "");
PlaySoundAtEntity("PlatformDoor", "16_bridge_unstuck", "castle_portcullis_3", 0.1f, false);
AddTimer("BodyAlleyTimer2", 3.0f, "Timer_02");
}
void Timer_02(string &in asTimer)
{
StopPlayerLookAt();
}
(This post was last modified: 09-16-2012, 04:51 PM by Ungotter.)
|
|
09-16-2012, 03:34 PM |
|
Robby
Posting Freak
Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation:
47
|
RE: Making two StartPlayerLookAt one after the other?
Try removing the "StopPlayerLookAt" function from "Timer_01".
Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
|
|
09-16-2012, 03:36 PM |
|
Ungotter
Junior Member
Posts: 11
Threads: 3
Joined: Sep 2012
Reputation:
0
|
RE: Making two StartPlayerLookAt one after the other?
(09-16-2012, 03:36 PM)Nemet Robert Wrote: Try removing the "StopPlayerLookAt" function from "Timer_01". I just gave it a whirl and it doesn't swap where the player looks. It just continues to look at the first for the length of time for both timers Thanks anyway!
|
|
09-16-2012, 03:48 PM |
|
Robby
Posting Freak
Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation:
47
|
RE: Making two StartPlayerLookAt one after the other?
The script doesn't seem to have problems. Syntaxes are correct, everything else seems to be normal. Are you sure that both names used by the "StartPlayerLookAt" functions are 100% correct and match the ones in the Level Editor?
Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
|
|
09-16-2012, 03:51 PM |
|
Ungotter
Junior Member
Posts: 11
Threads: 3
Joined: Sep 2012
Reputation:
0
|
RE: Making two StartPlayerLookAt one after the other?
(09-16-2012, 03:51 PM)Nemet Robert Wrote: The script doesn't seem to have problems. Syntaxes are correct, everything else seems to be normal. Are you sure that both names used by the "StartPlayerLookAt" functions are 100% correct and match the ones in the Level Editor? Absolutely, I copied and pasted them straight from the editor
|
|
09-16-2012, 03:52 PM |
|
Robby
Posting Freak
Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation:
47
|
RE: Making two StartPlayerLookAt one after the other?
Try using script areas to look at. Place them where you want the player to look to.
Again, double-check the names.
Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
|
|
09-16-2012, 03:54 PM |
|
Ungotter
Junior Member
Posts: 11
Threads: 3
Joined: Sep 2012
Reputation:
0
|
RE: Making two StartPlayerLookAt one after the other?
I'll give it a go now, check back in a few minutes and I'll have replied
Edit: Hm, it works perfectly now. Thank you! Why does this occur though? Why am I unable to look at the prop and so have to use a script area?
(This post was last modified: 09-16-2012, 04:01 PM by Ungotter.)
|
|
09-16-2012, 03:55 PM |
|
Robby
Posting Freak
Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation:
47
|
RE: Making two StartPlayerLookAt one after the other?
Ok. Waiting...
(09-16-2012, 03:55 PM)Ungotter Wrote: Edit: Hm, it works perfectly now. Thank you! Why does this occur though? Why am I unable to look at the prop and so have to use a script area? Static objects are not props. I don't think you can look at them.
Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
(This post was last modified: 09-16-2012, 04:05 PM by Robby.)
|
|
09-16-2012, 03:56 PM |
|
Ungotter
Junior Member
Posts: 11
Threads: 3
Joined: Sep 2012
Reputation:
0
|
RE: Making two StartPlayerLookAt one after the other?
(09-16-2012, 03:56 PM)Nemet Robert Wrote: Ok. Waiting...
(09-16-2012, 03:55 PM)Ungotter Wrote: Edit: Hm, it works perfectly now. Thank you! Why does this occur though? Why am I unable to look at the prop and so have to use a script area? Static objects are not props. I don't think you can look at them. Ah I see, odd, but at least I know in future. Thanks, you've been a big help
|
|
09-16-2012, 04:07 PM |
|
Robby
Posting Freak
Posts: 2,549
Threads: 38
Joined: Jun 2009
Reputation:
47
|
RE: Making two StartPlayerLookAt one after the other?
NP.
Neither do I know why that doesn't work. But I always used Script Areas and they worked perfectly. Static Objects like walls and all that don't work (as it seems).
Infrequently active. Don't expect an immediate response. Best to contact me at a different locale. If I create a thread, expect me to be quite active.
|
|
09-16-2012, 04:09 PM |
|
|