Jump to content

Grumpy Old Man

Member
  • Content Count

    4333
  • Joined

  • Last visited

  • Medals

Everything posted by Grumpy Old Man

  1. Grumpy Old Man

    [Release] GOM - Aircraft Loadout V1.35

    I guess you missed the edited snippet above, so just in case replace line 1025 in scripts\GOM\functions\GOM_fnc_aircraftLoadoutInit.sqf with: _curDamage = getAllHitPointsDamage _veh #2 # (0 max (getAllHitPointsDamage _veh #2 findIf {_x > 0})); Cheers
  2. Made something similar a while ago: Should get you started. Cheers
  3. Grumpy Old Man

    [Release] GOM - Aircraft Loadout V1.35

    It sets ammoCargo/fuelCargo etc. to 0 and replaces that functionality with my own system, since vanilla A3 support vehicles are technically infinite, holding 1*10^12 (yes, that's a 1 followed by 12 zeroes) resources for whatever reason. You can adjust this using either the settings inside GOM_fnc_aircraftLoadoutParameters.sqf or by using setFuelCargo etc. on the vehicles. Cheers
  4. Grumpy Old Man

    opinion about findif vs count

    Use commands for their intended purpose. findIf when you need to find the first array element matching the criteria, count if you need to find how many elements are matching the criteria. Performance should be a concern if you actually run into performance issues (and I'm sure those will not be solved by switching from count to findIf or vice versa). Cheers
  5. Grumpy Old Man

    Complicated trigger activation

    It doesn't check for array equality, but returns common unique elements from array1 and array2. If there's 5 players on the map, 2 already in the chopper and there's 2 AI in the chopper, arrayIntersect will only return the 2 players that are also part of the crew array. Just play around a bit with the command, might be easier to figure out, heh. Cheers
  6. Grumpy Old Man

    Complicated trigger activation

    Could be something like this: _check = !alive satPhone AND (count (allPlayers select {alive _x and _x inArea YourTrigger}) isEqualTo count allPlayers AND count (crew YourChopper arrayIntersect allPlayers) isEqualTo count allPlayers); Cheers
  7. Grumpy Old Man

    Detect sea

    There's already worldSize. I'd try like this: _positions = [[0,0],[worldSize,0],[worldSize,worldSize],[0,worldSize]]; _positions findIf {surfaceIsWater _x} >= 0; Checks all 4 map corners for water. Maps with Ocean on it usually tend to have at least 1 map corner in the water. Can't think of anything that'll invalidate this check for now, heh. Maybe some edge case map with islands on all 4 corners and ocean on the rest? Hm. Cheers
  8. Grumpy Old Man

    DYNAMIC MARKER

    I don't even know where to start... Firstly _tank is an array, hence !alive _tank will fail since alive requires an object, even so, the !alive _tank makes no sense, since it will prevent the loop from running with an alive tank on the map (assuming you got the syntax right). Then you open a single parenthesis without ever closing it again. Also it's Ellipse, not "Ellypse" in the setMarkerShape line. Not quite sure about your variable naming, since naming an array _tank, or at least _tanks, implies it's holding objects, but yours is holding strings, so I assume it's pre placed markers? Hard to tell, since _tank is never correctly used anywhere else. Then you got an object called mark1? Or is it a marker? Not sure here either. Always try to be as concise and specific as possible when naming variables, also get some text editor with syntax highlighting. Map markers following objects has been discussed plentiful already, with quite a few working solutions out there, like this: Cheers
  9. Grumpy Old Man

    [Release] GOM - Aircraft Loadout V1.35

    Indeed, disregard that and use _curDamage = getAllHitPointsDamage _veh #2 # (0 max (getAllHitPointsDamage _veh #2 findIf {_x > 0})); instead. Should return the damage amount of the most damaged selection, or 0 if there is no damage. Also edited above post to prevent further confusion, heh. Cheers
  10. Grumpy Old Man

    [Release] GOM - Aircraft Loadout V1.35

    Try putting this in the editor console or similar: damage vehicle player Could be the returned value is 0, even when some sub selections of the vehicle are clearly damaged. Can remember running into this with another vehicle once, almost destroyed tyre, damage still returned 0. Judging from a comment on the wiki you can try to replace line 1025 in scripts\GOM\functions\GOM_fnc_aircraftLoadoutInit.sqf with this: _curDamage = getAllHitPointsDamage _veh #2 # (0 max (getAllHitPointsDamage _veh #2 findIf {_x > 0})); Might solve the issue. Edit: fixed wrong snippet, confusion on my part. Cheers
  11. Of course, same version as on 28 April 2018, so the latest one. Cheers
  12. Grumpy Old Man

    displaying successive hints

    this. All it needs for the hint system to break is some 3rd party script/mod to use hint with an eachFrame EH, as @gc8 stated, you can use an array to hold hint text, duration and even priority data and use your own functions to display the information as needed (ctrlCreate, etc.). Cheers
  13. Grumpy Old Man

    Slide an object across the ground

    You could always use one of the velocity commands, similar to this: oneachframe {testObject setVelocity velocity player} Cheers
  14. Grumpy Old Man

    Arma 3 help with finding a texture

    No need to add any textures, the script reads textures from vehicle A and copies them onto vehicle B while returning the used textures in the _usedTextures variable. Cheers
  15. Good points @.kju. In terms of machine learning in arma it would make more sense to do so on higher levels of the AI, think commander level or above, way too many variables on unit level to take into account, since a unit is able to do basically anything the player can (walk, swim, dive, climb ladders, drive land vehicles, planes, submarines, boats etc.), not to mention various weapon systems. Also its usefulness depends on gamemode/amount of players, I can imagine that a properly trained machine learning AI will wreck any player or coordinated group, even most more advanced FSMs out there do a pretty decent job at that. Cheers
  16. This will check for huron medical containers every second and you can add your stuff from there: //initServer.sqf _handleMedicalContainers = [] spawn { TAG_flag_medicalContainersActive = true; while {TAG_flag_medicalContainersActive} do { _containers = []; waitUntil { sleep 1; _containers = vehicles select {typeOf _x isEqualTo "B_Slingload_01_Medevac_F" AND alive _x}; !(_containers isEqualTo []) }; { //your ACE stuff here } forEach _containers; } }; Depends on if this needs to be a one time thing per container you'd need to lock them out, via setVariable/getVariable, like this: //initServer.sqf _handleMedicalContainers = [] spawn { TAG_flag_medicalContainersActive = true; while {TAG_flag_medicalContainersActive} do { _containers = []; waitUntil { sleep 1; _containers = vehicles select {typeOf _x isEqualTo "B_Slingload_01_Medevac_F" AND alive _x AND !(_x getVariable ["TAG_fnc_containerLockout",false])}; !(_containers isEqualTo []) }; { _x setVariable ["TAG_fnc_containerLockout",true]; //your ACE stuff here } forEach _containers; } }; Cheers
  17. Grumpy Old Man

    Arma 3 help with finding a texture

    You could copy paste textures from one vehicle to another with something like this: TAG_fnc_copyTextures = { params ["_from","_to"]; _textures = getObjectTextures _from; { _to setObjectTextureGlobal [_forEachIndex,_x]; } forEach _textures; _textures }; _usedTextures = [chopper1,chopper2] call TAG_fnc_copyTextures; Might work well enough for your purposes. Cheers
  18. Bad guys destroying nice shovel thingies. Me no like.
  19. Grumpy Old Man

    Help on "setFormation"

    "SAFE" or "CARELESS" behavior ignores set formation and forces a group to fall into some loose column formation. Cheers
  20. Yes, that's how it works, would even work with global variable if they're not broadcast to other clients, saving variables on objects is preferable though. To change the amount of money someone has, simply use the TAG_fnc_changeMoney function, as shown in the snippet. As already stated by others earlier, doing something like a money system for MP is a more intermediate undertaking and can be approached differently depending on how secure/foolproof you want it to be. Take my snippet as a mere starting point, since it doesn't take locality into account due to reasons mentioned earlier, heh. Cheers
  21. Grumpy Old Man

    Remove digits after comma

    To get rid of any digits after the comma you can always use floor. Also use an eachframe EH to make it look smooth: addMissionEventhandler ["EachFrame",{ if (alive vehicle player) then { _displaySpeed = floor speed vehicle player; [format ["%1", _displaySpeed],-0.99,-0.15,9999,0,0,202] spawn BIS_fnc_dynamicText; } }] Consider being more descriptive when picking a thread title, since you already went through the effort to make a screenshot, might as well decide for a more descriptive title. Cheers
  22. If the debug console is enabled for everyone and he knows how to use it he simply might have added the cash himself. It's usually better practice to keep stuff like cash variables on the holding object, instead of putting it as a global variable. You also could condense all these multiple addAction lines into a few functions, which will make adding more items more convenient, and also increase the customization of messages etc., so instead of this: shop1 addAction ["Buy Prowler (Unarmed) for $75", {if (cash >= 75) then { cash=cash-75; shop1 sideChat "Thank you for your purchase!"; dude1 = "B_LSV_01_unarmed_F" createVehicle getMarkerPos "garage_1";} else{ shop1 sideChat "Not enough money";}}]; shop1 addAction ["Buy Hunter (GMG) for $300", {if (cash >= 300) then { cash=cash-300; shop1 sideChat "Thank you for your purchase!"; dude1 = "B_MRAP_01_gmg_F" createVehicle getMarkerPos "garage_1";} else{ shop1 sideChat "Not enough money";}}]; shop1 addAction ["Buy IFV-6c Panther for $550", {if (cash >= 550) then { cash=cash-550; shop1 sideChat "Thank you for your purchase!"; dude1 = "B_APC_Tracked_01_rcws_F" createVehicle getMarkerPos "garage_1";} else{ shop1 sideChat "Not enough money";}}]; You could use something this: //list for vendor _pricelist = [["B_LSV_01_unarmed_F",75],["B_MRAP_01_gmg_F",300],["B_APC_Tracked_01_rcws_F",550]]; //functions to handle money and vendor items TAG_fnc_changeMoney = { params ["_unit","_amount"]; _currentMoney = _unit getVariable ["TAG_fnc_money",0]; if (_currentMoney + _amount < 0) exitWith { hint "Not enough money";false }; _newAmount = _currentMoney + _amount; _unit setVariable ["TAG_fnc_money",_newAmount]; hint format ["You %1 $%2.\nYou now have $%3.",["spent","received"] select (_amount > 0),abs _amount,_newAmount]; true }; TAG_fnc_addVendorItem = { params ["_vendor","_item","_price"]; _itemName = getText (configFile >> "CfgVehicles" >> _item >> "displayName"); _vendor addAction [format ["Buy %1 - $%2",_itemName,_price],{ params ["_vendor","_buyer","_ID","_arguments"]; _arguments params ["_item","_price","_itemName"]; _canBuy = [_buyer,-_price] call TAG_fnc_changeMoney; _message = "I'm afraid you can't quite afford that."; if (_canBuy) then { _message = format ["Enjoy your new %1, %2!",_itemName, name _buyer]; _item createVehicle getMarkerPos "garage_1" }; _vendor sideChat _message; },[_item,_price,_itemName],1.5,true,true,"","_target distance2D _this < 3"]; }; //add items and radio to vendor _vendor = shop1; if !("ItemRadio" in assigneditems _vendor) then {_vendor linkItem "ItemRadio"}; { [_vendor,_x#0,_x#1] call TAG_fnc_addVendorItem } forEach _pricelist; [player,850] call TAG_fnc_changeMoney;//for testing You basically set up a few functions to handle money change and vendor items, then all you need to add further items is to enhance the list on top with class name and price. You could even add custom vendor messages depending on which item has been bought, add random messages if money wasn't enough and all other flavor stuff. Should get you started anyway, of course you'd need to keep locality in mind and adjust it accordingly. Cheers
  23. I put most of my savings into stock of the biggest furniture company on altis. Go figure. Cheers
  24. Grumpy Old Man

    AI Spawn questions

    I'd suggest you check out some guides for this kind of stuff, it's pretty well covered, check out a guide like Mr. Murrays. It's for A2, yet most things still hold true and should get you started. Cheers
  25. Grumpy Old Man

    Who killed me when I die?

    That's vanilla functionality, when killed you get info about the unit and weapon that killed you. Camera only hovers near your body though. Can easily be scripted with eventhandlers. Cheers
×