maxl30 81 Posted July 28, 2016 Hello, i want to create a Lightbar addon for arma 3 with your help. ;) How do you get this way seem (https://youtu.be/W8Fd9NAvvjY?t=26s) ? I hope you can help me. :D Share this post Link to post Share on other sites
maxl30 81 Posted August 12, 2016 Please help me :/ ! Share this post Link to post Share on other sites
DieselJC 196 Posted August 13, 2016 https://forums.bistudio.com/topic/148350-offroad-police-sirens-lights-and-underglow/ Google is an amazing thing. Diesel Share this post Link to post Share on other sites
NightIntruder 710 Posted August 14, 2016 ARMA3 samples -> Boat addon Share this post Link to post Share on other sites
OfficialNoms 2 Posted August 16, 2016 I'm fairly sure he's asking about writing a custom mod to add a lightbar to a vehicle that doesn't have a built in configuration for it. Right now, only boats and the Offroad have a configuration for a police lightbar, and these are not available for other vehicles. I've been writing one myself (it's not without its issues that I'm working through) but the way I'm doing it is as follows: Here's a dumbed down version of my mod to get you going: config.cpp: #define private 0 #define protected 1 #define public 2 class DefaultEventhandlers; // External class reference class CfgPatches { class RPDLightbarMod { units[] = {}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"A3_Soft_F"}; }; }; class CfgVehicles { class SUV_01_base_f; //External reference class C_SUV_01_F: SUV_01_base_f { scope = public; class EventHandlers { init = "lightbar = [_this select 0] execVM ""\rpd\script\initLightbar.sqf"";"; }; }; class Static; // External class reference class lightbar : Static { scope = public; model = "\rpd\lightbar\lightbar.p3d"; displayName = "lightbar"; hiddenSelections[] = {}; hiddenSelectionsTextures[] = {}; }; }; In this I simply override the SUV configuration and add an 'init' eventhandler that tells it to run the script when it's created. It also defines the lightbar object itself. You'll have to get your own model though, and you'll probably need to play with the hiddenSelections based on the model you use. script\initLightbar.sqf: private["_car","_lightbar"]; _car = _this select 0; //Get the car reference deleteCheckLoop = compile preprocessFile "\rpd\script\fn_deleteCheckLoop.sqf"; //Prepare the cleanup loop switch typeOf _car do { case "C_SUV_01_F": { if(_car getVariable["copcar",false]) then { _lightbar = "lightbar" createVehicle getPos _car; _lightbar attachTo [_car, [0,-0.65, 0.41]]; _lightbar setVariable ["parent",_car,true]; _lightbar setVariable ["isModAttachment",true,true]; _car setVariable ["hasLightbar",true,true]; [_car,_lightbar] spawn deleteCheckLoop; }; }; }; This creates the lightbar and attaches it, while adding some variables to the object for us to use later.fn_deleteCheckLoop.sqf private ["_car","_lightbar"]; _car = _this select 0; _lightbar = _this select 2; waitUntil {!(alive _car) || isNull _car}; //Wait until the car no longer exists if(!isNil "_lightbar") then {deleteVehicle _lightbar}; //Delete it! This script basically waits until the car is deleted, and then deletes the lightbar as well. You may want to do some extra checks in your mission to make sure things are cleaned up properly just in case, but this should work. That's why I set those variables. :) 1 Share this post Link to post Share on other sites