Jump to content

Grumpy Old Man

Member
  • Content Count

    4333
  • Joined

  • Last visited

  • Medals

Posts posted by Grumpy Old Man


  1. On 10/13/2020 at 2:40 AM, beno_83au said:

    @Grumpy Old Man At the moment when selecting priorities for weapons/pylons you can only click to count up, until it resets back to 1. Is it possible to get a right-click added to the UI to count back down? I don't know if it's just me but I tend to click my way past a number and have to keep clicking to get back around to it again. Other than that this system still works really well!!

     

    Hey, I believe the current functionality to reduce priority by 1 is by using shift+LMB.

     

    Cheers

    • Thanks 1

  2. 2 hours ago, zagor64bz said:

    Is the function called by default at the mission start, without any command? And, furthermore, if I have a mission with the "regular" init.sqf, how do I make that init run as pre-init? Just define the class in the description?

    Sorry for my ignorance in this matter...

    Just how it says in the example.

     

    If the preInit parameter is set to 1, the function will run once during preInit.

    This is also the point where the function can run at full speed.

     

    You can't change how the init.sqf is handled, it's pretty much set in stone.

     

    If you have other functions that you want to run during pre/postInit or pre mission start you have to define them within CfgFunctions inside description.ext.

    Just give it a try and goof around with it, worst thing to happen could be a game crash.

     

    Cheers


  3. You're getting an array of locations from nearestLocations.

    getPos _x won't work on a location, you'd need locationPosition for that. Edit: See my post below.

     

    Also the entire thing doesn't make much sense.

    Why search for locations within 600m just to see if any is closer than 500m?

    Simply search for 500m and count the returning array instead, if that count is above 1, there's a location within 500m.

     

    Also don't name an array containing locations _markers, that can be confusing later down the line, since markers and locations are different data types (string vs location).

     

    Cheers

     

     

    • Like 3

  4. Don't iterate over an array while simultaneously deleting its elements:

    _array = ["myArray",  "myArray1", "myArray2", "myArray3", "myArray4", "myArray5","myArray6",  "myArray7", "myArray8"]; 
    _result=[]; 
    while {count _result < 4} do { 
    	_result pushBack (_array deleteAt (random floor count _array)) 
    }; 
    hint str _result

    DeleteAt already returns the deleted element, so might as well use it.

     

    Cheers

    • Like 2

  5. Where exactly are you running it from?

    Do you mean initServer.sqf?

    Is there a similar snippet running from a trigger or similar that might cause this?

    Also try running this spawned with a time conditional to make sure it only runs with the mission already running:

    _addBomb= [] spawn {
    	waitUntil {time>1};
    	waitUntil {count allUnits>=1};
    	_units = allUnits select {side _x == EAST};
    	_unit = selectRandom _units;
    	_unit addItem "UMI_Weed_Bale";
    	_unit setVariable['bombUnit', true, true];
    };

    Might not make a difference though, all I can think of without further detail, heh.

     

    Cheers

    • Like 1

  6. 14 minutes ago, fawlty said:

    This Script Mike needed help with I have a question about a few of the entries

     

    _ammo = getArtilleryAmmo [art1] select 4;   

    _dir = round random 360;              **360**     ?

    _dis = 50 + round random 100;      **50+ and 100**      ?

    _tgt = s1 getRelPos [_dis,_dir];   

    art1 doArtilleryFire [_tgt,_ammo,10]; // Fire 10 times

     

     

    I'm trying to have the rounds land a little closer to the target, any suggestions.

    Thanks

    Cut out the random dir/dist lines, which increase inaccuracy:
     

    _ammo = getArtilleryAmmo [art1] select 4;   
    art1 doArtilleryFire [s1,_ammo,10]; 

    Cheers

    • Like 1

  7. 2 minutes ago, CryptEarth said:

    As I'm developing a new mission with persistent saving of players loadouts (using extDB3 on server) I noticed that the slot for binoculars is an array. As I couldn't find any information about it: What's the reason for binoculars has an array instead of just a string for a class name? Can anyone hint me in the right direction?

     

    Thanks in advance ...

    The binocular command returns a string,  maybe you got it mixed up somewhere?

     

    Cheers


  8. You can also work with a simple parabolic formula for bullet  trajectories, since arma doesn't simulate coriolis force, earth curvature or air friction for bullets.

    This page has saved me many headaches, heh.

    You can get all values either from config (ammo muzzle speed at launch, etc.)  or from model (barrel direction vector),  just make sure you're using ASL positions.

    This way your artillery gun will be able to do direct fire and actually hit its target.

     

    Cheers

    • Like 3

  9. 1 hour ago, Rich_R said:

    Quick question. In one of the earlier versions there was an option to change the distance of aircraft serviced by the script, in other words they could be spread further out. I can't seem to find that anywhere in the latest version. Is this still doable?

     

    BTW this is one of the required scripts in everyone of our missions:)

    Was there? Can't remember, heh.

    Should be in  \scripts\GOM\functions -> GOM_fnc_aircraftLoadoutInit.sqf Line 1952:
     

    _obj nearEntities ["Air",50]

    With 50 being the distance, if I'm not missing anything.

     

    Cheers

    • Like 1

  10. Glad you got it sorted, and posted the solution instead of [solved], heh.

     

    As @Harzach stated, string is a data type that can contain text. Variable handles (or identifiers) like _value can hold any data type (like numbers, arrays, code, etc.).

    The format command automatically converts any passed variable into string, like so:

    _text = "Ten";
    _number = 10;
    _howToGetTen = {5 + 5};
    hint format ["How to get %1(%2): %3",_text, _number, _howToGetTen];

    Cheers

    • Like 1
×