Jump to content

Script for enabling/disabling relating to player viewpoint?


Ironman5000

Recommended Posts

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

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 by Hopper31
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...