Jump to content

Grumpy Old Man

Member
  • Content count

    3731
  • Joined

  • Last visited

  • Medals

Community Reputation

2544 Excellent

About Grumpy Old Man

  • Rank
    Chief Warrant Officer

core_pfieldgroups_3

  • Occupation
    Audio Engineer

Profile Information

  1. Delete specific item from weaponholder

    Not possible if you want to delete a specific one, as far as I know the first matching item inside the weaponholder will be deleted. So if you want to delete the third FAK out of ten, it will actually delete the first one. Cheers
  2. Here's a quick mortar snippet that's pretty versatile: //place markers and name them after which mortars you want there: //a marker named "spawnmortar01_east" will spawn an east side mortar at the marker position //init.sqf or wherever you seem fit GOM_fnc_mortarAutoReveal = { params ["_mortar"]; while {alive _mortar AND canFire _mortar AND count crew _mortar > 0} do { _enemySides = side _mortar call BIS_fnc_enemySides; _mag = currentMagazine _mortar; _nearby = (getposatl _mortar nearEntities 4000) select {side _mortar knowsAbout _x > 0 AND side _x in _enemySides AND _mortar getArtilleryETA [getposatl _x,_mag] > 0 AND getPosATL _x inRangeOfArtillery [[_mortar], _mag]}; //no enemies found which are in range and have a firing solution, skip and wait if (count _nearby > 0) then { //it's not really needed to reveal enemies to the mortar if you want the mortar to only fire an exact number of rounds, otherwise they will keep firing until the target is dead /* { effectiveCommander _mortar reveal [_x,4]; } forEach _nearby; */ //fire on a random target then look again _rounds = 4; (effectiveCommander _mortar) commandArtilleryFire [(getPosATL (selectRandom _nearby)),_mag,_rounds]; systemchat format ["%1 targets: %2",effectivecommander _mortar,count _nearby]; sleep _rounds * 6;//give enough time to fire all rounds, then start over }; sleep (3 + random 3); }; }; GOM_fnc_spawnMortars = { params ["_side",["_debug",true]]; _sides = [west,east,resistance]; if !(_side in _sides) exitWith {systemChat "Wrong side parameter"}; _mortarTypes = ["B_Mortar_01_F","O_Mortar_01_F","I_Mortar_01_F"]; _mortar = _mortarTypes select (_sides find _side); _markers = allMapMarkers select {toUpper _x find toUpper str _side >= 0};//for east this returns all markers containing "east" in the name _mortars = []; if (_debug) then {systemchat format ["Spawning %1 mortars: %2",_side,_markers]}; { _mortarSpawn = _mortar createVehicle getMarkerPos _x; createVehicleCrew _mortarSpawn; _mortars pushBack _mortarSpawn; } forEach _markers; {[_x] spawn GOM_fnc_mortarAutoReveal} forEach _mortars; if (_debug) then {systemchat format ["Spawn finished: %1",_mortars]}; }; //now when you want to spawn the mortars simply do this: _spawn = [east] call GOM_fnc_spawnMortars; Simply place markers on the map where you want mortars to spawn, name them mortarMarker_east01, mortarMarker_east02, etc. Then call the function as shown above, this will automatically spawn one mortar per marker and make it fire at random targets that are within range and hostile. Works simultaneously for all three main sides. Cheers
  3. arma3 is so sick

    We comparing played time again? Cheers
  4. 88th Clan

    Why not just drop them a hint? Nothing on their page looks like they even know what that number/icon combination means anyway. To clarify the icon, 8 stands for the eighth number in the alphabet, being h. Doubt hh means anything in spanish. Cheers
  5. Try adding checks in case BIS_fnc_findSafePos doesn't return anything usable (can return default map safe positions that can be mid-air etc). Other than that replace BIS_fnc_findSafePos with a simple getPos alternate syntax. There's no need to use the BIS function for waypoint positions, since waypoints get cancelled when they're not reachable. Cheers
  6. Dynamic Draw on Map With EH

    You can do all that from inside the eachFrame eventhandler. It's always good to have a single EH that does stuff for every aircraft, instead of having an EH for every aircraft: //bad: { addMissionEventHandler ["EachFrame",{ //do stuff }]; } forEach (vehicles select {typeof _x isKindOf "Air"}); //good: addMissionEventHandler ["EachFrame",{ { //do stuff } forEach (vehicles select {typeof _x isKindOf "Air"}); }]; Just as an example, but you'll catch my drift. So to draw a polygon for each aircraft you can simply do this: //initPlayerLocal.sqf: GOM_fnc_getPilotPolygon = { params ["_vehicle"]; [[_vehicle modelToWorldVisual [-10,0,0],_vehicle modelToWorldVisual [10,0,0],_vehicle modelToWorldVisual [-250,500,0],_vehicle modelToWorldVisual [250,500,0]],[0,0,1,1]] }; findDisplay 12 displayCtrl 51 ctrlAddEventHandler ["Draw",{ { (_this#0) drawPolygon ([_x] call GOM_fnc_getPilotPolygon); } forEach (vehicles select {typeOf _x isKindOf "Air"}); }]; Getting pretty solid 60fps with ~20 aircraft. Cheers
  7. Dynamic Draw on Map With EH

    Have a banana: Cheers
  8. Dynamic Draw on Map With EH

    Broadcasting an eachframe event to every player of a side is a terrible idea. Imagine having 10 players receiving this command, the server has to push out 600 remoteExecs per second at 60fps... Why not just run the function from initPlayerLocal.sqf? This way you can be sure every client is running it locally without stressing out the server. Also the proper syntax of remoteExec requires the script command to be in quotation marks, as seen on the wiki. Cheers
  9. When is Arma not Arma???

    So that's where they went! Cheers
  10. make an array with all buildings

    @pierremgi this could work on recent maps, just consider takistan where rarely any building has doors while still having positions. I'm sure @dlegion wants something different. 18000 buildings? There's only 900+ unique buildings with positions in vanilla a3. You can also try to grab the snippet above, put it in a function of your own function library and call it from preInit, should increase processing times significantly (this goes for any function that should be run only once and is very CPU intensive). Did it right now along with a comparison: Function: //getBuildingsWithPositions.sqf in mission root, adjust positions parameter to find houses with at least given number of positions GOM_fnc_buildingsWithPositions = []; _initTime = diag_tickTime; _allHouses = "configName _x isKindOf 'HouseBase'" configClasses (configFile >> "CfgVehicles") apply {configName _x}; systemChat str count _allHouses; _allHouses apply { _house = _x createVehicle [0,0,0]; _positions = _house buildingPos -1; if (count _positions >= 4) then {GOM_fnc_buildingsWithPositions pushBack _x}; deleteVehicle _house; }; copyToClipboard str ([format ["Data evaluated in %1s. Found %2 valid buildings",diag_tickTime - _initTime,count GOM_fnc_buildingsWithPositions]] + GOM_fnc_buildingsWithPositions); description.ext class CfgFunctions { class GOM { class preInit { class getBuildingsWithPositions{file = "getBuildingsWithPositions.sqf";postInit = 1}; } } } Tests: During mission runtime: "Data evaluated in 68.312s. Found 322 valid buildings" preInit: "Data evaluated in 65.945s. Found 322 valid buildings" postInit: "Data evaluated in 2.651s. Found 322 valid buildings" For some reason running this during postInit is happening at ludicrous speed, you can test it for yourself in this demo mission, simply change preInit to postInit in the description.ext and paste the results to a file. Running this from postInit shouldn't be noticeable at all, so that should work fine and would even take into account mod buildings etc. List of all vanilla buildings with at least 4 positions: Cheers
  11. What is your AI settings?

    I don't have any converted values, just goofed around with it a bit after the change, couldn't get any results that are close to before the change. A setUnitRecoilCoefficient above +2 also can force the unit to reacquire aim. Cheers
  12. Proper Bulletcam

    You could add an additional fired EH to slow down time until the projectile gets removed, like this: player addEventHandler ["Fired",{ _sleep = _this#6 spawn { setAccTime 0.05; waitUntil {!alive _this}; sleep 2; setAccTime 1; }]; Cheers
  13. Weapons won't fire from water

    That's the depth I can fire from, seems reasonable considering the water has no effect on the weapon other than preventing to fire it if it's partially submerged. Cheers
  14. Proper Bulletcam

    You'd need to update every bullet model on the server and broadcast it to every client on every frame. (rough approximation) Now imagine 2-3 folks firing miniguns for a minute... You can use setAccTime to influence game speed. Cheers
  15. Proper Bulletcam

    You could give BIS_fnc_diagBulletCam a try and adapt its code. You won't see bullets though, since they don't have a model, besides arty shells/rockets. Cheers
×