Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
MSPaintR0cks

How to solve this via scripts? (Security Camera)

Recommended Posts

A little help would be very appreciated with this problem. (=

Okay, I have this guy here who is supossed to check the area of the room with monitors that are attached to each side of the "cube":



Every second, his view is switching to the right from monitor to monitor across the cube, so that the player is able to move in the areas where he isn`t looking at the moment.
When he sees you, the alarm goes off and shit hits the fan.

And here is the problem:
How can I ask the engine if the player is in view of that guy?
I already made four sectors around the cube that resemble his sight areas.
When he is, for example, looking from the north wall of the cube, the sector in front of the northern wall is supossed to activate a script (which triggers the alarm and stuff) when the player is inside of it during that time. I couldn`t make that happen so far.
It doesn`t work with the Sector Action Thingies in Zdoom (like Actor Hits Floor or Actor Enters Sector), since they can`t be deactivated for a while and only work when the player moves inside the sector. When the player already stands in that sector which turns into the sight area, nothing happens.

Share this post


Link to post

Have you thought about having an invisible actor whose see state would call the alarm script? Then you could have map spots in front of each camera texture, and have the camera switch script move that invisible object from map spot to map spot in the same time as it moves the camera display from screen to screen.

Share this post


Link to post

Nice glass. Actually, I'm just loving all of the art in this TC.

Gez said:

Have you thought about having an invisible actor whose see state would call the alarm script? Then you could have map spots in front of each camera texture, and have the camera switch script move that invisible object from map spot to map spot in the same time as it moves the camera display from screen to screen.

This sounds like the most elegant solution.

As a detail, have considered changing the lighting in the sector he's viewing, so the playing has some other sort of visual cue? You're the one playing it, so maybe it's easier than it looks, but it seems like it would be very difficult to avoid his gaze (again, I don't know; perhaps this is the intention).

Again again: Looks fantastic. [:

Share this post


Link to post

Hey, thanks a lot to both of you, it works wonderfully. 8D
I had no idea you could add scripts inside the decorate file.
Schwerpunk, thanks for those kind words. Stuff like that keeps me very motivated. ;)

Share this post


Link to post

Another option would be: use a global variable to keep track of which sight zone the player is in (including "none" as an option) and update this zone every time the player enters a sector (whether or not it's currently being looked at). Whenever the player changes zone or the active sight zone changes, check whether the player is in the currently-active zone; if so, activate the alarm script.

This method has the advantage of being able to explicitly specify the sight zones, rather than relying on an actor's vision to handle it for you.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×