Jump to content

ozdeadmeat

Member
  • Content Count

    118
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by ozdeadmeat


  1. Here is a working version of the same code for Arma 3

    This will return an array of HitPart items on a specific vehicle.

    Here are 2 functions I wrote that appear to work. (shocking I know), Majority of smart stuff copied from F2K Sel.

    GetPartDmg = {
    private ["_objtype","_array","_hitC","_cfg","_PartN","_HitP"];
    //To use: Vehicle call GetPartDmg; >> OutPut Array Similar to [["fuel_hit",0.5],["hull_hit",0.5],["engine_hit",0.5] etc etc]
       _objtype = typeOf _this; 
        _array = []; 
       _hitC = (count ((configFile >> "CfgVehicles" >> _objtype >> "HitPoints") call Bis_fnc_getCfgSubClasses)) - 1; 
       for "_i" from 0 to _hitC do { 
           _cfg = (configFile >> "CfgVehicles" >> _objtype >> "HitPoints") select _i; 
           _PartN = getText(_cfg >> "name");
    _HitP = _this getHit _PartN;
    _array set [_i,[_PartN,_HitP]];
       }; 
    _array
    };

    SetPartDmg = {
    private ["_obj","_array","_count","_cfg","_PartN","_HitP"];
    ////To use: [Vehicle,GETPartDmgArray] call SetPartDmg; This will set all the damage back to the way it was.
        _obj = _this select 0;
     _array = _this select 1;
     _count = (count _this) - 1;
     for "_i" from 0 to _count do { 
           _hitP = _array select _i;
    _obj sethit _hitP;
           }; 
    };

    [/code]

    GetPartDmg returns an array of arrays for every hitpart on that particular vehicle.

    SetPartDmg uses the output of GetPartDmg and puts all the dmg back.

    Tested and working locally with Arma 3

    NOTE: Does not work in Multiplayer. Will be changing the code to see if I can get it working.


  2. God damn it. It says it was missing the userconfig stuff. Have re installed mod on server. Trying again.

    ---------- Post added at 22:07 ---------- Previous post was at 22:03 ----------

    God damn it. That was it. Cheers, sorry for the stupidity on my part.


  3. 0.9.5 - Still have problems with proxy chat. Radio chat sounds awesome but immersion is lost if the players can just talk as normal in TS.

    Server TFR Version 0.9.5

    1.32 Dedicated Server

    2x 1.32 Clients

    2x TS Version is 3.0.16

    2x TFR Version 0.9.5

    Proxy chat does not appear to be localized to the proximity of the players talking.


  4. this mod DESPERATELY needs a demo or tutorial mission to accompany it.

    After adding radios to a truck for people to pickup, once you pick one up it just duplicates it in your inventory until you have no space left. I have no idea why its doing it. Any advice or perhaps an updated FAQ or something to help mission makers actually utilize this great looking mod would be brilliant.

    Unfortunately I am going to have to drop it until some kind demo or tutorial mission is available, just so I can get the configuration correct.

    P.S. the long range NATO radio doesn't appear to have the correct Class name from your documentation.


  5. Hi Everyone,

    I have been working on a way to add partial magazines into a turret with little to no success. I can get it working on the main guns (turret [0]) but commander turrets etc I am having no joy.

    I am utilizing a function to return all the turrets on a vehicle and am then returning the magazines for the specific turrets. I am unable to assign rounds into specific magazines. (similar to <unit> addmagazine [<ammotype>, <rounds>];)

    Does anyone know of a way to do this?

    I currently have a feedback HERE

    _tank = _this select 0;
    /*
    INPUT:
     vehicle : OBJECT
    
    OUTPUT:
     paths_array : ARRAY
    
    EXAMPLE:
     _allPaths = MyTank call fnc_GetAllTurretPaths;
    // _allPaths: [[0], [0,0], [0,1]]
    */
    
    fnc_GetAllTurretPaths = {
    private
    [
       "_result",
       "_vehicle",
       "_currentNode",
       "_depth",
       "_currentConfig",
       "_cfgTurrets"
    ];
    
    _result = [];
    
    if ((!isNil "_this") && {(typeName _this) in ["ARRAY", "OBJECT"]}) then
    {
       _vehicle = objNull;
       _currentNode = [];
       _depth = -1;
       _currentConfig = objNull;
    
       switch (typeName _this) do
       {
           case "ARRAY":
           {
               if ((count _this) == 5) then
               {
                   _vehicle = _this select 0;
                   _currentConfig = _this select 1;
                   _currentNode = _this select 2;
                   _depth = _this select 3;
                   _result = _this select 4;
               };
           };
           case "OBJECT":
           {
               _vehicle = _this;
               _currentConfig = configFile >> "CfgVehicles" >> (typeOf _vehicle);
               _depth = 0;
           };
       };
    
       if ((!isNil "_vehicle") && (!isNil "_currentNode") && (!isNil "_depth") && (!isNil "_result") && (!isNil "_currentConfig") && {((typeName _vehicle) == "OBJECT") && ((typeName _currentNode) == "ARRAY") && ((typeName _depth) == "SCALAR") && ((typeName _result) == "ARRAY") && ((typeName _currentConfig) == "CONFIG")} && {!isNull _vehicle}) then
       {
           _cfgTurrets = _currentConfig >> "Turrets";
    
           if (isClass _cfgTurrets) then
           {
               for "_i" from 0 to ((count _cfgTurrets) - 1) step 1 do
               {
                   _currentNode set [_depth, _i];
                   _result set [count _result, +_currentNode];
                   [_vehicle, _cfgTurrets select _i, _currentNode, _depth + 1, _result] call fnc_GetAllTurretPaths;
               };
           };
       };
    };
    _result;
    };
    
    OzDM_fnc_ClearVehicleTurretMags = {
    private["_turrets","_i","_turret","_mags4turret","_mag"];
    _turrets = _this call fnc_GetAllTurretPaths;
    for "_i" from 0 to ((count _turrets) - 1) do {
    _turret = _turrets select _i;
    _mags4turret = _this magazinesTurret _turret;
    	for "_i" from 0 to ((count _mags4turret) - 1) do {
    	_mag = (_mags4turret select _i);
    	_this removeMagazinesTurret [_mag,_turret];
    	};
    };
    };
    
    OzDM_fnc_GetVehicleTurretMags = {
    private["_turrets","_i","_turret","_mags4turret","_mag"];
    _turrets = _this call fnc_GetAllTurretPaths;
    _output = [];
    for "_i" from 0 to ((count _turrets) - 1) do {
    _turret = _turrets select _i;
    _mags4turret = _this magazinesTurret _turret;
    _output = _output + [[_turret, _mags4turret]];
    };
    _output
    };
    

    Any Help would be appreciated.


  6. @MikeMuir

    Your sample mission doesn't work.

    Undefined Variable ssdebug.

    saveloop.sqf line 1.

    Undefined Variable statsLoaded

    saveloop.sqf, line 1

    undefined Variable statsLoaded.

    LoadStats.sqf, line 55

    undefined variable playerisalive

    LoadStats.sqf, line 55

    I am executing your mission without modification on a 1.08 Dedicated Server.

    Any help would be appriciated.


  7. Hi Jman,

    I have been getting some help from Firefly2442 with regards some issues ive been having getting Arma2Net and the MySQL Plugin working on my dedicated server. I am no longer getting errors with the Arma2Net stuff but I am still unable to get the PersistentDB demo mission working. I am a novice when it comes to Database stuff but I have got a couple of years experience in the scripting of Arma. The mission loads, once it gets to the connecting to DB screen I hear a 'hint' sound and it just sits there dumb and happy. I see it attempting to write to the database but ive checked and nothing is being written. I can jump onto TS and make myself available to get some help with this, I just really want to get it going.

    Essentially I am trying to get this working to get an understanding on just what is possible with this add-on. I have not found any Tutorials on how to get this working. If I can work out exactly what I need to do to get it working I am more than happy to write the tutorial up.(with Pictures or a Video)

    Unfortunately I have been trying for several weeks with no joy. I do have some log info here if you would like to look them over.

    I am not sure where the problem lies, I think the database has been built, I am seeing tables after executing the .sql script.

    Any help getting this operational would be HUGELY appreciated.

    Things I would like help with.

    1. How can I verify my database is allowing connections with the connection string I am using.

    2. If that can be verified then it must be my config. I am only running the addon's you require for this to work. Namely, CBA and Arma2Net on the server.

    3. Is there a less complex mission that can actually output some debug information that is readable ingame.

    Regards,

    OzDM

×