Jump to content

Ibragim A

Member
  • Content Count

    192
  • Joined

  • Last visited

  • Medals

Everything posted by Ibragim A

  1. You should use a conversation system, not just a radio commands. Put in the description.ext of the mission: class cfgSentences { class allTalks { class Orders { file = "allOrders.bikb"; }; }; }; Create allOrders.bikb in your mission folder and put in it: class Sentences { class LeaderReplies { text = "%Reply"; speech[] = {%Reply}; class Arguments { class ReplyToOrder { type = "simple"; }; }; actor = ANY; }; }; class Arguments {}; class Special {}; startWithVocal[] = { hour }; startWithConsonant[] = { europe, university }; After that, create your own radio channel, for example: YOUR_COMMAND_CHANNEL_ID = radioChannelCreate [ [0.8275*1.4, 0.8196*1.4, 0.1961*1.4,1], "Just_Command_Channel", "%UNIT_GRP_NAME", [], true ]; Now you can use it to play those expressions (Words) that are in the protocols, for example: // receiver player // sender unit_1 player kbAddTopic ["Orders", "allOrders.bikb"]; unit_1 kbAddTopic ["Orders", "allOrders.bikb"]; YOUR_COMMAND_CHANNEL_ID radioChannelAdd [player, unit_1]; unit_1 kbTell [ player, "Orders", "LeaderReplies", ["Reply", {}, "All Clear!", [selectRandom ["AreaClear","Clear"]]], YOUR_COMMAND_CHANNEL_ID ];
  2. I don't know how practical this will be, but you can try using the setVelocityModelSpace command. The result may be unexpected.
  3. _markersToReview = allMapMarkers select {_x find "mark_" isEqualTo 0 AND markerShape _x in ["RECTANGLE","ELLIPSE"]};
  4. Since the shot happens quite quickly, you will most likely have to add an event handler to the units, and not check the trigger state. To get started, just put a trigger or create it in a script. Give it a name (variable name), for example, trg_1. Then add a shot handler to all units that need it: _units = allUnits; // As an example { _x addEventHandler ["FiredMan", { params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"]; // Here is your block called on every fired shot: if (_weapon in ["Throw","Put"] or !alive trg_1) exitWith {}; // Will not continue, if unit throws some grenade or put an explosive or trigger is deleted if (_unit inArea trg_1) then { // Here is your block called in case _unit fired while in area of trg_1 call Your_script.sqf // As an example deleteVehicle trg_1; // If you do not need to call Your_script.sqf on every shot } }]; } forEach _units; This handler will check at each shot whether the unit is inside the trigger trg_1, and if so, then run the script that you need. So, if you need the script to run only once, and not from each shot in the trigger, that you need to delete the trigger at the first shot in it, as you can see it in the code.
  5. Use group as an argument, not leader. _GroupVehicles = [group _Groupleader, true] call BIS_fnc_groupvehicles;
  6. In order to pass arguments to the event handler, you need to replace the code with a string and add arguments via the format command. Try to add this handler to the player's init and you'll see how it works: this addEventHandler [ "FiredMan", format [ ' params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile", "_vehicle"]; systemchat "%1"; ', name player ] ];
  7. Ibragim A

    Object in a place

    If you use a marker instead of a trigger, then you need to write a separate script to check the condition after a certain period of time while {true} do { sleep 1; if (count (((entities "") select {typeOf _x isEqualTo "Land_Table_EP1" and _x inArea "Site"})) > 0) then { hint "X thing"; } };
  8. Ibragim A

    Object in a place

    If the Site is the name of the trigger, then you'd better use its condition field to activate it and activation field to call your X thing. Condition: {typeOf _x isEqualTo "Land_Table_EP1"} count thisList > 0 Activation: hint "X thing"; This should work with units, but I'm not sure if it will work with interior items as well. Take a look here.
  9. That is, we have a player group and another AI group. The leader of this AI group tells his units - move there, the enemy is there, and so on. Is there a way to get his message in the form of string that would be displayed in the player's chat if he were in his group, and even better a reference to the audio files that make up his message (Group - move - Back, for example).
  10. OK, I'll explain in more detail what I wanted to get. I have several AI groups that act as one platoon. But they don't communicate with the player. The leader of each of these groups sends messages only to his units. I need to make sure that he also passes some of his commands to his units to a player who is in another group. For example, if the leader of the AI group notices an enemy, he reports it only to his units (Contact - 75 meters - Front). I want to send the same message on behalf of this leader to the player via commandChat. The problem is that I do not know how to get a string with this message or best of all links to audio files that are used to play this message. There is a kbTell command, with which you can compose your message from different strings and audio files and transmit it as a separate message. I need to do the opposite - get the source data that kbTell uses from the message. There is also HandleChatMessage event handler. He returns the necessary arguments to me, but he handles messages in the chat, but the leader of the AI group does not transmit anything to the player in the chat, because he is in another group. He just says his message in the game.
  11. Download and look how this script is made, it shows how dead units can be attached to moving objects and then detached. I used this script a long time ago, it is possible that now it may contain some errors. Drag Dead Body Script
  12. The Community WIKI states that a dead unit and a weapon holder are different things, but there is an association between them. See, for example, getCorpse. See also: vehicles.
  13. I mean something completely different. I want to make that some of the messages that the leader of the AI group says to his units, he also transmits over the side chat or command chat (custom chat ...) to the player.
  14. Ibragim A

    Object attaching to humans

    See attachTo main syntax followBoneRotation argument and set it to true.
  15. Try to force your arta hold fire in all cases: (driver m1) setCombatMode "BLUE"; Then make them open fire by: (driver m1) setCombatMode "YELLOW";
  16. Ibragim A

    Object attaching to humans

    Try to play with numbers in this code: box attachTo [man, [-0.1,-0.13,+0.1], "pelvis", true]; See attachTo main syntax.
  17. Try this very simple script (put in init.sqf or activate by trigger) : [] spawn { _groups = allGroups select {side _x in [WEST,EAST,RESISTANCE,CIVILIAN]}; /// Select sides while {true} do { sleep 1; { _group = _x; _waypoints = waypoints _group; { _waypoint = _x; if (waypointType _waypoint isEqualTo "SENTRY") then { _waypoint setWaypointType "MOVE"; }; } forEach _waypoints; } forEach _groups; }; };
  18. Ibragim A

    Spawn a group as cargo

    Pay attention to what the functions return. https://community.bistudio.com/wiki/BIS_fnc_spawnVehicle https://community.bistudio.com/wiki/BIS_fnc_spawnGroup //boat patrol private _vehgrp1 = createGroup [east, true]; private _boat1 = [[7229.31,19598.3,0],350,"O_G_Boat_Transport_01_F",_vehgrp1] call BIS_fnc_spawnVehicle; _boat1 = _boat1 select 0; private _boatmen = [position _boat1, EAST, ["O_Soldier_F","O_Soldier_F","O_Soldier_F" ,"O_Soldier_F"]] call BIS_fnc_spawnGroup; {_x moveInCargo _boat1;} forEach units _boatmen; { _x setSkill ["general",1]; _x setSkill ["courage",1]; _x setSkill ["aimingAccuracy", 0.15]; _x setSkill ["aimingShake", 0.50]; _x setSkill ["aimingSpeed", 0.50]; _x setSkill ["reloadSpeed", 0.50]; } forEach (units _boatmen); _vehgrp1 setBehaviourStrong "AWARE"; _vehgrp1 allowFleeing 0; [_vehgrp1, 0] setWaypointBehaviour "AWARE"; private _boatwp1 = _vehgrp1 addWaypoint [[7229.31,19598.3,0],-1]; _boatwp1 setWaypointType "MOVE"; [_vehgrp1, 1] setWaypointBehaviour "AWARE"; private _boatwp2 = _vehgrp1 addWaypoint [[7512.96,19268,0],-1]; _boatwp2 setWaypointType "MOVE"; [_vehgrp1, 2] setWaypointBehaviour "AWARE"; private _boatwp3 = _vehgrp1 addWaypoint [[7229.31,19598.3,0],-1]; _boatwp3 setWaypointType "CYCLE"; [_vehgrp1, 2] setWaypointBehaviour "AWARE";
  19. If you need an additional menu to run your own scripts, then this menu is unlikely to help you, because it will only give you the opportunity to launch a sound and a chat message. But you can make your own menu and launch it immediately after opening the custom menu. The code might look something like this: Your_new_menu = [ ["Custom Menu 1",true], ["Test Command 1", [2], "", -5, [["expression", "systemchat 'test message 1'"]], "1", "CursorOnGround", "\a3\Ui_f\data\IGUI\Cfg\Cursors\attack_ca.paa"], ["Test Command 2", [3], "", -5, [["expression", "systemchat 'test message 2'"]], "1", "1", "\a3\Ui_f\data\IGUI\Cfg\Cursors\tactical_ca.paa"] ]; while {true} do { waitUntil { sleep 0.05; commandingMenu isEqualTo "#CUSTOM_RADIO"; }; showCommandingMenu "#USER:Your_new_menu"; };
  20. Why don't you make several arrays with you defined routes, where each waypoint will be created in place of the marker you put in the EDEN editor? in the init of the mission , it can be written like this: _route_1_markers = ["marker_1", "marker_2"]; _route_2_markers = ["marker_3", "marker_4"]; _all_routs = [_route_1_markers, _route_2_markers]; { _grp = _x; _random_route = selectRandom _all_routs; _all_routs = _all_routs - _random_route; /// If you want to exclude the possibility of the same route for two different groups. { _marker = _x; _wp = _grp addWaypoint [getMarkerPos _marker, 0]; _wp setWaypointType "HOLD"; } forEach _random_route; } forEach [grp_A, grp_B];
  21. The question is how to play several audio files using a custom radio, but so that they are played in one indivisible message? For example, a player's orders to the units of his group consist of a units, an order, distance and direction. For example: "1, 2 - move - 50 meters - back." It is clear that the units "1,2.", the order "move", the distance "50 meters" and the direction "back" are recorded separately and the game engine collects them into one indivisible message. Is it possible to do the same with custom user sounds? I tried configuring several messages in cfgSound and cfgRadio and then playing them one after the other in a row. But the problem is that if another message starts playing during playback, the custom messages are cut off and continue after the message that intervened between them finishes playing.
  22. Thanks for the hint, I figured out how to do it. But now there is another issue. The radio channels are not synchronized with each other. If a player transmits an audio message via a custom channel and at the same time begins transmitting via the group channel another one, the first message is cut off and resumed only after the second one finishes sounding. If a player transmits an audio message on a side channel and at the same time starts transmitting another message on the group channel, they overlap one another and sound at the same time. The transmission time is synchronized only if the player transmits two messages on the same channel. Then the second begins to sound only when the first one ends.
  23. 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];
  24. 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.
  25. Ibragim A

    Cycling Waypoints

    _wp3 setWaypointStatements ["true", "vehicle this setPos [9178.48,6907.43,0]"];
×