Ironman5000 Posted April 7, 2014 Share Posted April 7, 2014 I am working on my horror mod wip, and thought of a great way to add some surprises for the player by having things appear and disappear BEHIND the player only so what I need is a command which will only enable a initially disabled object when the player is looking 180 degrees in the opposite direction. I have no problem setting up the environment and general script layout but not how to set this up, however I have seen it done in a HL2 horror mod...which actually gave me the idea to implement it in my mod. So can anyone help me out with this or point me in the right direction? Link to comment Share on other sites More sharing options...
Hopper31 Posted April 7, 2014 Share Posted April 7, 2014 (edited) You could use player.getlos on an object near the enable point. Like this Scn <name> int Ready int DoOnce Begin Gamemode If ( Ready == 1 ) && ( Player.GetLOS == 0 ) && (DoOnce == 0 ) spook.Enable ;replace spook with the creatures/objects REF Set DoOnce to 1 Endif End Then put the object somewhere near the thing you want to spawn, like on a wall behind it or on the floor. Have a trigger somewhere set the ready var to 1. Then as soon as the player looks away from this object the thing will spawn. At least I believe that this will work. On an unrelated note you're working on a horror mod as well? EDIT: Whoops I misread what you wrote, let me adjust the script. EDIT 2: Okay I think I have what you requested now. Edited April 7, 2014 by Hopper31 Link to comment Share on other sites More sharing options...
Ironman5000 Posted April 7, 2014 Author Share Posted April 7, 2014 Cool thanks i'll test that out later tonight and let you know if it works :) Yea i'm picking away at a large horror quest mod with a couple of new worldspaces and dungeons, I started a thread for it here :) Link to comment Share on other sites More sharing options...
Hopper31 Posted April 7, 2014 Share Posted April 7, 2014 Well if you need any more help with it feel free to ask. I've released a small scale horror mod so feel free to take anything from that if necessary. :D Link to comment Share on other sites More sharing options...
jazzisparis Posted April 8, 2014 Share Posted April 8, 2014 For your purpose, GetHeadingAngle would be much more suitable. It also returns the exact angle between the player and target. GetLOS is unreliable when called on the player. Link to comment Share on other sites More sharing options...
Recommended Posts