Camera Cycle?

Fender357

Newbie
Joined
Jul 7, 2003
Messages
1,704
Reaction score
0
There aren't any tuts out there on this. How do I get a monitor to cycle through all the cameras I have in a map? I'm not sure how to set up the I/O relationship with everything. I know it can't be hard, I'm just not very experenced with the I/O's yet.
 
Logic_case picks one out of 16 (Enter all of your cameras in there) but it's random. Logic_timer only allows you to pick one of two as far as I see.

So honestly I'm stumped. Someone?
 
hmm.. maybe if you have a logic_relay and when its triggered it changes the camera on the monitor, and it gets triggered by logic_timer. and you probobly need a logic_case in there to.. somewere :D

dont have hammer up now.. ill look into this tomorrow
 
Logic_case is only random if you use the PickRandom output.

I suggest using the logic_case, if you've got 16 or fewer cameras in the map. Set the cases to 01, 02, ... 16, then use a logic_auto to fire it with "InValue 01"; for each case, use these two outputs:

OnCaseXX
target camXX
input [whatever the relevant input is]

OnCaseXX
target logic_case
input InValue
override [XX plus 1, or if XX is 16, use 01]
delay [any reasonable delay]

That'll make the logic_case cycle through all of its cases, probably.
 
Great, that was what I was thinking but I didn't know how :).

If you got fewer cameras just place them in several cases, btw, if you couldn't figure that one out.
 
Ok...do you think you could explain it a bit more? I've never used cases or the logic_auto before. So I don't entierly get how I need to do all this stuff. I need the stupid person explanation, step by step. But thanks for figuring it out!
 
Dead-Inside said:
www.hl2 world .com <-- Read some tutorials there. Learn about I/Os. Also view http://www.valve-erc.com/srcsdk/Levels/entityio.html .. Actually it might be best to start with the VALVe documentation.

Then come back and view this thread.

Valve's documentation is wrong too often to be useful. Don't use it.

HL2World, well... I just don't like them :p

http://www.editlife.net/tutorials.php?id=1

http://www.editlife.net/entity.php?name=logic_case

http://www.editlife.net/entity.php?name=logic_auto
 
You DO like to promote your own site, though.

I'm not saying it's a bad site or anything... ;)
 
I already have a basic understanding of the I/O stuff. And those links do nothing to help me. All you did with logic_auto and logic_case is copy out what it has on the entities help list in Hammer. I get what these things do..I just don't quite get how to work with them. Its foreign to me, i just need a little step by step help to get me started understanding this stuff. And if you keep helping me and I'm still to dense to get it...then please someone make me a crappy little demo map for it. I tend to have an easyer time figuring out things when I can get my hands on it.
 
Hell if I copied out of the Hammer entity list, that thing sucks as bad as Valve's documentation. Useless.

You'll need to name your cameras cam01, cam02, ..., cam16 (if you have fewer than 16 cameras, then just stop with the last one). Then set the logic_case's cases to 1, 2, ..., 16 (as many cameras as you have). The logic_case's outputs would begin thus:

OnCase01
target cam01
input TurnOn

OnCase01
target logic_case
input InValue
override 02
delay 10

OnCase02
target cam02
input TurnOn

OnCase02
target logic_case
input InValue
override 03
delay 10

...

OnCase16
target cam16
input TurnOn

OnCase16
target logic_case
input InValue
override 01
delay 10

This would loop through all the cameras in the map, because for each camera turned on, the logic_case also tells itself to fire the next camera in ten seconds. To start the entire system you would need to use a logic_auto to fire the camera with an InValue 01 input.
 
Yeah, OnMapSpawn is the right output.

Test your map with developer-2 (developer 2 in the console) to see if anything's happening at all... You've got the logic_case's Case XX properties set to the same numbers as the InValues you're firing it with, right?
 
k....when I load the map, this message is shown every 6 seconds as it dose its thing.
input case1: case1.InValue(01)
output: (logic_case,case1) -> (Camera3,SetOn)
output: (logic_case,case1) -> (case1,InValue,6.0)
input case1: Camera3.SetOn()

And it just stays on Camera 3. Here's my little test map as I have it right now. And I'm pretty sure I have all those Case XX the same as the in values. And hey, thanks for your help with this and not just leaving me high and dry after one reply (dear lord that rhymed).
 
It's staying on Case03 because you have the third case set to 01. When the logic_case receives the InValue 01 input, it fires OnCase03, which in turn sends itself an InValue 01 input, on and on and on...
 
Ok now, but you gotta show me how to fix it. Because I thought you were suppose to have the last one in the set go back to 01.
I thought it was that,
Under the Class info Tab i have Case 01 set to 02, Case 02 set to 03, and Case 03 set to 01.

And I had it that way with the Parameter Overides.

How am I suppose to be doing this?
 
Ah. had a look at it, took a bit, but got it figured. let me clear it up.

A logic_case is a comparitive structure. It can compare up to 16 elements.

Some value is sent to it. In order, it compares it to the Case01 value, the Case02 value, etc. The values are entered in the little text-field. Your map starts with sending '01' to you case1 entity.
It compares this value to case01 (03). returns false.
compares to case02 (03). false.
compares to case03 (01). true! so it executes the outputs for OnCase03. Which is: send '01' to itself.

In short, you should:
set Case01 -> '1'
set Case02 -> '2'
set Case03 -> '3'
(without quotes, of course)

The looping is accomplished in the parameter override section, not in the comparison numbers. It's set up correctly if you make the previous changes.

One more thing. The cameras are turned on, but the monitor is not set up to display them. Need [edit: three] more outputs on your case1.

My Output: OnCase01
Target Entity: Monitor1
Target Input: SetCamera
Parameter Override: camera1
Delay: 0
Only Once: No

And so on, for each of the cameras.
 
Correct.

When the logic_case receives an input, the input override is compared to its list of cases; any case that matches the input is fired. The idea of making the logic_case loop was done by making the OnCase03 output fire the value of the Case01 property (which fires the OnCase01 output, which fires the Case02 property, which fires the OnCase02 output, which fires thee Case03 property...).

And Phisionary's addition probably wouldn't be a bad idea. I was under the impression that a monitor would take the image of any active camera, though...
 
Well, I got the case cycling through each of the cameras, turning them on, but the image wasn't changing. So I guess not?
Maybe if no camera was specified in the func_monitor, or the other cameras were turned off when one was turned on? I dunno.

[Edit]
It may help to keep you names less ambiguous. There is no need to use numerical values. The case will take input, sent as a 'parameter override' from another entity, and compare it to each of the CaseXX values until it finds a match.
I changed Case01 to blue
Case02 to red
Case03 to teal

Changed the outputs:
OnCase01 case1 InValue red
OnCase02 case1 InValue teal
OnCase03 case1 InValue blue

Changed the value initially sent by logic_auto to blue

...and it worked exactly the same.

Or that might just confuse y'all more.... :cheese:
[/Edit]
 
Thank you thank you thank you guys. Its perfect now. I'm defenitly gonna put you guys in the release notes for my map. If and when I get the damn thing textured. Thats gonna be the next bitch of a challenge :hmph:

But again, thank you!
 
Raeven0 said:
Valve's documentation is wrong too often to be useful. Don't use it.

How is Valve's documentation wrong?

Didn't they make hammer?
lol : p

-NonStopableForce
 
NonStopableForce said:
How is Valve's documentation wrong?

Didn't they make hammer?
lol : p

-NonStopableForce

They made the editor, they made the ENGINE ITSELF, so you would EXPECT their documentation to be ABSOLUTELY FLAWLESS, wouldn't you?

Last time I tried pointing out the flaws, though, I had a gargantuan mob of fanboys throwing themselves at me and stabbing me with various sharp implements. If you want an in-depth list of the documentation's flaws, email me.
 
Raeven0 said:
They made the editor, they made the ENGINE ITSELF, so you would EXPECT their documentation to be ABSOLUTELY FLAWLESS, wouldn't you?

Last time I tried pointing out the flaws, though, I had a gargantuan mob of fanboys throwing themselves at me and stabbing me with various sharp implements. If you want an in-depth list of the documentation's flaws, email me.
LOL :p :LOL:

Well, fanboys be damned, I've used the editors, the entities, and the game, and none of them are perfect... I'm not surprised the documentation isn't either, I'm just not knowledgable enough to know better. :E
I appreciate someone who is knowledgable though, and tries to help correct such faults, in whatever ways they can. :)

Lest anyone think I'm dissin valve. WEll, I am, but their editors are the only I've used, and their games are pretty much the only I play. Some quality product despite imperfections.
 
I love this freakn forum and the advanced search function.

I am so happy about this thread I'm writing a small tutorial about this and including a sample map. It will be up shortly.

Thx for the great information about this. Once I read thru it a couple times it hit me and I got it working on my second compile!
 
This is a compilation of information gathered from this thread plus a little of my own ideas:
http://www.halflife2.net/forums/showthread.php?t=75163&page=1&pp=15

Multiple monitors and cameras cycler tutorial

Download this file: Camera_cycler.zip then open the "Camera_cycle.vmf" into Hammer to use as reference.

I set up 4 'point_camera' entities and four 'func_monitor' brushes (Appearently there must be a trick to get 4 seperate monitors working using same dev/dev_xxx texture. In order for me to get them working I had to use 4 different monitor textures).

Here is a list of all entities and brushes required. Notice their names, they will be used later on and must match exactly.

4 - func_monitor brushes (all named 'monitor' without the quotes)
4 - point_camera entities (Cam1, Cam2, Cam3, Cam4)
1 - logic_case entity (cycler)
1 - logic_auto entity
----------------------------------------------------------------

1. Start out by positioning your point_camera entities and naming each one like noted...Cam1, Cam2, etc..
2. Make your monitors, name them all the same name 'monitors' (see example map).
3. Create the logic_case entity. Open object properties (alt+enter). Make logic_case 'Name' = cycler
4. Name each Casexx number (In the class info tab) like so: Case01 = 01 all the way through to Case04 = 04) see example map.
5. Click the Outputs Tab and 'Add' outputs for each camera (4 cameras = 4 Casexx #'s):

(OnCase01)
Output: OnCase01
Target: monitor
Input: SetCamera
Parameter Override: Cam2
Delay: 0.00

Output: OnCase01
Target: Cam1
Input: SetOn
Delay: 0.00

Output: OnCase01
Target: cycler
Input: InValue
Parameter Override: 02
Delay: 10.00
----------------------------------------------------------
(OnCase02)
Output: OnCase02
Target: monitor
Input: SetCamera
Parameter Override: Cam3
Delay: 0.00

Output: OnCase02
Target: Cam2
Input: SetOn
Delay: 0.00

Output: OnCase02
Target: cycler
Input: InValue
Parameter Override: 03
Delay: 10.00
----------------------------------------------------------
(OnCase03)
Output: OnCase03
Target: monitor
Input: SetCamera
Parameter Override: Cam4
Delay: 0.00

Output: OnCase03
Target: Cam3
Input: SetOn
Delay: 0.00

Output: OnCase03
Target: cycler
Input: InValue
Parameter Override: 04
Delay: 10.00
----------------------------------------------------------
(OnCase04)
Output: OnCase04
Target: monitor
Input: SetCamera
Parameter Override: Cam1
Delay: 0.00

Output: OnCase04
Target: Cam4
Input: SetOn
Delay: 0.00

Output: OnCase04
Target: cycler
Input: InValue
Parameter Override: 01
Delay: 10.00
----------------------------------------------------------

4. Create the logic_auto entity.

Output: OnMapSpawn
Target: cycler
Input: InValue
Parameter Override: 01
Delay: 0.00

----------------------------------------------------------


Logic auto gets it all fireing. Then each Case# in 'cycler' fires the next one and is looped by the last Case# calling the first.

If all is set up correctly you should see the same thing on all 4 monitors rotate throught each camera angle.

I'll add example pics later, gota get to bed.
 
Yay....my persistant bitching did some good!

Ya know what really really sucks though? I havn't done a single thing with the map I used this on!!!! Thats what happens when you wait for people in a mod to get back to you on weather or not they want to look at it.
I figure though I could always through it into the map I'm doing right now. That one isn't tied down to any mod or anything :).


Hey, and make sure you note in your Tut (for the lame people that are going to try this) You can not see yourself on camera. So no camera should be pointing in the direction of any monitor. I just looks bad to see a floating gun on the screen.

And damn it!!! We need to start a patition to Valve to get them to update HL2's code to allow seperate cameras on seperate monitors. It would be so easy to do, and so friggn' cool!!!
 
Agreed! Wouldn't it be the shiznit to have multiple screens setup like a security station.

The map I'm building will have full use of this camera switching technique.

Have you had problems with using the same dev/dev_monitorxx texture more than once in same map? I had to use a different texture for each monitor used.
 
what persistant bitching? :dozey:

:p

If you're making a mod, you can have multiple seperate 'channels':

http://www. hl2world .com/wiki/index.php/Unlimited_Render_Targets_for_Cameras

As a mapper for existing mods this is not possible, though.
 
Phisionary said:
what persistant bitching? :dozey:

:p

If you're making a mod, you can have multiple seperate 'channels':

http://www. hl2world .com/wiki/index.php/Unlimited_Render_Targets_for_Cameras

As a mapper for existing mods this is not possible, though.

That is really good to know! Any clue as to why Valve left that functionality out? My guess is that they never intended to use it.. duh!
 
Back
Top