02-12-2012, 07:05 PM
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:
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.
Looking at the script functions list on the Wiki, it seems like this is exactly what I need:
Code:
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.

