Moin zusammen,
da ich gestern schon mal geschrieben hatte, dass ich gern die Konfiguration für die "Blaulichter" in der Config_Vehicle haben möchte hier mal das Tutorial dazu. Ich muss ehrlich gestehen ich habe es noch nicht testen können, daher vorläufig keine Garantie. Des Weiteren könnte man das Ganze sogar noch weiter treiben, da man theoretisch nur noch einmal die fn_copLights benötigt, aber zu einfach mache ich es Euch jetzt auch nicht . Ich werde alle geänderten Dateien als Zip anhängen für die faulen bzw. damit die Formatierung erhalten bleibt.
Folgende Sachen müssen geändert werden:
In der Mission:
1. Config_Vehicle.hpp Achtung nur der Auszug für den Offroader
class C_Offroad_01_F {
vItemSpace = 65;
conditions = "license_civ_driver || {!(playerSide isEqualTo civilian)}";
price = 12500;
ligths[]= {
{"left",{-0.45, 0.0, 0.56},{
{"cop",{20, 0.1, 0.1}} //color Cop Red
,{"med",{0.1, 0.1, 20}} //color Medic Blue
,{"adac",{20, 20, 0.1}} //color Adac Yellow
}
}
,{"right",{0.37, 0.0, 0.56},{
{"cop",{0.1, 0.1, 20}} //color Cop Blue
,{"med",{0.1, 0.1, 20}} //color Medic Blue
,{"adac",{20, 20, 0.1}} //color Adac Yellow
}
}
};
textures[] = {
{ "Red", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_co.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_co.paa"
}, "" },
{ "Yellow", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE01_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE01_CO.paa"
}, "" },
{ "White", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE02_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE02_CO.paa"
}, "" },
{ "Blue", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE03_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE03_CO.paa"
}, "" },
{ "Dark Red", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE04_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE04_CO.paa"
}, "" },
{ "Blue / White", "civ", {
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE05_CO.paa",
"\A3\soft_F\Offroad_01\Data\offroad_01_ext_BASE05_CO.paa"
}, "" },
{ "Taxi", "civ", {
"#(argb,8,8,3)color(0.6,0.3,0.01,1)"
}, "" },
{ "Police", "cop", {
"#(ai,64,64,1)Fresnel(1.3,7)"
}, "" }
};
};
Alles anzeigen
Hier gibt es einen neuen Eintrag namens "lights" im Prinzip ist nur der für das Tutorial interessant
2. fn_coplights.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_copLights.sqf
Author: mindstorm, modified by Adanteh and moeck
Link: http://forums.bistudio.com/showthread.php?157474-Offroad-Police-sirens-lights-and-underglow
Description:
Adds the light effect to cop vehicles, specifically the offroad.
*/
params [
["_vehicle", objNull, [objNull]],
["_lightTime", 0.22, [0]]
];
if (isNil "_vehicle" || {isNull _vehicle || {!(_vehicle getVariable "lights") || {!(M_CONFIG(isArray,"LifeCfgVehicles",(typeOf _vehicle),"lights"))}}}) exitWith {};
private _lightLeft = "#lightpoint" createVehicleLocal getPos _vehicle;
private _lightRight = "#lightpoint" createVehicleLocal getPos _vehicle;
sleep 0.2;
private _lights = (M_CONFIG(getArray,"LifeCfgVehicles",(typeOf _vehicle),"lights"));
if !(count _lights isEqualTo 2) exitWith {};
_leftColor = ((_lights select 0) select 2);
_lightLeft setLightColor ((_leftColor select 0) select 1);
_lightLeft lightAttachObject [_vehicle, ((_lights select 0) select 1)];
_lightLeft setLightBrightness 0.2;
_lightLeft setLightAmbient [0.1,0.1,1];
_lightLeft setLightAttenuation [0.181, 0, 1000, 130];
_lightLeft setLightIntensity 10;
_lightLeft setLightFlareSize 0.38;
_lightLeft setLightFlareMaxDistance 150;
_lightLeft setLightUseFlare true;
sleep 0.2;
_lightRight lightAttachObject [_vehicle, ((_lights select 0) select 1)];
_rightColor = ((_lights select 1) select 2);
_lightRight setLightColor ((_rightColor select 1) select 1);
_lightRight setLightBrightness 0.2;
_lightRight setLightAmbient [0.1,0.1,1];
_lightRight setLightAttenuation [0.181, 0, 1000, 130];
_lightRight setLightIntensity 10;
_lightRight setLightFlareSize 0.38;
_lightRight setLightFlareMaxDistance 150;
_lightRight setLightUseFlare true;
_lightLeft setLightDayLight true;
_lightRight setLightDayLight true;
private _leftRed = true;
while {alive _vehicle} do {
if !(_vehicle getVariable "lights") exitWith {};
if (_leftRed) then {
_lightRight setLightBrightness 0.0;
sleep 0.05;
_lightLeft setLightBrightness 6;
} else {
_lightLeft setLightBrightness 0.0;
sleep 0.05;
_lightRight setLightBrightness 6;
};
_leftRed = !_leftRed;
sleep _lightTime;
};
deleteVehicle _lightLeft;
deleteVehicle _lightRight;
Alles anzeigen
Einfach komplett ersetzen .
3. fn_sirenLights.sqf
Dort ersetzt ihr den Eintrag
if (!(typeOf _vehicle in ["C_Offroad_01_F","B_MRAP_01_F","C_SUV_01_F","C_Hatchback_01_sport_F","B_Heli_Light_01_F","B_Heli_Transport_01_F"])) exitWith {}; //Last chance check to prevent something from defying humanity and creating a monster.
durch
if !(M_CONFIG(isArray,"LifeCfgVehicles",(typeOf _vehicle),"lights")) exitWith {};
4. fn_medicLights.sqf
#include "..\..\script_macros.hpp"
/*
File: fn_medicLights.sqf
Author: mindstorm, modified by Adanteh and moeck
Link: http://forums.bistudio.com/showthread.php?157474-Offroad-Police-sirens-lights-and-underglow
Description:
Adds the light effect to cop vehicles, specifically the offroad.
*/
params [
["_vehicle", objNull, [objNull]],
["_lightTime", 0.22, [0]]
];
if (isNil "_vehicle" || {isNull _vehicle || {!(_vehicle getVariable "lights") || {!(M_CONFIG(isArray,"LifeCfgVehicles",(typeOf _vehicle),"lights"))}}}) exitWith {};
private _lights = (M_CONFIG(getArray,"LifeCfgVehicles",(typeOf _vehicle),"lights"));
if !(count _lights isEqualTo 2) exitWith {};
_lightLeft = "#lightpoint" createVehicleLocal getPos _vehicle;
sleep 0.2;
_leftColor = ((_lights select 0) select 2);
diag_log format ["left %1",str((_leftColor select 1) select 1)];
_lightLeft setLightColor ((_leftColor select 1) select 1);
_lightLeft setLightBrightness 0.2;
_lightLeft setLightAmbient [0.1,0.1,1];
_lightLeft lightAttachObject [_vehicle, ((_lights select 0) select 1)];
_lightLeft setLightAttenuation [0.181, 0, 1000, 130];
_lightLeft setLightIntensity 10;
_lightLeft setLightFlareSize 0.38;
_lightLeft setLightFlareMaxDistance 150;
_lightLeft setLightUseFlare true;
_lightRight = "#lightpoint" createVehicleLocal getPos _vehicle;
sleep 0.2;
_rightColor = ((_lights select 1) select 2);
diag_log format ["right %1",str((_rightColor select 1) select 1)];
_lightRight setLightColor ((_rightColor select 1) select 1);
_lightRight setLightBrightness 0.2;
_lightRight setLightAmbient [0.1,0.1,1];
_lightRight lightAttachObject [_vehicle, ((_lights select 1) select 1)];
_lightRight setLightAttenuation [0.181, 0, 1000, 130];
_lightRight setLightIntensity 10;
_lightRight setLightFlareSize 0.38;
_lightRight setLightFlareMaxDistance 150;
_lightRight setLightUseFlare true;
_lightLeft setLightDayLight true;
_lightRight setLightDayLight true;
private _leftRed = true;
while {alive _vehicle} do {
if !(_vehicle getVariable "lights") exitWith {};
if (_leftRed) then {
_lightRight setLightBrightness 0.0;
sleep 0.05;
_lightLeft setLightBrightness 6;
} else {
_lightLeft setLightBrightness 0.0;
sleep 0.05;
_lightRight setLightBrightness 6;
};
_leftRed = !_leftRed;
sleep _lightTime;
};
deleteVehicle _lightLeft;
deleteVehicle _lightRight;
Alles anzeigen
Auch wieder komplett ersetzen.
5. fn_medicSirenLights
selbes Vorgehen wie bei der fn_sirenLights
Ersetzt die Zeile
if (!(typeOf _vehicle in ["C_Offroad_01_F"])) exitWith {}; //Last chance check to prevent something from defying humanity and creating a monster.
durch
if !(M_CONFIG(isArray,"LifeCfgVehicles",(typeOf _vehicle),"lights")) exitWith {};
6. fn_keyHandler.sqf
Sucht dort nach dem Case 38 und ersetzt dort die Zeile
if (!(isNull objectParent player) && (typeOf vehicle player) in ["C_Offroad_01_F","B_MRAP_01_F","C_SUV_01_F","C_Hatchback_01_sport_F","B_Heli_Light_01_F","B_Heli_Transport_01_F"]) then {
durch
if (!(isNull objectParent player) && (M_CONFIG(isArray,"LifeCfgVehicles",(typeOf vehicle player),"lights"))) then {
So damit hätten wir in der Mission auch schon alles erledigt. Machen wir mit dem life_server weiter.
7. life_server - fn_spawnVehicle.sqf
ersetzt die Zeile
if ((_vInfo select 1) isEqualTo "cop" && ((_vInfo select 2)) in ["C_Offroad_01_F","B_MRAP_01_F","C_SUV_01_F","C_Hatchback_01_sport_F","B_Heli_Light_01_F","B_Heli_Transport_01_F"]) then {
durch
if ((_vInfo select 1) isEqualTo "cop" && (M_CONFIG(isArray,"LifeCfgVehicles",(_vInfo select 2),"lights"))) then {
und die Zeile
if ((_vInfo select 1) isEqualTo "med" && (_vInfo select 2) isEqualTo "C_Offroad_01_F") then {
durch
if ((_vInfo select 1) isEqualTo "med" && (M_CONFIG(isArray,"LifeCfgVehicles",(_vInfo select 2),"lights"))) then {
falls ihr den Headless Client nutzt müsst ihr Schritt 7 natürlich auch in der fn_spawnVehicle.sqf des life_hc wiederholen.
So und damit habt ihr es geschafft. Bitte achtet darauf, dass in allen geänderten Dateien der Include zur script_macros.hpp vorhanden ist
In der Mission: #include "..\..\script_macros.hpp"
im life_server / life_hc: #include "\life_server\script_macros.hpp"
Sonst fliegt auch der Kram um die Ohren.
In diesem Sinne viel Spass damit.
Gruß,
moeck