CCTV

When I get back this weekend i'll write up a script collection using fn_selfActions to create and place the 'cameras' and the 'laptops' as well as 'packaging' them up. If anyone has an idea of a item that doesn't spawn usually but CAN be inserted into dayz via DB or such, then please send me a pm. I'll use it as a marker for the notebook/loudspeakers.
 
When I get back this weekend i'll write up a script collection using fn_selfActions to create and place the 'cameras' and the 'laptops' as well as 'packaging' them up. If anyone has an idea of a item that doesn't spawn usually but CAN be inserted into dayz via DB or such, then please send me a pm. I'll use it as a marker for the notebook/loudspeakers.

Sounds great !
 
Quick question, If we use Base Building mod, can we create a new class, for example "Loudspeaker_CCTV" (add it to deployables in the db) and create a function (dont know where...client files or server files) that when that object is placed/created it will create a pole and attach a Loudspeaker on the top?
This way we can add it to the Base Building mod as a new object so people can build it.
 
Quick question, If we use Base Building mod, can we create a new class, for example "Loudspeaker_CCTV" (add it to deployables in the db) and create a function (dont know where...client files or server files) that when that object is placed/created it will create a pole and attach a Loudspeaker on the top?
This way we can add it to the Base Building mod as a new object so people can build it.

You can do whatever you want with basebuilding. You just have to know how the files for it work, there are threads about adding objects to it around here somewhere.
 
i've tried to change Loudspeaker to Loudspeakers_EP1, and then 'lift' the camera view to where the speakers are supposed to be but failed.
In the current code which value can be changed to change the cameras height ?
I dont get it.... what does _cam_span_targets do and what does _get_pos ?

I tried playing with both function but the camera doesnt change height.
If i set up Loudspeakers_EP1 then the camera moves to the debug zone, in the water. As if it doesnt recognise the structure/position of the object.
 
i've tried to change Loudspeaker to Loudspeakers_EP1, and then 'lift' the camera view to where the speakers are supposed to be but failed.
In the current code which value can be changed to change the cameras height ?
I dont get it.... what does _cam_span_targets do and what does _get_pos ?

I tried playing with both function but the camera doesnt change height.
If i set up Loudspeakers_EP1 then the camera moves to the debug zone, in the water. As if it doesnt recognise the structure/position of the object.

You don't change the height. It reads for the loudspeakers themselves. Then displays the camera from there.

It also isn't reading for Loudspeakers_EP1, the reason its going into debug is because you are using the wrong class
 
if you want it to read for Loudspeakers_EP1 or any other object look for like 24 in the init of cctv
Code:
_camera_objs = nearestObjects [_laptop, ["Loudspeaker"], CCTV_radius];
just change ["Loudspeaker"] to ["Loudspeaker_EP1"]
 
if you want it to read for Loudspeakers_EP1 or any other object look for like 24 in the init of cctv
Code:
_camera_objs = nearestObjects [_laptop, ["Loudspeaker"], CCTV_radius];
just change ["Loudspeaker"] to ["Loudspeaker_EP1"]

Did you even read my post?
I changed loudspeakers to the ep_1 version. But its spawn center is on the ground so now the cam is there as well.
So i am trying to change the cam height...
 
oh reeeeeeaalllyyy :p?
Figured it out....check camSetrelPos.
Right now the direction of the camera is a bit messed up but i think i can tweak it. I just probably need to get the current x,y and add it to the camera and probably dir as well. Something like this.

_cam camSetTarget (_positions select 0);
_lalapos = getPos _cam;
_lalax = _lalapos select 0;
_lalay = _lalapos select 1;
_cam camSetrelPos [_lalax,_lalay,15]; // <<<<<<<<<----- 15 works Mr. Absolute....the cam goes up 15m.
 
oh reeeeeeaalllyyy :p?
Figured it out....check camSetrelPos.
Right now the direction of the camera is a bit messed up but i think i can tweak it. I just probably need to get the current x,y and add it to the camera and probably dir as well. Something like this.

_cam camSetTarget (_positions select 0);
_lalapos = getPos _cam;
_lalax = _lalapos select 0;
_lalay = _lalapos select 1;
_cam camSetrelPos [_lalax,_lalay,15]; // <<<<<<<<<----- 15 works Mr. Absolute....the cam goes up 15m.

Eh, whatevs. I am not on my home computer, cant really look through code. I didn't notice anything related to height the first couple of times I strolled through the code. Like when I added sounds for Bajaboy, or when I helped Dusty get it working. Shit happens.
 
I am not talking about doing it in the editor and/or mysql.
I wanna add this to BaseBuilding buildings so people can actually use this for their bases. So changing height in the database is not an option.
People should be able to place down Loudspeaker_EP1 and then activate it by making a laptop.

I've kinda made all the code that checks owner IDs etc...its just the height thats pissing me off.
 
I didn't add the extra code for sound Bajaboy posted and I have sound. Actually, I have glitched Air Raid sirens that go off...but no Air Raid. Any idea on that? Not a deal breaker, but annoying nonetheless.
 
I didn't add the extra code for sound Bajaboy posted and I have sound. Actually, I have glitched Air Raid sirens that go off...but no Air Raid. Any idea on that? Not a deal breaker, but annoying nonetheless.

Can you post the code you used? Post the info for the speaker as well.
 
Also replied @ http://dayzepoch.com/forum/index.php?/topic/588-cctv-system-script/


What i think is going on (would test but going to bed) is that the script looks for the center point of the object. You have increased the Z axis for the camera position but not increased the Z axis in _cam_span_targets

On line 39
Code:
_z = _pos select 2;
change is to
Code:
_z = (_pos select 2) + 10;

The _cam_span_targets func works out the positions the camera pans between.
 
I've uploaded my Chernarus camera positions in a mission file if anyone needs them. I placed them in the 3d editor, so you can just paste them into your mission and they will snap into place without having to line them up exactly. Some sit on top of utility poles, some on flag poles, and some sit on loudspeaker_ep1. If you've already changed your camera object to loudspeakers_ep1, you can just delete the other stuff. Notebooks aren't included since I assume people can place those themselves. Some of these spots favor places where I have camps set up, so delete whichever ones you don't need. Thanks again for sharing this great script.

http://www.mediafire.com/download/yiipbrfzjigv6rn/cameras.rar
 
This might be of use to some. I wrote a script to deploy a laptop. It will always be a scroll option for all players, until they deploy it. I set it so that it won't deploy within a certain distance of another laptop. You can tweak that 400 variable to get a distance of your own choosing. I did this to keep people from deploying a hundred laptops on top of each other. Ideally, there should be some way to have an option to "shutdown" the laptop which would delete it. But I haven't figured that part out yet.

Put this in the fn_selfactions.sqf:

Code:
// LAPTOP ON START
private ["_laptop"];
_laptop = count nearestObjects [_playerPos, ["Notebook"], 400] > 0;
 
if((speed player <= 1) && _canDo and !_laptop) then {
    hasLaptop = true;
} else {
    hasLaptop = false;
};
if (hasLaptop) then {
    if (LaptopON< 0) then {
    LaptopON = player addAction [("<t color=""#0096ff"">" + ("Laptop On") +"</t>"),"scripts\LaptopON.sqf","",5,false,true,"",""];
    };
} else {
    player removeAction LaptopON;
    LaptopON = -1;
};
// LAPTOP ON END

and then this goes in your scripts folder as LaptopON.sqf:

Code:
player playActionNow "Medic";
sleep 1;
titleText ["Your laptop is powering up.","PLAIN DOWN"]; titleFadeOut 5;
 
_mypos = getposATL player;
_dir = getdir player;
_mypos = [(_mypos select 0)+2*sin(_dir),(_mypos select 1)+2*cos(_dir), (_mypos select 2)];
_laptopON = createVehicle ["Notebook", _mypos, [], 0, "CAN_COLLIDE"];
_laptopON setDir _dir;
_laptopON setposATL _mypos;
sleep 2;
 
 
titleText ["System online.","PLAIN DOWN"]; titleFadeOut 5;

One problem is that the laptop spawns backwards. I would like for it to spawn in with the screen facing the player. Not sure how to do that. I'll update it when I get that far.
 
Back
Top