Skip to content

Instantly share code, notes, and snippets.

@Seb105
Created September 28, 2023 17:19
Show Gist options
  • Save Seb105/bf4abb3877d1b526d43d919bb8dad12f to your computer and use it in GitHub Desktop.
Save Seb105/bf4abb3877d1b526d43d919bb8dad12f to your computer and use it in GitHub Desktop.
party bus!
["UK3CB_Ikarus", "init", {
params ["_bus"];
if (isServer) then {
private _dudes = [
"C_man_1",
"C_Man_casual_1_F",
"C_Man_casual_3_F",
"C_Man_casual_2_F",
"C_Man_casual_6_v2_F",
"C_Man_formal_2_F",
"C_Man_formal_3_F",
"C_Man_smart_casual_2_F"
];
{
_x params ["_unitType"];
private _position = [
(random 1) - 0.5,
(random 8) - 4,
-0.75
];
private _unit = createAgent [_unitType, [-1000,-1000,0], [], 0, "NONE"];
_unit attachTo [_bus, _position];
_unit setDir random 360;
_unit enableDynamicSimulation true;
_unit spawn {
params ["_unit"];
sleep (random 15);
private _dance = selectRandom ["Acts_Dance_01", "Acts_Dance_02"];
[_unit, _dance] remoteExec ["switchMove"];
};
} forEach _dudes;
};
if (hasInterface) then {
private _light = "#lightpoint" createVehicleLocal (getPos _bus);
_light setLightBrightness 1.0;
_light setLightIntensity 650;
_light setLightColor [0.0, 1.0, 0.0];
_light setLightUseFlare false;
_light setLightAttenuation [5,1,0,0.025];
_light lightAttachObject [_bus, [0,0,0]];
_light setLightDayLight true;
[{
params ["_thisArgs", "_handle"];
_thisArgs params ["_light", "_bus"];
private _currentColour = _bus getVariable ["seb_colour", [0, 0, 0]];
private _colour = [0,0,0];
_colour set [selectRandom [0, 1, 2], 1];
_colour set [selectRandom [0, 1, 2], 1];
if (_colour isEqualTo _currentColour) then {
_colour = [1,1,1] vectorDiff _colour;
};
_light setLightColor _colour;
_bus setVariable ["seb_colour", _colour];
if !(alive _bus) then {
deleteVehicle _light;
_handle call CBA_fnc_removePerFrameHandler;
{
deleteVehicle _x;
} forEach (attachedObjects _bus);
}
}, 0.36, [_light, _bus]] call CBA_fnc_addPerFrameHandler;
};
}, true, [], true] call CBA_fnc_addClassEventHandler;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment