The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Forcing view of the player to look at a door when it slams shut
DrDean Offline
Junior Member

Posts: 28
Threads: 7
Joined: Jun 2008
Reputation: 1
#1
Forcing view of the player to look at a door when it slams shut

Hi, I'm trying to do exactly what the thread title states. I got the door slam part down, but I'm having difficulty having the view change work. I should probably mention that I have no programming background, so this is all new to me.

Looking at the script functions list on the Wiki, it seems like this is exactly what I need:
void StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);
void StopPlayerLookAt();

However, I have absolutely no idea how to plop it into my current door-slam script. Where should I put it? What variables am I changing? I'm not asking you to do my work for me, but I need a push.

This is what I currently have:

void OnStart()
{
AddEntityCollideCallback("Player", "pooarea", "func_slam", true, 1);
}


void func_slam(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
}


Thanks in advance, guys.
(This post was last modified: 02-12-2012, 08:12 PM by DrDean.)
02-12-2012, 07:05 PM
Find


Messages In This Thread
Forcing view of the player to look at a door when it slams shut - by DrDean - 02-12-2012, 07:05 PM



Users browsing this thread: 1 Guest(s)