Jump to content

Ibragim A

Member
  • Content Count

    145
  • Joined

  • Last visited

  • Medals

Community Reputation

108 Excellent

About Ibragim A

  • Rank
    Sergeant

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ibragim A

    help with commandArtilleryFire

    The position itself is an array of three elements. You put the position in another array and therefore get an error. mortar_01 commandArtilleryFire [position laserTarget player, "8Rnd_82mm_Mo_LG", 8];
  2. I can be said to be straight and I like to stick to vanilla game concepts even in my mods, including the concept of the command menu through which the user controls his squad. When creating mods, I faced two unresolved problems that, in my opinion, very seriously complicate and limit modding, and these problems are as follows: 1- the lack of a universal ability to handle which choice the user made in a particular command menu. So, you can use the inputAction "CommandingMenu1", for example, but the problem is that this will work only if the user makes a choice in the menu with a number key, while he can also make the same choice with Space or MMB and inputAction will not show which choice in the command menu the user did. Right example of what I'm talking about is inGameUISetEventHandler. It makes possible to find out the index of the selected action in action menu through the _index variable. I would like to have the same opportunity, but for the command menu. 2 - the inability to use your own conditions in order to enable or make inactive one or another option in the command menu (isActive and isVisible parameters (enable & show in config.hpp)). Now there are vanilla commands like "CursorOnEnemy" for this, but they are not enough. The modeler should be able to create his own conditions for the appearance or activation of those options in the menu that he creates. Thank you very much.
  3. Ibragim A

    Cycling Waypoints

    _wp3 setWaypointStatements ["true", "vehicle this setPos [9178.48,6907.43,0]"];
  4. In my opinion, the most primitive and suitable way for you will be the following: 1) the trigger must be activated by the presence of someone from your side in it. 2) give variable names (like: unit_1, unit_2 ...) to each unit that should disembark from the boat when this trigger is activated. 3) in the trigger activation write: {_x leaveVehicle lcvp2} forEach [unit_1, unit_2]; But remember that if the driver of the boat is from the same group, he will also get out of it. Make him a unit of another group. If the driver of the boat is from another group, then you can make it easier: 1) Give the variable name to the group itself (for example, group_1). 2) In the trigger activation write: group_1 leaveVehicle lcvp2;
  5. Ibragim A

    Formatting a Multiline Hint

    Try by this way: getUnitPositionId = { private ["_vvn", "_str"]; _vvn = vehicleVarName _this; _this setVehicleVarName ""; _str = str _this; _this setVehicleVarName _vvn; parseNumber (_str select [(_str find ":") + 1]) }; _id = _unit call getUnitPositionId;
  6. To delete all ammo your have in the ammo box use clearMagazineCargo. To add new magazines use addItemCargo.
  7. Ibragim A

    Simple Rearm Script

    weaponState.
  8. Ibragim A

    Formatting a Multiline Hint

    You also need to fix the block that counts the magazines suitable for the primary weapon. Your block counts the same magazine several times. Do it like this: // Count Primary Weapon Magazines { if (_x in _compMagArr) then {_cntMag = _cntMag + 1}; } foreach _unitMagArr;
  9. Ibragim A

    Formatting a Multiline Hint

    System chat is a bad idea for you. Use the usual hint + parseText as already stated instead: private _unitArr = units player; _unitArr deleteAt 0; private _hintStr = ""; if (isnil "kiaCnt") then { kiaCnt = 0; }; { private _unit = _x; private _health = round ((1 - damage _unit) * 100); // health in % from 0 to 100 private _kiaCnt = kiaCnt; //If Dead - Remove From Group - Increment Kill Counter if (_health == 0) then { kiaCnt = _kiaCnt + 1; private _grpDOA = createGroup [west, true]; [_unit] join _grpDOA; }; //Unit Info private _priWeap = primaryWeapon _unit; private _unitMagArr = magazines _unit; private _compMagArr = compatibleMagazines _priWeap; private _cntMag = 0; // Count Primary Weapon Magazines { private _compMag = _x; { private _unitMag = _x; if (_compMag == _unitMag) then {_cntMag = _cntMag + 1}; } foreach _unitMagArr; } foreach _compMagArr; private _logger = format ["<t align='center'>%1 || H: %2<br/>W: %3 || Mags: %4</t><br/><br/>", _unit, _health, _priWeap, _cntMag]; _hintStr = _hintStr + _logger; } foreach _unitArr; _logger = format ["<t align='center'>KIA: %1</t><br/>", kiaCnt]; _hintStr = _hintStr + _logger; hint parseText _hintStr;
  10. Ibragim A

    All AI suddenly not finding targets

    I faced a similar problem when I overloaded the map with triggers with a huge area and a large number of groups.
  11. The issue has been solved. There should be a small delay in the mission load handler: addMissionEventHandler ["Loaded", { params ["_saveType"]; _this spawn { waitUntil { sleep 0.1; !isnull (finddisplay 46) }; systemchat _this; }; }];
  12. The issue, as stated in the title, is that the MEH "Loaded" only works if the player saves the game with the SAVE option and then loads it from the same mission dialog, but if he chooses SAVE & EXIT and opens the mission again, this MEH does not work. I read that this event handler should be run in preinit and did everything as it says here. MEH "Loaded" is running from mod config.cpp as preinit function: config.cpp: class CfgFunctions { class PC { class preInitFunctions { file = "Addon_PC"; class doPreinit { preInit = 1; }; }; }; }; fn_doPreinit.sqf: addMissionEventHandler ["Loaded", { params ["_saveType"]; systemchat str _saveType; // Anything... }]; Maybe I did something wrong. Maybe there is another way how to handle the loading of the mission?
  13. Study this function, it uses the algorithm you need: /* Author: Jiri Wainar Description: Play set of ambient animations on given unit AND allows the unit to leave the ambient state and engage enemy or move away. Remarks: * Function controls BIS_fnc_ambientAnim; check that function [Remarks] section for more info of how to use it. * Unit automatically leaves the animation loop if there is an enemy in 300m he knows about. Parameter(s): 0: OBJECT - unit the anim & gear changes are going to be applied to 1: STRING (optional, default "STAND") - animation set id, describing what the unit's action looks like. > "STAND" - standing still, slightly turning to the sides. Needs a rifle! > "STAND_IA" - default a3 animations for standing, rifle lowered > "SIT_LOW" - sitting on the ground, with weapon. > "KNEEL" - kneeling, with weapon. > "LEAN" - standing while leaning (on wall) > "WATCH"/"WATCH1"/"WATCH2" - standing and turning around 2: STRING (optional, default "RANDOM") - equipment level id, describing how heavily is the unit equipped. > "NONE" - no goggles, headgear, vest, weapon > "LIGHT" - no goggles, headgear, vest > "MEDIUM" - no goggles, headgear > "FULL" - no goggles > "ASIS" (default) - no touches to the gear > "RANDOM" - gear is randomized according to the animation set 3: CODE or STRING (optional, default {false}) - condition that if true frees the unit from the animation loop 4: STRING (optional, default "COMBAT") - behaviour the unit should go to, when freed. Returns: - Example: [this,"STAND","FULL",{(player distance _this) < 5}] call BIS_fnc_ambientAnimCombat; */ //do the immediate operations ---------------------------------------------------------------------- private["_unit","_animset","_gear","_cond","_behaviour"]; private["_acceptableStates","_acceptableGear","_transAnim"]; _unit = _this param [0, objNull, [objNull]]; _animset = _this param [1, "STAND", [""]]; _gear = _this param [2, "ASIS", [""]]; _cond = _this param [3, {false}, ["",{}]]; _behaviour = _this param [4, "COMBAT", [""]]; _acceptableStates = [ "STAND", "STAND_IA", "SIT_LOW", "KNEEL", "LEAN", "WATCH", "WATCH1", "WATCH2" ]; _acceptableGear = [ "NONE", "LIGHT", "MEDIUM", "FULL", "ASIS", "RANDOM" ]; if !(_animset in _acceptableStates) exitWith { format["Definition of animset '%1' dosn't exist. Possible animsets are %2.",_animset,_acceptableStates] call BIS_fnc_error; }; if !(_gear in _acceptableGear) exitWith { format["Definition of gearset '%1' dosn't exist. Possible gearsets are %2.",_gear,_acceptableGear] call BIS_fnc_error; }; if (typeName _cond == typeName "") then { _cond = compile _cond; }; //execute the ambient anim [_unit,_animset,_gear,nil,nil,false] call BIS_fnc_ambientAnim; //transition animation _transAnim = "AmovPercMstpSrasWrflDnon"; [_unit,_cond,_transAnim,_behaviour] spawn { private["_unit","_cond","_transAnim","_animHandle","_behaviour","_unitPos"]; _unit = _this select 0; _cond = _this select 1; _transAnim = _this select 2; _behaviour = _this select 3; //wait for system to initialize on the unit waitUntil { sleep 0.1; _animHandle = _unit getVariable ["BIS_EhAnimDone", -1]; (_animHandle > -1) }; //wait for unlock condition evals to true waitUntil { sleep 0.1; (behaviour _unit == "COMBAT") || {(damage _unit > 0) || {(_unit call _cond) || {(_unit call BIS_fnc_enemyDetected)}}} }; _unitPos = unitPos _unit; //remove the Ai handcuffs {_unit enableAI _x} forEach ["ANIM", "AUTOTARGET", "FSM", "MOVE", "TARGET"]; _unit setBehaviour _behaviour; _unit setUnitPos "UP"; detach _unit; //unlock the unit from it's ambient animation _unit removeEventHandler ["AnimDone",_animHandle]; _unit playMoveNow _transAnim; sleep ((random 3) + 3); //return to the default or previously set unit pos _unit setUnitPos _unitPos; };
  14. There is an event handler in the in-game interface, but it handles only the action menu. inGameUISetEventHandler ["Action", "_index = _this select 2; _title = _this select 4;"]; I need to find a way to get something like this, but for command menus.
  15. Thanks for the advice, I've already tried it. This can help, but in very limited cases. My scripts contain other commands that change the status of the currentCommand, such as doMove, for example. Therefore, in my case, I cannot use this method. There are also options in various menus that do not change the status of currentCommand.
×