bajaboy1972
Well-Known Member
You can place cameras anywhere u want.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You can place cameras anywhere u want.
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.
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.
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.
if you want it to read for Loudspeakers_EP1 or any other object look for like 24 in the init of cctvjust change ["Loudspeaker"] to ["Loudspeaker_EP1"]Code:_camera_objs = nearestObjects [_laptop, ["Loudspeaker"], CCTV_radius];
oh reeeeeeaalllyyy?
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.
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.
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
change is toCode:_z = _pos select 2;
Code:_z = (_pos select 2) + 10;
The _cam_span_targets func works out the positions the camera pans between.
// 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
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;