Jump to content

Ibragim A

Member
  • Content Count

    64
  • Joined

  • Last visited

  • Medals

Everything posted by Ibragim A

  1. Remote EDs Separate Detonation on Steam Description: This mod allows the player to detonate remotely activated explosive devices one at a time, rather than all at once. Vanilla and mods supported TeamSwitch friendly The player can detonate not only those EDs that his unit has put, but also those that have been put by other switchable units. To do this, you need to be close to the switchable unit that placed the ED, and hover over it. Fixed and added issues: The mod works for any (!) types of remote EDs, not only for Democharge_Remote. If the ED exploded for any other reason or were deactivated, the action is removed from the list. The text of the action indicates who placed the ED and what kind. This is necessary to distinguish explosives putted by different switchable units. Copyrights: The mod was inspired by this Killzone_Kid's script
  2. The problem is as follows. I made a mod that works well if I put it to the root Arma folder and run it from the command line. But when I upload it on Steam and run it as a mod from Steam, it appears in the list of connected mods, but it does not work in the game. Have any of you faced such a problem and have you managed to solve it? The mod is very primitive, it only runs one script. PBO folder contains: $PBOPREFIX$.txt prefix=mymod config.cpp class CfgPatches { class Mymod { name = "Mymod"; author = "Ibragim A"; requiredVersion = 1.0; requiredAddons[] = {"A3_Data_F"}; units[] = {}; weapons[] = {}; }; }; class Extended_preInit_EventHandlers { mission_preinit = "[] execVM '\Mymod\function.sqf';"; }; function.sqf PC_DETONATE_EXPL_TEXT = localize "STR_PC_detonate_expl_text"; PC_fn_check_if_trigger_is_remote = { params ["_magazine"]; private _is_remote = false; private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); private _trigger = gettext (configFile >> "CfgAmmo" >> _ammo >> "mineTrigger"); if (_trigger in ["RemoteTrigger"]) then { _is_remote = true; }; _is_remote; }; PC_loop_player_set_demo = { while {true} do { waitUntil { sleep 0.5; /// Проверка, не нужно ли удалить какое-нибудь действие (если ВУ взорвалось без участия игрока, напр.) if (count (missionNamespace getVariable ["PC_all_charges_and_action_ids", []]) > 0) then { { if (!alive (_x select 0) ) then { (_x select 2) removeAction (_x select 1); (missionNamespace getVariable ["PC_all_charges_and_action_ids", []]) deleteAt _forEachIndex; }; } forEach (missionNamespace getVariable ["PC_all_charges_and_action_ids", []]); }; /// Проверка, имеет ли игрок этот обработчик событий: if (player getVariable ["PC_player_have_charge_eh", false]) then { false; /// Ждет, пока игрок поменяется } else { player setVariable ["PC_player_have_charge_eh", true, true]; true; /// Нарушает ожидание }; }; /// Добавление обработчика использования оружия: player addEventHandler ["Fired", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_gunner"]; if !([_magazine] call PC_fn_check_if_trigger_is_remote) exitWith { /// Это не взрывчатка с дистанционным детонатором }; /// Это взрывчатка с дистанционным детонатором: player setVariable ["PC_player_demo_charges", ((player getVariable ["PC_player_demo_charges", []]) + [_projectile]), true]; _n = count (player getVariable ["PC_player_demo_charges", []]); _surname = ((name player splitString "([ ]/:)") select 1); if (isNil "_surname") then { _surname = ((name player splitString "([ ]/:)") select 0); }; _mine = ""; _mine_short_name = getText (configFile >> "CfgMagazines" >> _magazine >> "displayNameShort"); if (_mine_short_name != "") then { _mine = _mine_short_name; } else { _mine = getText (configFile >> "CfgMagazines" >> _magazine >> "displayName"); }; _action_id = player addAction [format [PC_DETONATE_EXPL_TEXT + " #%1 (%2, %3)", _n, _mine, _surname], { params ["_target", "_caller", "_actionId", "_arguments"]; if (mineActive (_arguments select 1)) then { _target removeAction _actionId; (_arguments select 1) setDamage 1; } else { /// Мина деактивирована }; }, [_n-1, _projectile, _mine], 0,false,true,"", ""]; /// Вносим взрывчатку в массив со всеми поставленными взрывчатками: missionNamespace setVariable ["PC_all_charges_and_action_ids", (missionNamespace getVariable ["PC_all_charges_and_action_ids", []]) + [[_projectile, _action_id, _unit]], true]; }]; }; }; [] spawn PC_loop_player_set_demo; Stringtable.xml <?xml version="1.0" encoding="utf-8" ?> <Project name="PC"> <Package name="PC_TOUCH_OFF"> <Container name="Text"> <Key ID="STR_PC_detonate_expl_text"> <Russian>Взорвать бомбу</Russian> <Original>Touch off bomb</Original> </Key> <Key ID="STR_onebyone_name"> <Russian>Детонация ДВУ по одному</Russian> <Original>Detonation of RED One by One</Original> </Key> <Key ID="STR_onebyone_description"> <Russian>Мод позволяет детонировать любые взрывные устройства с дистанционным детонатором по одному</Russian> <Original>This mod allows you to detonate any explosive devices with a remote detonator one at a time</Original> </Key> </Container> </Package> </Project> @TouchOffByOne: https://files.fm/u/ztazjp84y
  3. This code in the player's init will disable the use of mines by the player near any building (if the player is within the boundingbox of that building) inGameUISetEventHandler ["Action", " if ( (_this select 3 == 'UseMagazine') && (call { _near = false; _all_buildings = nearestObjects [player, ['house','building'], 50]; if (count _all_buildings == 0) exitWith {_near}; { _box = boundingBox _x; _hypotenuse1 = sqrt (( abs ((_box select 0 select 0)^2))+( abs ((_box select 0 select 1)^2))); _hypotenuse2 = sqrt ((( _box select 1 select 0)^2)+( (_box select 1 select 1)^2)); _hypotenuse = selectMax [_hypotenuse1, _hypotenuse2]; if (player distance2d position _x < _hypotenuse) exitWith { _near = true; }; } forEach _all_buildings; _near; } ) ) then { true } " ];
  4. Start by creating an action handler that will disable the mine placement action. Here's an example: inGameUISetEventHandler ["Action", " if (_this select 3 == 'DisAssemble') then { hint 'You are not allowed to do this'; true } "]; Then turn on the processing of this handler only if the player is close to a building or gas station.
  5. Hi, take a look here and try this one: BIS_fnc_randomPosTrigger
  6. I only looked at the part of the code you asked the question for and did not see any other errors in it.
  7. The resize command does not return a value, so this line contains an error. Rewrite it like this: _TrenchUnits resize (count _TrenchPositions);
  8. Good evening. It would be nice to look at the contents of both arrays in the example, then it will be possible to understand whether you are trying to act correctly.
  9. This code, launched in the player's init, will help to avoid this bug: this addEventHandler ["AnimChanged", { params ["_unit", "_anim"]; if (_anim in ["amovppnemstpsnonwnondnon"] && currentWeapon _unit isEqualTo secondaryWeapon _unit && secondaryWeaponMagazine _unit isEqualTo []) then { if (primaryWeapon _unit isNotEqualTo "") exitWith { _unit selectWeapon (primaryWeapon _unit); }; if (handgunWeapon _unit isNotEqualTo "") exitWith { _unit selectWeapon (handgunWeapon _unit); }; if (binocular _unit isNotEqualTo "") exitWith { _unit selectWeapon (binocular _unit); }; _unit action ["SwitchWeapon", _unit, _unit, 100]; }; }];
  10. Platoon Commander on Steam Workshop [TEST] Script Platoon Commander Version: Platoon Commander beta 211011 Download Virtual Reality template for your own missions here. The Platoon Commander addon gives the player the ability to command a reconnaissance platoon, consisting of a player's squad and four AI squads (two sabotage and reconnaissance, mortar support and a transport group). With this script, a regular SP mission with a linear storyline turns into complete freedom of actions up to multi-stage planning from landing to evacuation. New Player Group Tactics: Offensive (from the flanks, fire and move, stalk, etc.) Retreat (back, left, right, flee) Defense (occupation of a building, all-round defense, taking cover) Ambushes (linear, V-shaped, L-shaped, customized by your own) Recon patrol Search of the bodies Rearmament and etc. New Sapper Actions (AI and Player): Mining doors Mining roads Mining bodies Mining hide covers Mining vehicles New Player Actions: Detonation of embedded explosives by choice (not only all at once) Ability to swap with units of the group with weapons and etc. New Tactics for AI Squads: Shoot at the enemy and flee Search of the bodies Undermining objects Mining roads Retreat Occupation of buildings Waiting for signal and etc. New Fire Modes: Fire on player signal (for the player's group and AI groups) Suppress when attacked Firing single, short and long bursts for riflemen. New Strategy: Command the entire platoon in real time. Wide range of actions and tactics for every AI squad. Ability to plan actions at your own, not limited to linear plots. Direct orders and planned actions Synchronized actions, support with mortar and armored vehicles. Settings: Complete freedom in customizing the platoon through the settings in the script About 50 customizable gameplay and visualization parameters Visualization: Radio messages between platoon squads Anamated radio calls Control via command menu similar to vanilla menu Script can be translated into other languages (Stringtable) Optimization: Loops in scripts are made in such a way that they have almost no effect on the frame rate Triggers are not used A special function that automatically corrects the bugged behavior/stucking of the units. A special function that partially corrects the behavior of vehicles while driving in a convoy.
  11. fn_knowsabout_handler = { params ["_target", "_who", "_wait"]; while {true} do { private _knowsAbout = _who knowsAbout _target; waitUntil { sleep _wait; if (_who knowsAbout _target isNotEqualTo _knowsAbout) exitWith { /// Code block on change: systemchat format ["%1 knowsAbout %2 value changed from %3 to %4", _who, _target, _knowsAbout, (_who knowsAbout _target)]; }; }; }; }; [player, somegroup, 0.5] spawn fn_knowsabout_handler;
  12. Ibragim A

    Using apply on group units

    What exactly isn't working? Group not being created? Are their equipment or weapons not changing? The script looks correct.
  13. BIS_fnc_nearestRoad does not return position, function returns road object. Therefore, you just need to get the position of this _nearestRoad. _result = [false, objNull]; //... _bridgePos = position _nearestRoad; _result = [(_roadInfo select 8), _bridgePos]; You will get return value of true and bridge position.
  14. Ibragim A

    Using apply on group units

    The BIS_fnc_spawnGroup function creates the group itself, so there is no need to first create it with the createGroup command. You can read about how the apply command works here. With its help, you cannot change the equipment of units. Your first code should work correctly. Anyway, it will run your script with every unit in the group as an argument. If it does't work, look for the error in the script itself. { [_x] execVM "unit_loadouts\checkgear.sqf" } forEach units testGroup;
  15. I think not. Try it like this: {_х addRating 1000000} forEach allUnits; In the script, in the trigger, whatever you want.
  16. To customize the unit rating, try this.
  17. Also try this command, I don't know, it might help: EAST setFriend [EAST, 1]; WEST setFriend [WEST, 1]; RESISTANCE setFriend [RESISTANCE, 1];
  18. How do I do it: For example, I have a group of green FIAs, but I want them to be blue. I put any blue unit in Eden and attach the whole group of green ones to it. Then I delete the blue unit and the whole group of green ones remains blue. This is the same as described by @JohnKalo above. But if you have a problem within the groups of one side, then try the same thing, but with the unit of the group with which the hostile group begins to fight.
  19. Ibragim A

    Any Idea of Mine Detection?

    It is necessary to clarify who we are talking about. Are we talking about mines that the player has placed and that the enemy's AI has detected? Or mines that are being detected by another group on the same side as the group that placed them? In fact, I've never seen an AI without a mine detector detect enemy mines. Тhe same thing with armored vehicles. Armored vehicles sometimes simply drive past a mine without hitting it with a wheel. (For this, I like to place a stretcher mine right next to a ground anti-tank mine)
  20. Ibragim A

    Any Idea of Mine Detection?

    I have a recon patrol script, that works like you see on this screenshot. Maybe something from this idea will come in handy for you.
  21. Ibragim A

    Any Idea of Mine Detection?

    I tried to do just that for a long time, but I never came to a satisfactory result. I realized that one object can affect the path of a unit, and even then not always. But two objects placed side by side with a high degree of probability will allow a unit to pass between them.
  22. Ibragim A

    Any Idea of Mine Detection?

    Of course, you can. But not for units - for whole side. west revealMine _mine;
×