Registriert seit: 07.04.2013
Beiträge: 46
|
ok habe es mit der fn_halo.sqf gemacht und das klappt soweit auch.
nur bekomme ich es nicht in mein script mit fahnenmast spawn und map point halo. jemand ne lösung parat ???
Zitat:
/*
File: fn_halo.sqf
Version: 1.4
Author(s): cobra4v320 - effects adapted from old halo.sqs, sounds from freesound.org
Description: HALO jumping (works with AI soldiers)
Parameters:
0: UNIT - (object) the unit that will be doing the HALO
1: (optional) ALTITUDE - (number) the altitude where the HALO will start from
2: (optional) CHEMLIGHT - (boolean) true if the units will use chemlights
3: (optional) SAVELOADOUT - (boolean) true to save the units backpack and gear
4: (optional) AUTOOPEN -(boolean) true to auto open parachute at 150m
5: (optional) ADDPACK - (boolean) true to add a backpack to the front of the unit
Example(s):
_halo = [this] spawn COB_fnc_HALO
_halo = [this, 2000, true, true, false] spawn COB_fnc_HALO
Notes:
Must use "spawn" and not "call" due to sleep and waituntil commands in the function
*/
if (!isServer || isDedicated) exitWith {};
//Parameters
private ["_unit","_altitude","_chemLight","_saveLoadOut","_ autoOpen","_addPack"];
_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_param;
_altitude = [_this, 1, 3000, [3000]] call BIS_fnc_param;
_chemLight = [_this, 2, false, [false]] call BIS_fnc_param;
_saveLoadOut = [_this, 3, true, [true]] call BIS_fnc_param;
_autoOpen = [_this, 4, true, [true]] call BIS_fnc_param;
_addPack = [_this, 5, true, [true]] call BIS_fnc_param;
//Validate parameters
if (isNull _unit) exitWith {"Unit parameter must not be objNull. Accepted: OBJECT" call BIS_fnc_error};
if (_altitude < 500) exitWith {"Altitude is too low for HALO. Accepted: 500 and greater." call BIS_fnc_error};
private ["_soundPath","_C130Exit","_chuteOpen","_chuteClose "];
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString; //find sound path for playsound3d
_C130Exit = _soundPath + "COB_HALO\sounds\C130_exit.wss";
_chuteOpen = _soundPath + "COB_HALO\sounds\open_chute.ogg";
_chuteClose = _soundPath + "COB_HALO\sounds\close_chute.ogg";
if (isPlayer _unit) then {
cutText ["", "BLACK FADED",999];
[_unit,_C130Exit] spawn {
private ["_unit","_C130Exit"];
_unit = _this select 0;
_C130Exit = _this select 1;
sleep 2;
"dynamicBlur" ppEffectEnable true;
"dynamicBlur" ppEffectAdjust [6];
"dynamicBlur" ppEffectCommit 0;
"dynamicBlur" ppEffectAdjust [0.0];
"dynamicBlur" ppEffectCommit 5;
cutText ["", "BLACK IN", 5];
playSound3D [_C130Exit, _unit, false, getPos _unit, 100, 1, 0]; //play c130 sound (too be deleted)
};
};
if (_saveLoadOut && !isNull (unitBackpack _unit)) then {
[_unit,_addpack] spawn COB_fnc_saveLoadOut; //save gear
} else {
_unit addBackpack "B_parachute"; //add the parachute if unit has no backpack
};
private "_light";
if (_chemLight) then {
_light = "chemlight_red" createVehicle [0,0,0]; //create the chemlight
_light attachTo [_unit,[0,-0.03,0.07],"LeftShoulder"]; //place chemlight on left shoulder
};
_unit setPos [getPos _unit select 0, getPos _unit select 1, _altitude]; //Set the height of the HALO jump
private ["_velocity","_direction"];
_velocity = velocity _unit;
_direction = direction _unit;
_unit setVelocity [(sin _direction * 50),(cos _direction * 50),(_velocity select 2)]; //Give the unit some speed
if (!isPlayer _unit) then {
_unit allowDamage FALSE; //god mode
_unit switchMove "HaloFreeFall_non"; //place the AI into the free fall animation
_unit disableAI "ANIM"; //disable the AI animation so they cant switch back to standing
};
if (isPlayer _unit) then {
if (_autoOpen) then {
waitUntil {getPos _unit select 2 < 150};
_unit action ["OpenParachute", _unit]; //open parachute if 150m above ground
} else {
waitUntil {animationState _unit == "para_pilot"};
};
// Parachute opening effect for more immersion
playSound3D [_chuteOpen, _unit, false, getPos _unit, 15, 1, 0]; //play3d sound
setAperture 0.05;
setAperture -1;
"DynamicBlur" ppEffectEnable true;
"DynamicBlur" ppEffectAdjust [8.0];
"DynamicBlur" ppEffectCommit 0.01;
sleep 1;
"DynamicBlur" ppEffectAdjust [0.0];
"DynamicBlur" ppEffectCommit 3;
sleep 3;
"DynamicBlur" ppEffectEnable false;
"RadialBlur" ppEffectAdjust [0.0, 0.0, 0.0, 0.0];
"RadialBlur" ppEffectCommit 1.0;
"RadialBlur" ppEffectEnable false;
};
waitUntil {isTouchingGround _unit || getPos _unit select 2 < 1}; //wait for unit to touch ground or water
if (!isPlayer _unit) then {
_unit enableAI "ANIM"; //enable the animations
_unit allowDamage TRUE; //allow unit to be damaged again
};
_unit setPos [getPos _unit select 0, getPos _unit select 1, 0]; //this removes the unit from the parachute
_unit setVelocity [0,0,0]; //set speed to zero
_unit setVectorUp [0,0,1]; //set the unit upright
_unit setDamage 0; //heal the unit to 100% in case of injury
if (_chemLight) then {deleteVehicle _light}; //delete the chemlight
if (isPlayer _unit) then {
playSound3D [_chuteClose, _unit, false, getPos _unit, 10, 1, 0];//play3d sound
cutText ["", "BLACK FADED", 999];
sleep 2;
cutText ["", "BLACK IN", 2];
};
//Return Value
_unit
Geändert von McLaine (21.10.2013 um 23:06 Uhr).
|