Jump to content

TittErS

Member
  • Content Count

    34
  • Joined

  • Last visited

  • Medals

Posts posted by TittErS


  1. Hi, i ve corrected and optimized your code.

    i hope this will you help for the future.

    proced_gen_building.sqf

    private ["_position","_type","_offsetXY","_offsetZ","_randomizePerim","_randomizeHigh","_doorSide","_doorPosX","_doorHeight","_allSides"];
    
    _position = _this select 0;
    _type = _this select 1;
    
    _offsetXY = 1;
    _offsetZ = 1.3;
    
    _randomizePerim = 10 + round(random 10);
    _randomizeHigh = 5 + round(random 6);
    
    _doorSide = round(random 5) max 1 min 4;
    _doorPosX = round(_randomizePerim/2)-2;
    _doorHeight = 2;
    
    for "_allSides" from 1 to 4 do {
       private ["_dir"];
    
       _dir = switch (_allSides) do {
           case 1: { 0 };
           case 2: { 90 };
           case 3: { 180 };
           case 4: { 270 };
       };
    
       for "_i" from 0 to _randomizePerim-2 do {
           private ["_allObjects","_newObj","_dupliPos"];
    
           _allObjects = [];
    
           _position = [_position,_offsetXY,_dir] call BIS_fnc_relPos;
           _newObj = createVehicle [_type,[0,0,0],[],0,"CAN_COLLIDE"];
           _newObj setPosATL _position;
           _newObj setVectorUp [0,0,1];
           _dupliPos = getPosATL _newObj;
           _allObjects pushBack _newObj;
    
           for "_ii" from 0 to _randomizeHigh-2 do {
               _dupliPos set [2, (_dupliPos select 2) + _offsetZ];
               _newObj = createVehicle [_type,[0,0,0],[],0,"CAN_COLLIDE"];
               _newObj setPosATL _dupliPos;
               _allObjects pushBack _newObj;
           };
    
           if (_allSides == _doorSide && _doorPosX == _i) then {
               for "_i" from 0 to _doorHeight-1 do { deleteVehicle (_allObjects select _i); };
           };
    
       };
    };
    


  2. Functions :

    -addCustomMagazineAmmoCargo
    V1.0

    -addCustomWeaponCargo
    V1.0

    Description :

    This script adds 2 functions for add in a container, magazines preloaded or weapons with items attached and magazine loaded.

    -JIP compatible.

    -Functions can be executed by the server or the player

    USAGE :

    In init.sqf file add:

    // Functions TTS
    call compile preprocessFile "TTS_fnc\fn_addCustomMagazineAmmoCargo.sqf";
    call compile preprocessFile "TTS_fnc\fn_addCustomWeaponCargo.sqf";
    //
    

    addCustomMagazineAmmoCargo
    :

           
           Parameter(s):
               0,1,2,.. : ARRAY        - Array Magazine.
                   0 : STRING            - Magazine Name. CfgMagazines.
                   1 : NUMBER            - Ammo Number. Number of bullets in the magazine.
               ..,(last) : OBJECT       - Destination. Add the magazine to Cargo ...
    
           Usage :
               [ ["MagazineName", AmmoNumber], Destination]
               OR
               [ ["MagazineName", AmmoNumber], ["MagazineName", AmmoNumber], ["MagazineName", AmmoNumber], Destination]
    
           Usage example :
               [ ["30Rnd_65x39_caseless_mag",8], box2] spawn TTS_fnc_addCustomMagazineAmmoCargo;
               [ ["30Rnd_65x39_caseless_mag",8], ["30Rnd_65x39_caseless_mag",8], ["30Rnd_65x39_caseless_mag",15], box1] spawn TTS_fnc_addCustomMagazineAmmoCargo;
    

    addCustomWeaponCargo
    :

           Parameter(s):
           0,1,2,.. : ARRAY        - Array Custom Weapon :
               0 : STRING            - Weapon Name. (CfgWeapons).
               1,2,.. : ARRAY        - Array Magazine. (Array Optional) Add a magazine with number defines bullet to weapon : 
                   0 : STRING             - Magazine name. (cfgMagazines).
                   1 : NUMBER            - Ammo Number. Number of bullets in the magazine
               1,2,.. : STRING        - Item Name. (Optional) Attach Item at weapon.
           ..,(last) : OBJECT       - Destination. Add the custom weapon to ...
    
           Usage : 
               [ ["WeaponName", ["MagazineName",AmmoNumber], "ItemName"], Destination ]
               OR
               [ ["WeaponName", ["MagazineName",AmmoNumber],  ["MagazineName",AmmoNumber], "ItemName", "ItemName", "ItemName"],  Destination ]
               OR
               [ ["WeaponName", "ItemName", "ItemName"], Destination ]
               OR (add 2,3,4,..  weapons)
               [ ["WeaponName", ["MagazineName",AmmoNumber], "ItemName"],  ["WeaponName", ["MagazineName",AmmoNumber], "ItemName"], ["WeaponName",  ["MagazineName",AmmoNumber], "ItemName"], Destination ]
    
           Usage example :
               [ ["arifle_Katiba_GL_F", ["30Rnd_65x39_caseless_green",15],  ["1Rnd_HE_Grenade_shell",1], "muzzle_snds_H", "acc_flashlight",  "optic_Arco"], box2 ] spawn TTS_fnc_addCustomWeaponCargo;
               [ ["hgun_P07_F", ["16Rnd_9x21_Mag",2], "muzzle_snds_L"], box2 ] spawn TTS_fnc_addCustomWeaponCargo;
               [ ["arifle_MX_Black_F", "muzzle_snds_H"], box2 ] spawn TTS_fnc_addCustomWeaponCargo;
    
               [ ["arifle_MX_Black_F", ["30Rnd_65x39_caseless_mag",30],  "muzzle_snds_H"], ["arifle_MX_Black_F",  ["30Rnd_65x39_caseless_mag",15]], box2 ] spawn  TTS_fnc_addCustomWeaponCargo;
    

    Thank you for the future bug reports, and contributions.

    Download :

    (Mission example + script)

    news_download_a3_3.png

    Changelog:

    1.0
    : Realase


  3. Hi,

    Use "isArray" or "isText" for checked if the config entry represents an array or a text.

    
    //_t_trend will always an Array
    
    _t_trend = [];
    if (isArray  (configfile >> "TORT_DYNAMICWEATHER_Settings" >> "trend") ) then
    {
    _t_trend = getArray (configfile >> "TORT_DYNAMICWEATHER_Settings" >> "trend");
    };
    if (isText  (configfile >> "TORT_DYNAMICWEATHER_Settings" >> "trend") ) then
    {
    _t_trend = [getText (configfile >> "TORT_DYNAMICWEATHER_Settings" >> "trend")];
    };
    
    
    
    
    
    


  4. @Jona33 : BIS_fnc_spawnGroup return a Group no an Array. :)

    if (!isServer) exitWith {} ;
    transport1 = [getmarkerpos "mk20", EAST, ["O_Truck_02_transport_F"],[],[],[],[],[],180] call BIS_fnc_spawnGroup;
    wp20 = transport1 addWaypoint [getmarkerpos "wp20", 0];
    wp20 setWaypointType "MOVE";
    wp20 setWaypointSpeed "NORMAL";
    wp20 setWaypointBehaviour "AWARE";
    rifle21 = [getmarkerpos "mk21", EAST, ["O_Soldier_AR_F","O_Soldier_AR_F","O_Soldier_GL_F" ,"O_Soldier_GL_F","O_Soldier_lite_F","O_Soldier_li te_F"],[],[],[],[],[],230] call BIS_fnc_spawnGroup;
    {
    _x moveInCargo vehicle ((units transport1) select 0);
    } foreach units rifle21;

    • Thanks 1

  5. Simply with SIN and COS

    waituntil {player == player};
    _unit = _this select 0; 
    
    
    while {true} do {
    if ((obj distance _unit) < 4) then {
    	obj attachTo [_unit, [0,1.2,0.4]];
    	_unit addAction ["<t color='#FF0000'>PUSH OBJ</t>", 
    	"detach obj,
    	removeAllActions _unit,
    	obj setvelocity [sin (getDir _unit) * 10, cos (getDir _unit) * 10,5]",
    
    	 {}];
    	waituntil {((obj distance _unit) >= 4)};
    };
    sleep 1;
    };
    




  6. Notepad++ Syntax Highlighting & Auto-Completion

    by TittErS

    notepadpp_logo_4.png

    Description :

    Syntax Highlighting & Auto-Completion for Notepad++

    All the functions BIS & Commands for ArmA 3 v1.22.

    Required :

    /!\
    - NotePad++ version <= 6.5.3 (version >= 6.5.4 bug with auto-completion)

    OR for the version 6.6.4, used the patch, revised by me, in the folder PATCH_NPP_664 of Zip.
    (Report BUG & FIX send at Notepad support : Ticket#587 Open)

    Installation && Update:

    • Open Notepad++.

    • Click in the menu on: "Language -> Define your own Language -> Import".

    • Import the file "syntaxhighlighting/SQF.xml".

    • Restart Notepad++.

    • Copy the file "autocompletion/SQF.xml" in the folder where you installed Notepad++ ("C:\Program Files (x86)\Notepad++\plugins\APIs").

    • Restart Notepad++.

    • Open "Settings -> Preferences...".

    • Go to the tab "Auto-Completion".

    • Choose following options:
      • Select "Enable auto-completion on each input"

      • Choose "Function completion" (Or "Function and Word Completion" Only version 6.6.4)

      • (Optional) Set "From 3th character" (or what you prefer)


    • For Patched NPP 6.6.4

    • Close Notepad++ (if open)

    • Download and Install Notepad++ 6.6.4

    • Go to folder PATCH_NPP_664 of Zip

    • Copy "Notepad++.exe"

    • Go in the folder where you installed Notepad++ ("C:\Program Files (x86)\Notepad++\")

    • Rename "Notepad++.exe" by "Notepad++.bak.exe"

    • Paste the Patch

    • Enjoy!

    Changelog:

    V1.1 (06/08/2014)
    • ADD: Commands & Functions A3 v1.22

    • ADD: Patch for NPP 6.6.4

    • CHANGE: HighLighting Syntax style for : catch, exit, throw, try, with

    • FIX: HighLighting commands : diag_XXXX

    V1.0 (04/30/2014)
    • Release

    Download link:

    NotePad++ Arma 3 v1.22 (06/08/2014) :

    Armaholic homepage
    .

    news_download_a3_3.png


  7. plus one

    Also is this script MP-compatible?

    Yes this script is comptible in Multiplayer

    Great script!

    One question and maybe i overlook something (or i don't know yet how to do it);

    Is it possible to get the init also (in)to the respawned choppers?

    which one do you use, bis module or custom respawn script ?

    you have to reexecute the file MH9_AdvancedActions\init.sqf with your respawn script.

×