Jump to content

breeze

Member
  • Content Count

    522
  • Joined

  • Last visited

  • Medals

Posts posted by breeze


  1. I read to enable this on KillZone KIds blog

     

    -showScriptErrors

     

    and I am just beginning to learn scripting so I want to. However, I also have been using the Arma Launcher that comes with the game and Can I add that to the launchers shortcut? I don't think so but I am not sure.

     

    Is there a really good Arma 3 launcher out there that allows for separate mod folders and such. I do not like steam running my content they always screw it up.

     

    Thanks in advance

    Breeze

     


  2. Well I will keep reading this and try applying this a few ways just for my learning experience. I want to thank you guys for the patience.

    I had done the tutorials by DevPaxton on youtube thought they were great the way he explains things.

    So you guys took me right past the variables into complex arrays. Its this syntax stuff drives me nuts,

     

    But thanks again I will keep at it.


  3. OK I think I follow all that you have said its just this is zipping right past variables into arrays. These are multidimensional arrays right??

     

    And the one part I am not following Is the spot where your writing  

     

    [chopper1] call _animateOpen 

     

     

    Also where theend3r defined

     

    _chopper1 = this select 0; /// This is so it can be used on any aircraft as he said so 

     

    [this] spawn fnc_ramps; ////in any aircrafts init line would work if the _chopper1 is defined as _chopper1 this select 0; in the array? 

     

    and you are naming the script fnc_ramps.sqf ??


  4. OK well I appreciate all of the feedback I really do, But sometimes I am not understanding and I want to. 

     

    So anyway I got an undefined variable when I used this

     

     

    _myChopper = Chopper1;
    while {alive _myChopper} do {
         if (( getPos _myChopper select 2) > 3) then {_myChopper animate ["ramp_top",0]; _myChopper animate ["ramp_bottom",0];};
         if (( getPos _myChopper select 2) < 3) then {_myChopper animate ["ramp_top",1]; _myChopper animate ["ramp_bottom",1];};
    }
     
    I like being able to call it from any vehichle with a ramp like the osprey or a C130 for jumps but this didnt work.
     
    I used the 
     
    _nul = [chopperName] execVM "ramp.sqf";
     
    in the choppers init line...
     
    And just one more question because you used setpos you needed to index with select, 2
     
    But if we use the setPosAsl thats just one value of height right so it would not require a select index number???
     
    Lastly where should I put the sleep thing for efficiency??

  5. OK I have a couple of questions.??

     

    First I need to define the Variables with the first paragraph correct?

     

    _myChopper = Chopper1
    _animateClose = _myChopper animate ["ramp_top",0]; _myChopper animate ["ramp_bottom",0] ;
     _animateOpen = _mychopper animate ["ramp_top",1]; _myChopper animate ["ramp_bottom",1];
     
     
    Then once the _animateOpen and _animateClose are defined
     
    _myChopper = _this select 0;  ///Where you have _this select 0; What index is this referring to? 

    while {alive _myChopper} do {
    if (( getPos _myChopper select 2) > 3) then {_myChopper animate ["ramp_top",0]; _myChopper animate ["ramp_bottom",0];};
    if (( getPos _myChopper select 2) < 3) then {_myChopper animate ["ramp_top",1]; _myChopper animate ["ramp_bottom",1];};
    }

     
     while {alive _myChopper} do {

    if (( getPos _myChopper select 2) > 3) then {_myChopper  _animateClose};
    if (( getPos _myChopper select 2) < 3) then {_myChopper  _animateOpen};
    }

     

    I mean I am new I am trying to follow something that I can make sence of.. When you used the index I was thrown because I saw nothing defined to be using it? Then once each parameter is defined? I can just call it by name without the quotes because its no longer a string?

     
     
    When  _nul = _myChopper execVM "animate_ramp.sqf" This is in the units init line..
    Is the nul acting like a switch here I read that nil and nul shut off a script after it runs??

  6. So Like this?

     

    I named it animate_ramp.sqf and tried to execute it with execVm in the init.sqf not working.

     

    //Animate Door script 
     
     
    _myChopper = Chopper1
    _animateClose = _myChopper animate ["ramp_top",0];
                    _myChopper animate ["ramp_bottom",0];
     _animateOpen = _mychopper animate ["ramp_top",1];
                    _myChopper animate ["ramp_bottom",1];
     
    Params ["_myChopper"]
     
    while {alive _myChopper} do {
        If (( getPosAsl _myChopper select 0) >3)then _animateClose};
        If (( getPosAsl _myChopper select 0) <3)then _animateOpen);

  7. Just finished a few tutorials and wanted to automate the animations of the hatch going up and down on some test mission I was doing, I thought that it was a perfect little script to begin on.

     

    So in the init box on the Chopper at this time, I had the following.

     

    this animate ["ramp_top" 1];

    this animate ["ramp_bottom" 1];

    this keeps it open at spawn 

     

    In a trigger set with a heli-pad I have this and when the chopper lands it opens

    this animate ["ramp_top" 0];

    this animate ["ramp_bottom" 0];

     

    These work But for learning purposes I wanted to make a small script and initiate it in the Init.sqf file

     

     

     //Animate Door Scripting

     

     

    _myChopper = Chopper1
    _animateClose = _myChopper animate ["ramp_top",0]["ramp_bottom",0];   ///I don't think this is joined right but not sure how to
    _animateOpen = _mychopper animate ["ramp_top",1] ["ramp_bottom",1];
     
    _myChopper getPosAsl;
     
    if getPosAsl > 3 _animateClose;
    if getPosAsl < 3 _animateOpen;
     
    I think the if statement is right but not sure either.
     
    Any help??
     
     
     
    Also I loved the tutorials by devPaxton on you tube if you guys know any others like his please drop a link.

  8. I put this line 

     

    blackfish animate Door ['door_1_source', 1]; // open

    In the ospreys Init line and it didn't work. I also named the osprey blackfish??

    Does that have to be tied to a trigger as well? I mean I love the idea of using a trigger for it for the Halo Jump which is What I wanted but I was trying to have the hatch open on the spawn in.


  9. Thank You, Also when I am laying down my way-points the plane doesn't take off after I load, 

    I have two groups one pilots then 2nd group soldiers, I set the pilots way-points to get in and then to load, after that to move, After the plane loads it just sits there, so I tried to create a trigger with radio command to the move way-point and still nothing, I want the plane to go through a set of way-points after the group gets in. Any idea what I am doing wrong?


  10. Hello Guys, 

     

    I am back to playing Arma after a very long reprieve and as I age I forget stuff. Not to mention things change a lot. Anyways I usually try to learn by UnPboing other missions and grabbing scripts and trying to make them work together as well as some reading.

     

    So I play my 1st mission the other night which I really enjoyed, and I come across these scripts.

     

    Get Loadout I have some questions and I am hoping you can shed some light on these so I can use them,

     

     

     

    AUTHOR: aeroson
    NAME: get_loadout.sqf
    VERSION: 3.4
     
    DOWNLOAD & PARTICIPATE:
     
    DESCRIPTION:
    I guarantee backwards compatibility.
    These scripts allows you set/get (load/save)all of the unit's gear, including:
    uniform, vest, backpack, contents of it, all quiped items, all three weapons with their attachments, currently loaded magazines and number of ammo in magazines.
    All this while preserving order of items.
    Useful for saving/loading loadouts. 
    Ideal for revive scripts where you have to set exactly the same loadout to newly created unit.
    Uses workaround with placeholders to add vest/backpack items, so items stay where you put them.
     
    PARAMETER(S):
    0 : target unit
    1 : (optional) array of options, default [] : 
    "ammo" will save ammo count of partially emptied magazines
    "repetitive" intended for repetitive use, will not use selectWeapon, means no visible effect on solder, but will not save magazines of assigned items such as laser designator batteries
     
    The Parameters do not list any types of weapons so this is basically just turning things on and off, and the Load out is defined by the mission maker at the time of making the mission which can now be done in the eden editor arsenal??
     
    RETURNS:
    Array : array of strings/arrays containing target unit's loadout, to be used by fnc_set_loadout.sqf
     
    addAction support:
    Saves player's loadout into global var loadout
     
    */
     
    private ["_target","_options","_saveMagsAmmo","_isRepetitive","_isOnFoot","_currentWeapon","_currentMode","_isFlashlightOn","_isIRLaserOn","_magazinesAmmo","_loadedMagazines","_saveWeaponMagazines","_getMagsAmmo","_backPackItems","_assignedItems","_data"];
     
    _options = [];
     
    // addAction support
    if(count _this < 4) then {
    #define PARAM_START private ["_PARAM_INDEX"]; _PARAM_INDEX=0;
    #define PARAM_REQ(A) if (count _this <= _PARAM_INDEX) exitWith { systemChat format["required param '%1' not supplied in file:'%2' at line:%3", #A ,__FILE__,__LINE__]; }; A = _this select _PARAM_INDEX; _PARAM_INDEX=_PARAM_INDEX+1;
    #define PARAM(A,B) A = B; if (count _this > _PARAM_INDEX) then { A = _this select _PARAM_INDEX; }; _PARAM_INDEX=_PARAM_INDEX+1;
    PARAM_START
    PARAM_REQ(_target)
    PARAM(_options,[])
    } else {
    _target = player;
    };
     
    _saveMagsAmmo = "ammo" in _options;
    _isRepetitive = "repetitive" in _options;
    _isOnFoot = vehicle _target == _target;
             
    _currentWeapon = "";
    _currentMode = "";
    _isFlashlightOn = false;
    _isIRLaserOn = false;
     
    _magazinesAmmo = magazinesAmmoFull _target;
     
    // save weapon mode and muzzle
    if(_isOnFoot) then {
    _currentWeapon = currentMuzzle _target;
    _currentMode = currentWeaponMode _target;
    _isFlashlightOn = _target isFlashlightOn _currentWeapon;
    _isIRLaserOn = _target isIRLaserOn _currentWeapon;
    } else {
    _currentWeapon = currentWeapon _target;
    };
     
     
    _loadedMagazines=[];
     
    // universal weapon saving
    _saveWeaponMagazines = {
    private ["_weapon","_magazines","_muzzles","_saveMagazine"];
    _weapon = _this select 0;
    _magazines = [];
     
    _saveMagazine = { // find, save and eat mag for _weapon
    private ["_weapon","_magazine","_ammo"];
    _weapon = _this select 0;
    _magazine = "";
    _ammo = 0;
    {
    if((_x select 4)==_weapon) then {
    _magazine = _x select 0;
    _ammo = _x select 1;
    _x = -1;
    };
    } forEach _magazinesAmmo;
    _magazinesAmmo = _magazinesAmmo - [-1];
    if(_magazine!="") then {
    if(_saveMagsAmmo) then {
    _magazines set [count _magazines, [_magazine, _ammo]];
    } else {
    _magazines set [count _magazines, _magazine];
    };
    };
    };
     
    if(_weapon != "") then {
    [_weapon] call _saveMagazine;
    _muzzles = configFile>>"CfgWeapons">>_weapon>>"muzzles";
    if(isArray(_muzzles)) then {
    { // add one mag for each muzzle
    if (_x != "this") then {
    [_x] call _saveMagazine;
    };
    } forEach getArray(_muzzles);
    };
    };
     
    _loadedMagazines set [count _loadedMagazines, _magazines];
    };
     
    // save loaded mags for each weapon separetely, since some weapons can use same magazines
    [primaryWeapon _target] call _saveWeaponMagazines;
    [handgunWeapon _target] call _saveWeaponMagazines;
    [secondaryWeapon _target] call _saveWeaponMagazines;
     
    _getMagsAmmo = { // default function with _saveMagsAmmo == false
    _this select 0;
    };
    if(_saveMagsAmmo) then {
    // check if input array contains magazine, if it does, find it add ammo count
    _getMagsAmmo = {
    private ["_items","_location","_item","_itemIndex"];
    _items = _this select 0;
    _location = _this select 1;
    {
    _item = _x;
    _itemIndex = _forEachIndex;
    {
    if((_x select 4)==_location && (_x select 0)==_item) then {
    _items set[_itemIndex, [_item, _x select 1]];
    _x = -1;
    };
    } forEach _magazinesAmmo;
    _magazinesAmmo = _magazinesAmmo - [-1];
    } forEach _items;
    _items;
    };
     
    };
     
    // get backpack items
    _cargo = getbackpackcargo (unitbackpack _target);
    _backpacks = [];
    {
    for "_i" from 1 to ((_cargo select 1) select _foreachindex) do {
    _backpacks set [count _backpacks, _x];
    };
    } foreach (_cargo select 0);
    _backPackItems = (backpackitems _target) + _backpacks;
     
    // get assigned items, headgear and goggles is not part of assignedItems
    _assignedItems = assignedItems _target;
    _headgear = headgear _target;
    _goggles = goggles _target;
    if((_headgear != "") && !(_headgear in _assignedItems)) then {
    _assignedItems set [count _assignedItems, _headgear];
    };
    if((_goggles != "") && !(_goggles in _assignedItems)) then {
    _assignedItems set [count _assignedItems, _goggles];
    };
     
     
     
    /*
    // use this once magazinesAmmoFull is fixed and shows magazines of assignedItems
     
    // get magazines of everything else except weapons, most likely assigned items
    // only ["Uniform","Vest","Backpack"] locations remain, weapon locations have already been eaten
    _magazines = [];
    {
    if(_x select 2) then {
    if(_saveMagsAmmo) then {
    _magazines set[count _magazines, [_x select 0, _x select 1]];
    } else {
    _magazines set[count _magazines, _x select 0];
    };
    _x = -1;
    };
    } forEach _magazinesAmmo;
    _magazinesAmmo = _magazinesAmmo - [-1];
    _loadedMagazines set [3, _magazines];
    */
     
     
    // old method using selectWeapon, cycles and tries to selectWeapon all assigned items
    if(!_isRepetitive) then {
    private ["_weaponHasChanged"];
    _weaponHasChanged = false;
     
    // get magazines of all assigned items
    _magazines = [];
    {
    _target selectWeapon _x;
    if(currentWeapon _target==_x) then {
    _weaponHasChanged = true;
    _magazine = currentMagazine _target;
    if(_magazine != "") then {
    if(_saveMagsAmmo) then {
    _magazines set[count _magazines, [_magazine, _target ammo _x]];
    } else {
    _magazines set[count _magazines, _magazine];
    };
    };
    };
    } forEach _assignedItems;
    _loadedMagazines set [3, _magazines];
     
    // select back originaly selected weapon and mode, only if weapon has changed
    if(_weaponHasChanged) then {
    if(_isOnFoot) then {
    if(_currentWeapon != "" && _currentMode != "") then {
    _muzzles = 0;
    while{ (_currentWeapon != currentMuzzle _target || _currentMode != currentWeaponMode _target ) && _muzzles < 200 } do {
    _target action ["SWITCHWEAPON", _target, _target, _muzzles];
    _muzzles = _muzzles + 1;
    };
    if(_isFlashlightOn) then {
    _target action ["GunLightOn"];
    } else {
    _target action ["GunLightOff"];
    };
    if(_isIRLaserOn) then {
    _target action ["IRLaserOn"];
    } else {
    _target action ["IRLaserOff"];
    };
    };
    } else {
    _currentMode = "";
    };
    if(_currentMode == "") then {
    if(_currentWeapon=="") then {
    _target action ["SWITCHWEAPON", _target, _target, 0];
    } else {
    _target selectWeapon _currentWeapon;
    };
    };
    };
    };
     
       
    _data = [
    _assignedItems, //0 []
     
    primaryWeapon _target, //1 ""
    primaryWeaponItems _target, //2 []
     
    handgunWeapon _target, //3 ""
    handgunItems _target, //4 []
     
    secondaryWeapon _target, //5 ""
    secondaryWeaponItems _target, //6 []
     
    uniform _target, //7 ""
    [uniformItems _target, "Uniform"] call _getMagsAmmo, //8 ["magazine without ammo count",["magazine with ammo count",30], ....]
     
    vest _target, //9 ""
    [vestItems _target, "Vest"] call _getMagsAmmo, //10
     
    backpack _target, //11  ""
    [_backPackItems, "Backpack"] call _getMagsAmmo, //12
     
    _loadedMagazines, //13 (optional) [[primary mags],[handgun mags],[secondary mags],[other mags]]
    _currentWeapon, //14 (optional) ""
    _currentMode //15 (optional) ""
    ];
     
    // addAction support
    if(count _this < 4) then {
    _data;
    } else {  
    loadout = _data;
    //playSound3D ["A3\Sounds_F\sfx\ZoomOut.wav", _target];
    };   
     
     
     
    My other questions are How can I Turn Items on and off as in this script the helmet and glasses do not work,, Because they are not an assigned item, So can I turn any item on and off in this??
    Do I need to?? Or can I just arm my guy in the arsenal add these scripts and they should work well??
     
     
    Thanks in advance
     
    Breeze
     

  11. You know honestly I wasn't sure, because I started to chase everything, What was different was that I am used to running a server used to have them over the years and I even had one of the 1st Arma servers but back then I ran them on Large dedicated servers. Here I am trying to run a seperate instance of a server on the same machine. I wound up finding something by Killzone Kid. With a sample mission and BAT file Just changed all the names to match my configs and bamm It was working..

     

    Next week if I have time I want to try to get a dedicated on another machine on My LAN but when I did the install from steam I am getting some DLL error that they say is caused by Direct X

    The machine runs windows 10 so direct x should not be an issue.

     

    But if you are trying to get one running for yourself locally Google kill zone kids sand box dedicated server.


  12. It says undefined variable line 88

     

    I opened the script with notepadd++ found line 88

     

    copy and pasted the area that they referenced within the script.

     

    I believe this was the exact area but I am going bt memory and it was tol long to write down

     

    if (name hcam_target != _old) then {
                _neck attachTo

     

     

     

     

    This is the paragraph or area of the script.

     

         if (name hcam_target != _old) then {
                _neck attachTo [hcam_target,[0,0,0],"neck"];
                _pilot attachTo [hcam_target,[0,0,0],"pilot"];
                _old = name hcam_target;
                hcam_cam cameraEffect ["INTERNAL", "BACK","rendertarget0"];
                HCAM_CTRL_TITLE ctrlsettext (name hcam_target);
            };

     

     

     

    Also I read somewhere by the KK guy Killzone Kid I think his name is to try and turn on scripting errors that the error messages are then more descriptive and better.

    Do you know how I can do this?

     

    Thanks so much for your help...   :=)


  13. Guys thanks so much for this it works great except I am getting a Undefined Variable in this part of the script.

     

            if (name hcam_target != _old) then {
                _neck attachTo [hcam_target,[0,0,0],"neck"];
                _pilot attachTo [hcam_target,[0,0,0],"pilot"];
                _old = name hcam_target;
                hcam_cam cameraEffect ["INTERNAL", "BACK","rendertarget0"];
                HCAM_CTRL_TITLE ctrlsettext (name hcam_target);
            };

     

     

    I hope we can fix it I would really love to implement this in my missions..

×