Jump to content

M1ke_SK

Member
  • Content Count

    471
  • Joined

  • Last visited

  • Medals

Everything posted by M1ke_SK

  1. I am learning mission making and strugling with setting params for medical settings. I got vanilla system, and ACE3 basic/advanced medical system. I want to choose one of these at start of mission. How to set up / use this param to set medical system in mission? I got so far this: description.ext class Params { class MedicalSystem { title = "Medical System"; texts[] = {"Vanilla", "A.C.E. 3 - Basic","A.C.E. 3 - Advanced"}; values[] = {0, 1, 2}; default = 0; file = "scripts/medical_system.sqf"; }; }; medical_system.sqf _medicalSystem = "MedicalSystem" call BIS_fnc_getParamValue;
  2. Hi, I am struggling with ejecting all units from vehicle. This is what I got: _cargo = assignedCargo _vehicle; _commander = assignedCommander _vehicle; _driver = assignedDriver _vehicle; _gunner = assignedGunner _vehicle; _crew = _cargo + _commander + _driver + _gunner; { _x action ["EJECT", _vehicle]; // _x action ["GETOUT", _vehicle]; } forEach _crew; Also problem is, when there is no gunner, it gives me empty object to add to _crew array. I want to have units in _crew array to kick them out.
  3. How to create selected operation area in COOP mission as in this picture ?
  4. I have event handler on unit _unit addEventHandler ["killed", "[_this select 0, _this select 1] execVM 'script.sqf'"]; Then in script.sqf params ["_victim", "_killer"]; // get killer weapon when unit died _killerWeapon = currentWeapon _killer; /* IDEA for grenade _weapon = weaponState _killer; if (_weapon select 0 == "Throw") then { _killerWeapon = _weapon select 3; } else { _killerWeapon = _weapon select 0; }; */ _weaponName = (configFile >> "cfgWeapons" >> _killerWeapon); _weaponName = format["%1",getText(_weaponName >> "displayName")]; switch (true) do { case (_victim == _killer) : { //suicide }; case (vehicle _killer == _killer) : { //run over with car }; default { //killed by weapon }; }; How to check if killing weapon was grenade / grenade from launcher / mine ? Probably different way to check for bullet / explosion death?
  5. When I create marker on map it will spawn enemy on random position on marker when player approach marker. I added configurate distance in script. Problem is, that my trigger condition is not working. Enemy is created no matter what distance I am from marker. enemy.sqf /* AUTHOR: MikeSK 701st [S.O.G.] NAME: enemy.sqf VERSION: 0.5 DESCRIPTION: Spawn enemy on marker when player approach. USAGE: Add this line to mission init: //_handle = [markerName, classNameArray, numberOfUnits, group, showMarker, spawnDistance, respawn, timeInMinute]; Example: //["marker1", ["O_Soldier_F","O_G_Soldier_F"], 5, east, 1, 200, false, 15] execVM "enemy.sqf"; CONFIG: markerName: STRING - name of marker classNameArray: ARRAY - an array of classnames of the units to spawn numberOfUnits: SCALAR - amount of units to spawn group: SIDE - a group will be created for the side you specify (east, west, ...) showMarker: SCALAR - set if marker is shown on map (0 - no, 1 - yes) spawnDistance: SCALAR - define meters from marker when units will spawn respawn: BOOLEAN - enable / disable inifinite respawn of units timeInMinute: SCALAR - time in minutes that units will respawn again */ private ["_marker", "_classArray", "_amount", "_group", "_showMarker", "_distance"]; _marker = _this select 0; _classArray = _this select 1; _amount = _this select 2; _group = _this select 3; _showMarker = _this select 4; _distance = _this select 5; _respawn = _this select 6; _respawnTime = _this select 7; _markerPos = getMarkerPos _marker; _marker setMarkerAlpha _showMarker; _markerSize = getMarkerSize _marker; _markerSizeX = _markerSize select 0; _markerSizeY = _markerSize select 1; _markerSize = (_markerSizeX + _markerSizeY)/2; _markerAgl = markerDir _marker; _markerRange = (_markerSize)/2; _actCond="{vehicle _x in thisList && isPlayer _x} count playableUnits > 0"; _tr = createTrigger ["EmptyDetector", _markerPos]; _tr setTriggerArea [(_distance+_markerSizeX),(_distance+_markerSizeY),_markerAgl,false]; _tr setTriggerActivation ["ANY","PRESENT",true]; _tr setTriggerTimeout [1, 1, 1, true]; _tr setTriggerStatements [_actCond,"",""]; _trigger = [_tr, 0, "EXIT", [objNull]] call BIS_fnc_param; _createUnits = { private ["_trigger", "_classArray", "_amount", "_group", "_respawnTime", "_pos", "_patrol", "_obj", "_classname"]; _trigger = _this select 0; _classArray = _this select 1; _amount = _this select 2; _group = _this select 3; _respawnTime = _this select 4; _pos = [_trigger] call BIS_fnc_randomPosTrigger; for "_i" from 1 to _amount do { _classname = _classArray select (floor random (count _classArray)); if (_classname isKindOf "man") then { _obj = _group createUnit [_classname, _pos, [], 0, "FORM"]; }else { _pos = [_trigger] call BIS_fnc_randomPosTrigger; [_pos, random 360, _classname, _group] call BIS_fnc_spawnVehicle; }; }; _patrol = [_trigger, _group] spawn { _trigger = _this select 0; _group = _this select 1; while {{alive _x} count units _group > 0} do { _group move ([_trigger] call BIS_fnc_randomPosTrigger); waitUntil {(moveToCompleted leader _group) || (moveToFailed leader _group)}; }; }; waitUntil {{alive _x} count units _group == 0}; terminate _patrol; sleep (_respawnTime * 60); }; if !(_trigger isEqualTo "EXIT") then { if (typeOf _trigger != "EmptyDetector") exitWith {}; _classArray = [_this, 2, ["O_Soldier_F"], [[]]] call BIS_fnc_param; _amount = [_this, 2, 1, [0]] call BIS_fnc_param; _group = createGroup ([_this, 3, east, [east]] call BIS_fnc_param); _respawn = [_this, 6, false, [false]] call BIS_fnc_param; _respawnTime = [_this, 7, 1, [0]] call BIS_fnc_param; if (!_respawn) then { [_trigger, _classArray, _amount, _group, _respawnTime] call _createUnits; }; while {_respawn} do { [_trigger, _classArray, _amount, _group, _respawnTime] call _createUnits; }; };
  6. I have list, where I filter objects. _list = nearestObjects [_vehicle, ["Car", "Tank", "Ship"], 10]; I want to have in list all "car", "tank", "ship", "submarines", "ammo boxes", "container box", "static weapon" and possible mod classes. How to specify filter for those I named?
  7. @Larrow Thank you for this knowledge. This is more usefull to me, than actual answer. So by searching in config viewer I come up with this list _list = nearestObjects [_vehicle, ["StaticWeapon","Car","Ship","Cargo_base_F", "ReammoBox_F"], 10]; Question: I found that (small red light) that I use for helipads have superclass "Ship". How can I exclude this from filter ? PortableHelipadLight_01_Red_F
  8. I changed ACE3 settings by defining it in descrtiption.ext. How can I sync medical facility or medical vehicle by script? I don't want to use modules. Can this be done?
  9. How can I use ace_settings_class to synchronize object with module? Example: how to synchronize medical system with building (hospital) as ACE3 medical building? or how to synchronize medical system with vehicle (medavac) as ACE3 medical vehicle ?
  10. Can you post some example of "change textures using hidden selections" for reference ?
  11. I have functions myFunction1 = { //do stuff here }; myFunction2 = { //do stuff here }; myFunctionDefault = { //do stuff here }; then I have switch switch(_param) do { case "one": { _function = myFunction1; }; case "two": { _function = myFunction1; }; default { _function = myFunctionDefault; }; }; then I want to do call {[_par1, _par2] call _function}; But it get me error, that _function is undefined variable. How to call function via variable?
  12. Hi, when I add vehicle from addon to mission I want to check if player is starting mission with that addon. If not, use car from vanilla Arma. I am looking for way to identify check if used class (unit, vehicle, object) is available in mission. Looking to check if addon is enabled (e.g. if class is found ) in mission. Want to prevent this
  13. @dna_uk I need to call this _function multiple times. This will work, but then I must copy/paste this code and that is "duplicity of code" for me. Thank you, I now know more :)
  14. @d3limit3r thank you, that helped. @jshock Yes, that is good approach, but not in my favour. Anyway another approach to consider. My problem was that _function was out of scope. So defining it at start helped.
  15. hello, I crated simple script to load custom gear for units. It works for init, but not after respawn. USAGE: Add this line to init of unit: null = [this, "role"] execVM "loadout.sqf"; Problem is, that I want to load loadout after respawn with same role. _unit addEventHandler ["respawn","[_this select 0, _this select 1] execVM 'loadout.sqf'"]; But _this select 1 will not select current role. So I tried to workaround this by getVariable / setVariable but with no luck. How to add second parameter (role) to addEventHandler?
  16. it is modification of my script, I want to reduce init line of player by reducing this addeventhandler ["respawn","_this execVM 'loadout1.sqf'"]; also want to have just one sqf file with all custom gears
  17. M1ke_SK

    Saved Arsenal loadouts location?

    nice, I will look into it
×