Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Security camera can see possible in theory?

Author
Message
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 27th Dec 2011 19:14 Edited at: 27th Dec 2011 19:24
I am trying to get the model 2 pack animated security camera to be able to see the player. It seems that in theory what I have tried should work, but it doesn't I am starting to wonder if it's possible, in nothing more than theory.

This is the fpi script I used for the camera. What I am trying to do is have the camera see the player and set of an alarm and also spawn entities in response to the alarm.
[:state=0:animate=1,state=1
:state=1,plrdistfurther=200,plrcanbeseen:state=0,activate=1,loopsoun=$0
:state=1,plrdistfurther=200,plrcannotbeseen:state=0
:state=1,plrdistwithin=200,plrcanbeseen:state=0,activate=1,loopsound=$0
State=1,plrdistwithin=200,plrcannotbeseen:state=0

;end of script]

I have also tried it without the plrdistwithin=xxx and plrdistfurther=xxx and just the plrcanbeseen or plrcannotbeseen conditions and the alarm doesn't sound at all.



I have also editid the camera's fpe script to include visuals by adding view cone height and width to the main fpe script

The problem I am having is I want the player to avoid being seen by the camera, slip in behind it and sneak to the room where he can shut the camera's off. The script above kinda works but the alarm still goes off if I am within 200 but hidden from view of the camera. I haven't quite figured out how I will make the cameras shut off yet. One thing at time.

So I am wondering after a few hours of messing with it last night I am left wondering is this possible in theroy and just not in execution? I have a feeling though it's completely possible I am just missing a small thing somewhere. You help will be greatly appreciated.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 27th Dec 2011 21:32
I take it you mean MGS style cameras... hope someone posts soon... would love to add something similar to my tech demo next month...

angusm3
15
Years of Service
User Offline
Joined: 6th Mar 2009
Location: Right behind you...
Posted: 27th Dec 2011 21:35
this would work a lot better if the camera thought it was a person and the camera was a head, then it would have a field of view option and you could make it more realistic

you left the "d" out of "loopsoun=$0" by the way

if the player is within less than a half of a segment then the camera will see the player and... activate anything that is in it's immediate area

replace activate=1 with activateifused=1

I appear to have burst into flames...
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 27th Dec 2011 22:16
How do I increase the half segment distance. If the camera was a head I wouldnt be posting the question. I wrote thy script on A different computer than I use for fpsc so I was typing from memory. The original script has activateifused=1 and works correctly as well as the loopsound. Just getting the camera to see is the issue. So why can't I make the camera think its a head?
angusm3
15
Years of Service
User Offline
Joined: 6th Mar 2009
Location: Right behind you...
Posted: 27th Dec 2011 22:37
because it's not a bipedal model, it's just an entity. Sorry but this camera (unless you re rig it) cannot actually see where the player is without some clever use of... lights? you might be able to make some lights that are trigger zones and have them on timers so that they sync up with the camera motion, I'll leave you to see if you can do that.

I appear to have burst into flames...
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 27th Dec 2011 22:46
Is It me or is that a totally unhelpful answer?
Akanto10
14
Years of Service
User Offline
Joined: 24th Apr 2010
Location: Earth
Posted: 27th Dec 2011 23:07
An entity can only correctly use "plrcanbeseen" and "plrcannotbeseen" if it's a character. You'd have to copy a .fpe from a stock character and edit it to fit the security camera's specifications (model, texure, etc). Then it may work; no guarantees, however.

Happy to help,
Akanto

| Windows 7 Home Premium 64 - Bit | AMD Athlon II X4 630 @ 2.8GHz | Nvidia GeForce GTX 460 1GB | 6GB DDR3 RAM | 1TB HDD |
angusm3
15
Years of Service
User Offline
Joined: 6th Mar 2009
Location: Right behind you...
Posted: 27th Dec 2011 23:25
*sigh*
try making an invisible character stand underneath the camera and have him look left and right at the same time as the camera, set his fov to something low like 10, is that helpful?

I appear to have burst into flames...
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 27th Dec 2011 23:38
You knownif it's such a hassle answering questions don't answer them. Sorry to be a bother. Anyone else want to help me out. Apparently my question is too simple for some people.
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 28th Dec 2011 00:07
You can always add "ischaracter=1" to the cameras .fpe file to allow it to use character specific features.

Other than that, you need to proofread your script and fix the errors. The last line (which is redundant) doesn't begin with a colon, loopsoun is not valid, and I don't know if you're trying to use those "[" brackets or not.

:state=0:animate=1,state=1
:state=1,plrdistwithin=200,plrcanbeseen:activate=1,loopsound=$0

;end of script

If that works, and I don't know if it will, you may need to assign a field of view to the camera too.

Brian.

!retupmoc eht ni deppart m'I !pleH

angusm3
15
Years of Service
User Offline
Joined: 6th Mar 2009
Location: Right behind you...
Posted: 28th Dec 2011 00:15
sorry but I was trying to offer a helpful answer, and it would appear that if "ischaracter=1" makes the camera act like I hope it does then it would be the same as my last solution only much simpler.

I appear to have burst into flames...
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 28th Dec 2011 03:49
Ok thanks for that. Ischaracter=1
:state=0,ischaracter=1:state=1,animate=1
:state=1,plrdistwithin=200,plrcanbeseen: etc

That look right?
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 28th Dec 2011 04:08
Not quite...

ischaracter=1 is an FPE value Put it in the cameras .fpe file, not the fpi script.

Brian.

!retupmoc eht ni deppart m'I !pleH

defiler
15
Years of Service
User Offline
Joined: 4th Apr 2009
Location: Canada
Posted: 28th Dec 2011 08:55
Idea(not sure if i am thinking it right): Have a light be given two states: ON and OFF, ON would be 1, and OFF would be 0.

Now, if say the camera was at a certain point in its animation, the light would go to the ON state which is the 1 value, and if anything went in the light bounds, it would trigger whatever you wanted to be triggered.

If it was facing away from the hallway or whatever, it would go to OFF which would be the value of 0, and it would ignore anything that went in the lights bounds until it goes to 1.

I could be wrong, but i just wanted to voice what i was thinking.

Current Project: Lost Contact: Chapter 1
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 28th Dec 2011 08:59
Hmm an idea came to mind... stick a red/green light on it to indicate to the player... will this camera be destroyable like in if I remember correctly... Project IGI?

Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 28th Dec 2011 09:08
No I want the player to get by a series of cameras by hiding in the cameras blind spot and get to the room and shut down the cameras. Then back track to pick up the key he needs to advance. One camera is placed infront of the room where the key is.
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 28th Dec 2011 16:29
Defiler it just seems that it should be easier than all that. The plrdist condition works just fine, which leads me to think that the plrcanbeseen condition should work fine as well if I can just figure out how to get the camera to see.
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 28th Dec 2011 17:00
Heres an interesting question... are there no debug tools for FPSC?... Sorry I have not dabbled enough into FPSC yet...

xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 28th Dec 2011 17:16
The only thing I can think of is to use the animation frames, such as - if the camera is center of animation and the player is within range, then... Otherwise, I don't know how to make a camera see. The camera is always facing in the same direction. It doesn't turn and face like a character, it only animates. Even it would accept a field of view, it still only looks in one direction. That may be all you have to work with.

Perhaps the Fox will stop by and help to illuminate the situation.

Brian.

!retupmoc eht ni deppart m'I !pleH

MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 28th Dec 2011 17:23
Brian... that always sounds like a summoning lol

Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 28th Dec 2011 18:07
I see X(no pun intended) Thank you for the insight. That makes sense. In regards to my script, I am slowly slogging through learning how to script. I very much appreciate the input on that, I learn way more when I get something wrong. You know probably the easiest solution would be to have the ability to reshape a triggerzone. so instead of a square I could make a cone shape, and that would be the camera view.

I suppose I could also use two camera's on opposite walls and write a second script so the plrdistwithin=xxx leave gaps that the player has to find.
xplosys
18
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 28th Dec 2011 18:19 Edited at: 28th Dec 2011 18:26
You could use a static camera and place it so that there is a path that it never sees, then use a zone or other objects to determine if the player strays from that path? You might even entice him to by placing something he wants where he shouldn't go.

Brian.

!retupmoc eht ni deppart m'I !pleH

Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 28th Dec 2011 18:26
X,
Good that might just work, and be a whole lot of less work.
maho76
13
Years of Service
User Offline
Joined: 31st May 2011
Location: universe-hub, playing the flute
Posted: 29th Dec 2011 09:29
just one little other idea as a workaround with the ai/character to use. setup a new weapon using the camera-model. place invisible character using this "cam-gun". write a script with etimed rotation. when plr in fov, settarget = camera rotates unless character spots the player, then cam points to player.

maybe it works.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 29th Dec 2011 17:14 Edited at: 29th Dec 2011 17:18
I assume we are talking about the camera entity from Modern Day 2- the animated camera. I use the camera in one of our developments and the following script is attached to the camera's main script field.



From how I have this particular level, I used the "plrdistwithin=250" to give the best result. The player does have a "secondary" route to use to get past, but if they get within that distance, then the alarm starts and the guard inside the guard shack is "spawned". I could modify it to include lights coming on, etc.

Quote: "Now, if say the camera was at a certain point in its animation, the light would go to the ON state which is the 1 value, and if anything went in the light bounds, it would trigger whatever you wanted to be triggered."


Defiler hit the nail on the head perfectly. We made a camera and BlueFox animated it. We have a bunch of frames and have 4 groups of "animations". Here is what I mean.

1. Camera is placed and it faces straight. That is start position or position 0.
2. Camera rotates 45 degrees left and stops. That is position 1 (animate=1).
3. Camera rotates 45 degrees back to start position. That is position 2 (animate=2).
4. Camera rotates 45 degrees to the right and stops. That is position 3 (animate=3).
5. Camera rotates 45 degrees back to the start position. That is position 4 (animate=4).

I can then script my camera using the "animate=#" when I want it to rotate in a certain position at a certain time. I can script it to include lights, alarms, etc when a certain animation is run.


Twitter: @NFoxMedia
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 29th Dec 2011 20:02
Blue,

The thing is I would like to have the player hide and wait for the camera to turn away then move in behind it. Which is why I inquired about making the camera see. I tried adding the ischaracter=1 to the fpe but it didn't work. I suppose what I could do is just add a "guard" under the camera and use the plrcanbeeseen condition in the script and remove the plrdist condition. Something else that just came to mind. I am not sure if it will work though. Couldn't I say place a few barrels in front of the view of the camera, then place a trigger zone above the barrels, so it's more or less off the ground at barrel height, so as long as the player is ducking behind the barrels he is fine, the second he stand up he trips the zone and sets off the alarm? I might just try that and see how it works/if it works.
BlackFox
FPSC Master
16
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 29th Dec 2011 20:44
Quote: "Blue,"


Actually, it's Black Blue is at work...

Quote: "The thing is I would like to have the player hide and wait for the camera to turn away then move in behind it. Which is why I inquired about making the camera see. I tried adding the ischaracter=1 to the fpe but it didn't work."


I understand that. We tried a similar idea and it did not quite work the way we wanted. That's why we went the approach we did with the "plrdistwithin" in the camera script.

Quote: "Something else that just came to mind. I am not sure if it will work though. Couldn't I say place a few barrels in front of the view of the camera, then place a trigger zone above the barrels, so it's more or less off the ground at barrel height, so as long as the player is ducking behind the barrels he is fine, the second he stand up he trips the zone and sets off the alarm? I might just try that and see how it works/if it works. "


I have a prefab where the player hits a certain "low" spot and they miss the trigger, but if the player jumps they will hit the trigger. So in your case that could work depending on your placements or how you script the trigger/item.


Twitter: @NFoxMedia
Troutflies
13
Years of Service
User Offline
Joined: 24th Feb 2011
Location: Stuck outside my map.
Posted: 29th Dec 2011 23:36
Sorry Black. I have actually gotten a fair amount of content from your site. thanks for the insight.

Login to post a reply

Server time is: 2024-11-24 01:44:08
Your offset time is: 2024-11-24 01:44:08