Jump to content

Maguila.gm

Member
  • Content Count

    13
  • Joined

  • Last visited

  • Medals

Everything posted by Maguila.gm

  1. I am trying to place a radio and make it to play a 3D music, however i was unsuccessfull. Can someone correct my code pls. My attempt: Create a description.ext file and write this: class CfgMusic { tracks[] = {}; class track1 { name = "song1"; sound[] = {"\music\song1.ogg", db+0, 1.0}; }; Then create a playMusic.sqf file and do this: // Get the radio object _radio = _this select 0; // Parameters for the sound _params = ["track1", 100, 1]; // Call the function to play the sound globally in 3D [_radio, _params] call CBA_fnc_globalSay3d; then in the radio initialization i wrote the following: this execVM "playMusic.sqf";
  2. class Header { gameType = COOP; // Modo do jogo - deixar coop minPlayers = 1; // Quantidade minima de players maxPlayers = 50; // Quantidade de maxima players }; class cfgMusic { tracks[] = {"song1"}; // Use aspas para nomear a música class song1 // Renomeado de track1 para song1 { name = "song1"; sound[] = {"Musica/Red_Army_is_the_Strongest_Rare_Version.ogg", db+10, 1.0}; // Corrija o caminho do arquivo de áudio }; }; onLoadMission = "Armapoint"; // Nome da missão onLoadName = "Za Rodinu"; author = "MAGUILA"; // Nome do editor onLoadMissionTime = 60; // Corrigido o comando para reproduzir a música onLoadIntro = [] spawn playMusic "song1"; loadScreen = "Fotos\Capa.jpg"; //Imagem da missão debriefing = 1; disabledAI = 0; showGPS = 1; onMinimapScript[] = {"BIS_fnc_customGPS_Spawn"}; respawn = 0; respawndelay = 600; // Nao auterar os valores onde não há explicação; I am currently trying to add a song in the mission loading screen but its not playing. Does someone know how to fix?
  3. I am currently working on a mission that uses AI scripting to provide support. In this mission, when tou call radio alpha, the artillery strike begins. The support group providing fire are coposed by 3 BM-21MLRS tht will fire at 3 separetly targets, in order to acheive that i've created 3 flies for each vehicle using the following script: [] spawn { while {alive gun_1G} do { sleep 5; _ammo = getArtilleryAmmo [gun_1] select 0; _tgt = getMarkerPos "arty1"; gun_1 doArtilleryFire[_tgt,_ammo,1];}} Where wilhe the gunner is alive, it will fire, in practice, it will fire until the ammo is depleted. The problem is, for each rocket launched it retracts the pod, wait 5 sec, aims again and fires. I want to make it to aim once an fire all the 40 rockets as fast as possible. For that i've tried to put the loop after the aiming command: [] spawn { sleep 5; _ammo = getArtilleryAmmo gun_3 select 0; _tgt = getMarkerPos "arty3"; while {alive gun_3G} do { gun_3 doArtilleryFire [_tgt, _ammo, 1]; // Small interval between while it recharges sleep 1; } }; however im getting all sorts of error messages.
  4. Maguila.gm

    BM-21 MLRS Fired by AI scripting

    i corrected doing this _arty = arty; _targetMarker = "a1"; // Substitua "a1" pelo nome do seu marcador // Obtém as coordenadas do marcador _targetPos = getMarkerPos _targetMarker; if (isNil "_targetPos") then { // Lida com o caso em que o marcador não é encontrado systemchat format ["Marker '%1' não encontrado!", _targetMarker]; } else { _artyAmmo = getArtilleryAmmo [_arty] select 0; _artyETA = _arty getArtilleryETA [_targetPos, _artyAmmo]; _inRange = _targetPos inRangeOfArtillery [[_arty], _artyAmmo]; systemchat format ["In range: %1", _inRange]; if (_artyETA > 0 && _inRange) then { systemchat "Cleared to fire!"; systemchat format ["Impact ETA: %1s", _artyETA]; _arty commandArtilleryFire [_targetPos, _artyAmmo, 40]; }; }
  5. Maguila.gm

    BM-21 MLRS Fired by AI scripting

    i changed the name of the target and luncher to match those of junior prado's code
  6. Maguila.gm

    BM-21 MLRS Fired by AI scripting

    i am still getting an error. 13:38:13 Error in expression <LRS\drop3.sqf" _arty = arty; _target = a1; _artyAmmo = getArtilleryAmmo [_art> 13:38:13 Error position: <a1; _artyAmmo = getArtilleryAmmo [_art> 13:38:13 Error Variável indefinida na expressão: a1 13:38:13 File c:\users\magui\onedrive\documentos\arma 3\mpmissions\[eap]vá_e_veja_v3.chernarus_2035\MLRS\drop3.sqf..., line 2 It says "error undifined variable at expression a1"
  7. I want to make a VLS to engage 18 targets so i made this code: west reportRemoteTarget [t1, 90000]; t1 confirmSensorTarget [west, true]; vls1 fireAtTarget [t1, "weapon_vls_01"]; sleep 30; west reportRemoteTarget [t2, 90000]; t2 confirmSensorTarget [west, true]; vls1 fireAtTarget [t2, "weapon_vls_01"]; sleep 30; west reportRemoteTarget [t3, 90000]; t3 confirmSensorTarget [west, true]; vls1 fireAtTarget [t3, "weapon_vls_01"]; sleep 30; west reportRemoteTarget [t4, 90000]; t4 confirmSensorTarget [west, true]; vls1 fireAtTarget [t4, "weapon_vls_01"]; sleep 30;... It works but is time consuming an not optimized. I asked ChatGPT to optimize so he gave me this, But it is not working. for [{_i = 1}, {_i <= 10}, {_i = _i + 1}] do { private _targetVar = format ["t%1", (_i)]; west reportRemoteTarget [_targetVar, 90000]; _targetVar confirmSensorTarget [west, true]; vls1 fireAtTarget [_targetVar, "weapon_vls_01"]; sleep 25; }; Does anyone know what is wrong
  8. I had a script to one enemy unit to ping on the map and have its position updated every 5 seconds and it worked: beaconblip1 = createMarker ["beacon1", v1]; beaconblip1 setMarkerShape "ELLIPSE"; beaconblip1 setMarkerColor "ColorGreen"; beaconblip1 setMarkerSize [15, 15]; while {true} do { "beacon1" setMarkerPos (getPos v1); sleep 5; }; I wanted do do for multiple units, i did multiple of the exemple 1 but after 20 or so it got very time consuming. So i did this and it is not working: // Define the array of enemy unit objects (replace these with your actual enemy unit objects) private _enemyUnits = [v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21]; // Create an empty array to hold the markers private _markers = []; // Create markers for each enemy unit { private _markerName = format ["enemyMarker%d", (_forEachIndex + 1)]; private _markerPos = getPos _x; _markers pushBack createMarker [_markerName, _markerPos]; _markers select (_forEachIndex) setMarkerShape "ELLIPSE"; _markers select (_forEachIndex) setMarkerColor "ColorRed"; // You can set this to whatever color you prefer _markers select (_forEachIndex) setMarkerSize [15, 15]; } forEach _enemyUnits; // Continuously update the marker positions based on enemy unit positions while {true} do { { private _markerName = format ["enemyMarker%d", (_forEachIndex + 1)]; _markerName setMarkerPos (getPos (_enemyUnits select _forEachIndex)); } forEach _enemyUnits; sleep 5; };
  9. Thanks, i had no idea i could do such a thing...
  10. I just wanted armoured vehicles to show up. but yes haha i know nothin to very little of coding and editing so most time i do things that are not the best
  11. private _enemyUnits = [v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v50]; { private _mk = createMarker [str random 1, getpos _x]; _mk setMarkerShape "ELLIPSE"; _mk setMarkerColor "colorRed"; _mk setMarkerSize [15,15]; [_mk,_x] spawn { params ["_mk","_enemy"]; while {damage _enemy < 1} do { _mk setMarkerPos _enemy; sleep 5; }; deleteMarker _mk; }; } forEach _enemyUnits Sorry to bother, but the code above is not running, do you know what is wrong
  12. Thank you so much! i will test here
×