Registriert seit: 17.01.2008
Beiträge: 267
|
Bei mir sieht das so aus (zumindest der wichtigste Teil)
Code:
// Infrarot
tidist = 200;
_obj = player;
for [{_loop=0}, {tinfra == "true"}, {_loop=_loop}] do
{
setAperture 0.07;
sleep 2.5;
_targets = [];
_targets = nearestObjects [player, ["Man"], tidist];
for [{_t=0}, {_t<(count _targets)}, {_t=_t+1}] do
{
_obj = _targets select _t;
if (format ["%1",_obj getVariable "glowing"] != "true") then {
if (alive _obj) then {
nul = [_obj] execVM "glow.sqf";
};
};
};
};
setAperture -1;
Code:
// glow.sqf
_obj = _this select 0;
if !(alive _obj) exitWith {};
_obj setVariable ["glowing", "true"];
_light1 = "#lightpoint" createVehicle getpos _obj;
_light1 lightAttachObject [_obj, [0.3,-0.2,1]];
_light1 setLightBrightness 0.0004;
_light1 setLightAmbient[1,1,1];
_light1 setLightColor[1,1,1];
_light2 = "#lightpoint" createVehicle getpos _obj;
_light2 lightAttachObject [_obj, [-0.3,-0.2,1]];
_light2 setLightBrightness 0.0004;
_light2 setLightAmbient[1,1,1];
_light2 setLightColor[1,1,1];
_light3 = "#lightpoint" createVehicle getpos _obj;
_light3 lightAttachObject [_obj, [0.0,0.3,1]];
_light3 setLightBrightness 0.0004;
_light3 setLightAmbient[1,1,1];
_light3 setLightColor[1,1,1];
_light4 = "#lightpoint" createVehicle getpos _obj;
_light4 lightAttachObject [_obj, [0.0,0.0,0]];
_light4 setLightBrightness 0.0004;
_light4 setLightAmbient[1,1,1];
_light4 setLightColor[1,1,1];
for [{_loop=0}, {((_obj distance player) < (tidist+20)) && (tinfra == "true") && alive _obj}, {_loop=_loop}] do
{
_bbox = boundingBox _obj;
_bh = (_bbox select 1) select 2;
if (_bh > 1) then {
_light1 lightAttachObject [_obj, [0.2,0.2,1]];
_light2 lightAttachObject [_obj, [0.2,-0.2,1]];
_light3 lightAttachObject [_obj, [-0.2,0.2,1]];
_light4 lightAttachObject [_obj, [-0.2,-0.2,1]];
if (side _obj == side player) then {
drop ["\Ca\Data\sunHalo.p3d","","Billboard",0.5,0.1,[0,0.2,1.7],[0,0,0],0,1,0.778,0,[0.8,0.8],[[1,1,1,0.1],[1,1,1,0.0]],[1,0],0,0,"","",_obj];
};
drop ["\Ca\Data\sunHalo.p3d","","Billboard",0.5,1,[0,0,1.3],[0,0,0],0,1,0.778,0,[1.2,1.2],[[1,1,1,0.1],[1,1,1,0.0]],[1,0],0,0,"","",_obj];
drop ["\Ca\Data\sunHalo.p3d","","Billboard",0.5,1,[0,0,0.9],[0,0,0],0,1,0.778,0,[0.8,0.8],[[1,1,1,0.1],[1,1,1,0.0]],[1,0],0,0,"","",_obj];
} else {
_light1 lightAttachObject [_obj, [0.0,0.3,0.2]];
_light2 lightAttachObject [_obj, [0.0,-0.2,0.2]];
_light3 lightAttachObject [_obj, [-0.1,0.0,0.2]];
_light4 lightAttachObject [_obj, [0.1,-0.0,0.2]];
if (side _obj == side player) then {
drop ["\Ca\Data\sunHalo.p3d","","Billboard",0.5,0.1,[0,0.6,0.5],[0,0,0],0,1,0.778,0,[0.8,0.8],[[1,1,1,0.1],[1,1,1,0.0]],[1,0],0,0,"","",_obj];
};
drop ["\Ca\Data\sunHalo.p3d","","Billboard",0.5,1,[0,0.3,0.2],[0,0,0],0,1,0.778,0,[1.2,1.2],[[1,1,1,0.1],[1,1,1,0.0]],[1,0],0,0,"","",_obj];
drop ["\Ca\Data\sunHalo.p3d","","Billboard",0.5,1,[0,-0.2,0.2],[0,0,0],0,1,0.778,0,[0.8,0.8],[[1,1,1,0.1],[1,1,1,0.0]],[1,0],0,0,"","",_obj];
};
sleep 0.2;
};
deleteVehicle _light1;
deleteVehicle _light2;
deleteVehicle _light3;
deleteVehicle _light4;
_obj setVariable ["glowing", "false"];
Übergeordnet wäre noch ein script welches das ganze aufruft und fürs ein/auschalten sowie den Zeitwechsel zuständig ist.
ps.: das ganze sind natürlich .sqf scripte, keine sqs !!!
__________________
Geändert von Tajin (21.01.2008 um 14:06 Uhr).
|