Force player to look somewhere - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: Force player to look somewhere (/thread-18738.html) Pages:
1
2
|
Force player to look somewhere - naseem142 - 10-12-2012 First of all , i'm really sorry for flooding with help topics . This is my last one! I need help to force look the player somewhere on the map when touching a script area , there is already one which makes you look somewhere but it is triggered instantly when you enter a map , so i tried to make it trigger when touching the script area but i failed pathetically. So please help? RE: Force player to look somewhere - Robby - 10-12-2012 I'm not sure what you're trying to say. 1) You don't know HOW to make the player look at something? 2) It just doesn't work. If 2 is the answer, post your script file. RE: Force player to look somewhere - Lizard - 10-12-2012 I'll show an example, on how you can do it. //Creating the function to call First: Making the game call a function when the player enters a area. // First function First: When the player enters the area, i set the player inactive, so the that you can't move him around. Second: After the players is set inactive, i make him look at a torch. Third: I create a timer, that activates the player, so that him can move around again //Second function Activating the player Here is the example: void OnStart() { AddEntityCollideCallback("Player", "LookArea", "StareAtTourch", true, 1); } void StareAtTourch(string &in asParent, string &in asChild, int alState) { SetPlayerActive(false); StartPlayerLookAt("torch_static01_1", 6.0f, 10.0f, ""); AddTimer("activate_player", 3, "activateplayer"); } void activateplayer(string &in asTimer) { StopPlayerLookAt(); SetPlayerActive(true); } PS. 6.0f is the speed the camera turns around, and 10.0f is the maximum speed that the camera is aloud t oturn RE: Force player to look somewhere - naseem142 - 10-12-2012 (10-12-2012, 01:57 PM)Nemet Robert Wrote: I'm not sure what you're trying to say.http://www.frictionalgames.com/forum/thread-5117.html Force player to look somewhere by mastersmith98 Spoiler below!
RE: Force player to look somewhere - The chaser - 10-12-2012 But, what's your problem? It doesn't look, it doesn't stop looking? Also, that's a good thread. If you want it to stop looking, use StopPlayerLookAt(); If you want it to look somewhere, it should be like this: void OnStart () { AddEntityCollideCallback("Player", "ScriptArea", "Lookat", true, 1); } void Lookat (string &in asParent, string &in asChild, int alState); { StartPlayerLookAt("AreaLookAt", 2, 2, ""); } RE: Force player to look somewhere - naseem142 - 10-12-2012 (10-12-2012, 02:43 PM)The chaser Wrote: But, what's your problem? It doesn't look, it doesn't stop looking?The script is easy , but the timer stuff is just complicated for me. ( as a newbie it gave me a headache ) so i wont do it anymore , it wasn't necessary for my custom story though it was just a bonus. But since your here , can you help me with this door-slam script? I have no idea whats wrong with it , it looks perfect! ( I cut it out of my script so i wont need to post everything else ) Door name: doorman Script area name: slamdoor void OnStart() { AddEntityCollideCallback("Player", "doorman", "func_slam", true, 1); } void func_slam(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("doorman", 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); } RE: Force player to look somewhere - FlawlessHappiness - 10-12-2012 Do you get an error? I would recommend using AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem); or AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem); And you haven't used timers before? I suggest you to check them out! Timers are pretty good to have in your custom stories... RE: Force player to look somewhere - naseem142 - 10-12-2012 (10-12-2012, 03:02 PM)beecake Wrote: Do you get an error?Nope i don't get any errors , the door just doesn't respond to the script area >:| RE: Force player to look somewhere - The chaser - 10-12-2012 You didn't "say" to the script the name of the script area, it should be like this: Code: void OnStart() Always that it doesn't work is for the callback. Well, that's the normal issue. RE: Force player to look somewhere - naseem142 - 10-12-2012 (10-12-2012, 03:19 PM)The chaser Wrote: You didn't "say" to the script the name of the script area, it should be like this:it worked , thank you |