Jump to content

ozdeadmeat

Member
  • Content Count

    118
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by ozdeadmeat


  1. OK, to make the condtions a little neater I have created a small function.

     

    CHECK_PATH = {
    //Returns true of false based on a texture path
    private ["_obj", "_n", "_TMP", "_fileroot", "_checkpath", "_fullpath", "_return"];
    _obj = _this select 0;            //Object (the one with the texture being checked
    _n = _this select 1;            //Number
    _TMP = toLower(_this select 2); //Texture Mission Path
    _fileroot = tolower(parsingNamespace getVariable "MISSION_ROOT");
    _checkpath = _fileroot + _TMP;
    _fullpath = toLower(getObjectTextures _obj select _n);
    _return = if(_fullpath == _checkpath) then {true} else {false};
    _return
    };

    with the new condition as 

     

    '((_this distance2d cursortarget < 3) && ([_target,0,"CustomTextures\Tutorials\UPGRADE_CRATE_INFO.paa"] call CHECK_PATH))',// Condition for the action to be shown	

    This still requires this line in the description.ext

    __EXEC (MISSION_ROOT = __FILE__ select [0, count __FILE__ - 15])

     

    • Like 1

  2. OK, I solved my own issue. Took a bit of screwing around but got it to work. 

     

    For prosperity here is how you do it.

     

    Firstly put this line into your description.ext

     

    __EXEC (MISSION_ROOT = __FILE__ select [0, count __FILE__ - 15])

     

    the contition for the action is 

     

    '((_this distance2d cursortarget < 3) && (getObjectTextures _target select 0 == ((parsingNamespace getVariable "MISSION_ROOT") + "CustomTextures\Tutorials\UPGRADE_CRATE_INFO.paa")))'

     

    so when the object has the upgrade crate texture on it, and I am within 3 meters of the action object and looking at it, i get the action to show up.

     

    Hope this helps someone. (perhaps myself years from now, who knows)

     

     

     

     


  3. Hi Everyone,

     

    I have this little scenario / game mode I am working on and am trying to work out a nice way of having an objects texture of the object that the action is added to be equal to a specific texture for the action to show up. 

     

    I am using the holdaction function as anything to get us away from the god awful old action system is a good thing. The boolean I have currently is 

     

    ((_this distance2d cursortarget < 3) && (getObjectTextures _target select 0 == "CustomTextures\Tutorials\UPGRADE_CRATE_INFO.paa"))

     

    now as far as I can see, the issue is that the text that is being returned is the full path to the texture and not just the last 'mission specific' section of the script. (i.e. c:\users etc etc)

     

    Any help on this would be appriciated.

     

    Cheers,

     

    OzDM


  4. Seriously old thread but what I have used with a level of success. (i.e. the aspect ratio looks right)

     

    2:1 is something like 1024 x 512

    1:1 is 512 x 512

    1:2 is 512 x 1024

     

    Land_TripodScreen_01_large_F == 2:1 (1024x512)

     

    Land_TripodScreen_01_dual_v2_F == the texture is 1:1 but for horizontal textures the bottom and top 221 pixels arent visible

    for the vertical mounted monitor i have found the left 218 pixels arent visible nor are the right 206 pixels.

     

    Hope this has been helpful

    • Thanks 1

  5. I tried to add a comment to a part of the commands page today and had this message returned to me. I don't know who this "Pawan kashyap" person is but he doesn't live here and I need more information as to why I am being blocked.

     

    You do not have permission to edit this page, for the following reason:

    Your IP address has been automatically blocked because it was used by another user, who was blocked by Dwarden. The reason given is:

    Autoblocked because your IP address has been recently used by "Pawan kashyap".

    The reason given for Pawan kashyap's block is "SPAMMERs/SPAMBOTs in general"

    Start of block: 03:02, 3 January 2018

    Expiration of block: 03:02, 4 January 2018

    Intended blockee: 10.100.24.4

    You may contact Dwarden or one of the other administrators to discuss the block.

    Note that you may not use the "email this user" feature unless you have a valid email address registered in your user preferences and you have not been blocked from using it.

    Your current IP address is 10.100.24.4, and the block ID is #543. Please include all above details in any queries you make.


  6. I am suffering from the dumb this morning.

     

    I want to find the index of an array of objects

     

    OBJECT_ARRAY = [Vehicle1, Vehicle2, Vehicle3] ;

    OBJECT_NAME = ["Chocolate", "Vanilla", "Chai freaking Latte"];

     

    E.G. I have multiple arrays that are consistently indexed. So if I find Vehicle3 as index 2 I should be able to get the name by using OBJECT_NAME select _index.

     

    I am not sure I am explaining this 100% well it is 3:30am and I have been banging my head against the wall for too long on this.

     

    Any help is appreciated.


  7. 10 hours ago, code34 said:

    GG ! But I do not understand the interest of this type of script that has been already developed thousand of times in dynamic missions. There is probably something that will make the difference, but which one?

     

    I couldn't find a script that inherited the vehicle loadout defined in 3den post respawn. This function has  1 job and that is it. I was more after a simple way to utilize the function rather than features that I wasn't interested in. It's good to chat to you again mate. We should have a few games of Arma 3 over the break if you are free.


  8. 13 hours ago, pierremgi said:

     

    Ahh cool, I see a lot of these kinds of scripts that read more like hieroglyphics than code (that's just me, definitely not a coder here). No comments that explain what each bit does, looks very efficient but I just don't have the skills to write or understand that kind of stuff. My script is more aimed for people who don't want to pass multiple parameters to a script and don't have a coding background.

     

    Thanks for your comment though :)


  9. Hi everyone,

     

    I have written a function that will allow people to configure an aircraft in the 3den editor and have it able to respawn with that exact loadout. I found that I was having very inconsistent results when the respawn module was set to delete or delete with explosion. It has been rock solid since setting the module to preserve. The function deletes the old vehicle once it has all the old data anyway. 

     

    Instructions

     

    You will need two things for this function to work:

     

    1. You will need to create an init.sqf file in your mission folder and paste the code below into it.
    2. You will need a respawn module in your mission with the customized vehicles synced to it. Put this code into the Expression  section::  [_this, 2] call RESPAWN_VEHICLE;
      1. Note: The number allows you to customize what happens with the cargo of the respawning vehicles (guns, medickits etc etc). It is all listed in the function below

     

    Optional

    If you want to be able to edit and move the vehicles as Zeus, you will need to add an "Add Editable Objects" module to your mission and name it ZEUS_EDITABLE and put the variable name of your zeus player unit in the owner section. In the script do a search for "ZEUS_EDITABLE" and uncomment it.

     

    Spoiler

    RESPAWN_VEHICLE = {
    /*
    Function by OzDeaDMeaT
    Date:         22/11/2017
    Usage:        [_this, <Keep Vehicle Cargo>] call RESPAWN_VEHICLE;     //This is to be placed in a Vehicle Respawn Module
    <Keep Vehicle Cargo> Options:
        0    =    Do Nothing with Cargo
        1    =    ClearCargo
        2    =    Load Dead Vehicles Cargo Back into New Vehicle
    Example1:    [_this, 2] call RESPAWN_VEHICLE;                    //This Example will retain the old vehicles cargo and place it in the newly respawned vehicle
    */
    private ["_veh", 
            "_OLDveh",
            "_KeepCargo",
            "_txtr",
            "_LoadStuff",
            "_CargoMAGS",
            "_CargoWEAP",
            "_CargoITEM",
            "_CargoBKP",
            "_syncedObjects",
            "_lockedArray",
            "_lockVeh",
            "_CurrentpylonMAGs",
            "_pylonPaths",
            "_i",
            "_j",
            "_k",
            "_nonPylonWeapons"
            
            ];
    _veh = (_this select 0) select 0;
    _OLDveh = (_this select 0) select 1;
    _KeepCargo = _this select 1;
    _CurrentpylonMAGs = getPylonMagazines _OLDveh;        //Get old vehicle pylon mags
    _syncedObjects = synchronizedObjects _OLDveh;        //Get the old vehicles synced objects 
    _txtr = getObjectTextures _OLDveh;                    //Get old vehicle textures
    _OLDveh setpos [0,0,-9999];

    ///START SYNCED OBJECTS
    //ZEUS_EDITABLE synchronizeObjectsAdd [_veh];
    //{_x  synchronizeObjectsAdd [_veh]} foreach _syncedObjects;
    //_veh synchronizeObjectsAdd _syncedObjects;        //This syncs the old objects to the new vehicle
    ///END SYNCED OBJECTS

    ///START VEHICLE LOCK
    _lockedArray = ["UNLOCKED","DEFAULT","LOCKED","LOCKEDPLAYER"];    //This is needed to reset the vehicle lock
    _lockVeh = locked _OLDveh;
    _veh setVehicleLock (_lockedArray select _lockVeh);
    ///END VEHICLE LOCK

    ///START BLACK MAGIC FOR VEHICLE PYLONS
    _pylonPaths = (configProperties [configFile >> "CfgVehicles" >> typeOf _veh >> "Components" >> "TransportPylonsComponent" >> "Pylons", "isClass _x"]) apply {getArray (_x >> "turret")};  //Gets pylon paths from Config
    _nonPylonWeapons = []; 
    {_nonPylonWeapons append getArray (_x >> "weapons")} forEach ([_veh, configNull] call BIS_fnc_getTurrets);
    {_veh removeWeaponGlobal _x } forEach ((weapons _veh) - _nonPylonWeapons);

    if (count _pylonPaths != 0) then {
        for "_j" from 0 to ((count _pylonPaths) -1) do {
            _veh setPylonLoadOut [_j + 1, _CurrentpylonMAGs select _j, false, _pylonPaths select _j];
            };
        };
    ///END BLACK MAGIC FOR VEHICLE PYLONS

    ///START VEHICLE TYPE SPECIFIC TWEAKS
    if(typeOf _veh == "B_Plane_Fighter_01_F") then    {[_veh,"",["wing_fold_l",1]] call BIS_fnc_initVehicle}; //THIS WILL START THE JETS OFF WITH FOLDED WINGS
    if(typeOf _veh == "B_Plane_Fighter_01_Stealth_F") then    {[_veh,"",["wing_fold_l",1]] call BIS_fnc_initVehicle}; //THIS WILL START THE JETS OFF WITH FOLDED WINGS
    ///END VEHICLE TYPE SPECIFIC TWEAKS

    ///START SET VEHICLE TEXTURE
    if !(isNil "_txtr") then {
        for "_k" from 0 to (count _txtr - 1) do {
            _veh setObjectTextureGlobal [_k, _txtr select _k];
            };
        };
    ///END SET VEHICLE TEXTURE

    ///START VEHICLE CARGO
    _LoadStuff = {
        private["_crate","_array","_count","_i","_Job", "_arr1", "_arr2"];
        //Usage [<object>, <Job>, <array>] call _LoadStuff
        _crate     = _this select 0; //Object ClassNames are being loaded into
        _Job     = _this select 1; //Options are "AMMO" , "WEAP" , "ITEM" , "BKP"
        _arr1     = (_this select 2) select 0; //ClassName
        _arr2     = (_this select 2) select 1; //Amount
        _count = count _arr1;
    if(_Job == "AMMO") then {
        for "_i" from 0 to (_count - 1) do {
            _crate addMagazineCargoGlobal [(_arr1 select _i),(_arr2 select _i)];};};    
    if(_Job == "WEAP") then {
        for "_i" from 0 to (_count - 1) do {
            _crate addWeaponCargoGlobal [(_arr1 select _i),(_arr2 select _i)];};};        
    if(_Job == "ITEM") then {
        for "_i" from 0 to (_count - 1) do {
            _crate addItemCargoGlobal [(_arr1 select _i),(_arr2 select _i)];};};            
    if(_Job == "BKP") then {
        for "_i" from 0 to (_count - 1) do {
            _crate addBackpackCargoGlobal [(_arr1 select _i),(_arr2 select _i)];};};            
        };
    If (_KeepCargo != 0) then {
        clearMagazineCargoGlobal _veh;            
        clearWeaponCargoGlobal _veh;            
        clearItemCargoGlobal _veh;
        If (_KeepCargo == 2) then {
            _CargoMAGS     = getMagazineCargo _OLDveh;
            [_veh,"AMMO",_CargoMAGS] call _LoadStuff;
            _CargoWEAP     = getWeaponCargo _OLDveh;
            [_veh,"WEAP",_CargoWEAP] call _LoadStuff;
            _CargoITEM     = getItemCargo _OLDveh;
            [_veh,"ITEM",_CargoITEM] call _LoadStuff;
            _CargoBKP     = getBackpackCargo _OLDveh;
            [_veh,"BKP",_CargoBKP] call _LoadStuff;
            };
        };
    ///END VEHICLE CARGO
    deleteVehicle _OLDveh;
    };

     

    Things I am trying to work out currently:

    - Why the sync commands don't work at all. My goal was the have it pick up all the objects the old vehicle was synced too. Alas I haven't worked that out yet. 

    - Work out if its possible to get all the customizations like missing doors on vehicles from the old vehicle and pass them onto the new one.

     

    I have tested this in Multiplayer and it does work. 

     

    DEMO MISSION AVAILABLE HERE

    • Thanks 1

  10. Yeah I can't do UI's in Arma 3. I have tried and there just doesn't seem to be an easy way to do it. I can design a UI but I just can't seem to implement them due to the markup language and syntax for it. 

     

    I am running the script on a multiplayer dedicated server when I experience the issue but experience it in sinleplayer also. I also get random errors saying it cant find the params sqf file occasionally.

    I am running 1.8 of Arma 3 (current stable build)


  11. POLPOX, dude that looks freaking awesome. I have a few questions.

    Does it work in Multiplayer?

    Does it work with all Dynamic Loadout Vehicles?

    Does Night Vision work for night missions in that view?

     

    Scope Creep(In order of priority)(must be multiplayer compatible, happy to help with testing and multiplayer code)

    Is there an ability to save loadouts and recall them?

    Can you add a black/white list capability to ban particular ordnance?

    Can there be a vehicle variable that can be set to Ammo Trucks to over time drain the vehicle of Ammo, something that could be switched between cargoAmmo and a separate vehicle variable depending on the desires of the mission maker? (it would need to return values of weaponry if it is being de-racked)

    Can there be all the cosmetic options similar to Virtual Garage, things like Textures and/or parts for the vehicles? (the MH-6 used to have a bunch of bits like side seats that you could take off)

    Can there be an option to change the aircraft and the Number / numberplate?

     

    I am OzDeaDMeaT on Steam, feel free to add me if you wish to collaborate.


  12. Hey mate. 
    Put this into your vehicle Respawn Module and your Zeus should be able to edit the objects.
    Note ZEUS_EDITABLE is an add editable object to zeus module. 

    _veh = _this select 0; ZEUS_EDITABLE synchronizeObjectsAdd [_veh ]

    To do the delete all objects attached to a respawn module you will need some event handlers put into zeus to detect the type of object you are deleting. You will also need checks weather a player is in the object already and a way of dealing with that.

×