Jump to content
Sign in to follow this  
Cyphas Cayne

Custom Codeing For Data Terminal

Recommended Posts

I have added a custom data terminal to my groups mod pack.
Aside from custom textures and getting it ingame, I am trying to figure out how to add the animation for the terminal and adding an option for a virtual arsenal when open into the config.cpp.

 

Basics:

Terminal opens, allows access to the virtual arsenal.

Terminla close, removes access to virtual arsenal.

 

As for the virtual arsenal, i have found DTA:

At the time of this post, i have been testing with the DTA open/close scripts but DTA also includes code within the initServer.sqf and initPlayerLocal.sqf files .

 

Code needed to animate the data terminal.

// open
[box, 3] call BIS_fnc_DataTerminalAnimate
// close
[box, 0] call BIS_fnc_DataTerminalAnimate

 

full config.cpp

 

 

class CfgPatches
{
    class SPARTAC_items
    {
        units[]=
        {
            "SPARTAC_Flag_A",
            "SPARTAC_Flag_B",
            "SPARAC_Intel_Laptop",
            "SPARTAC_Intel_Screen_A",
            "SPARTAC_Intel_Screen_B",
            "SPARTAC_Intel_Mobile",
            "SPARTAC_DataTerminal"
        };
        weapons[]={};
        requiredVersion=1.5599999;
        requiredAddons[]=
        {
            "spartac_main",
            "A3_Props_F_Exp_A_Military"
        };
        author[]=
        {
            "Spartan Tactical Group"
        };
        authorUrl="http://spartac.net";
    };
};

class CfgFunctions
{
    class A3_Props_F_Exp_A_Military_Equipment
    {
        tag = "BIS";
        class Scripts
        {
            file = "\x\spartac\addons\items\Scripts";
            class DataTerminalAnimate{};
            class DataTerminalColor{};
        };
    };
};

class CfgEditorCategories
{
    class SPARTAC // Category class, you point to it in editorCategory property
    {
        displayName = "Spartac Items"; // Name visible in the list
    };
};
class CfgEditorSubcategories
{
    class Spartac_Items // Category class, you point to it in editorSubcategory property
    {
        displayName = "Things"; // Name visible in the list
    };
};

class CfgVehicles
{
    class FlagPole_F;
    class Land_Laptop_unfolded_F;
    class Land_PCSet_01_screen_F;
    class Land_MobilePhone_smart_F;
    class SPARTAC_Flag_A: FlagPole_F
    {
        scope=2;
        author="Spartan Tactical Group";
        _generalMacro="SPARTAC_Flag_A";
        displayName="Flag (SPARTAC A)";
        editorCategory = "SPARTAC";
        editorSubcategory = "Spartac_Items";        
        class EventHandlers
        {
            init="(_this select 0) setFlagTexture ""\x\spartac\addons\items\data\spartac_flag_a_co.paa""";
        };
    };
    class SPARTAC_Flag_B: FlagPole_F
    {
        scope=2;
        author="Spartan Tactical Group";
        _generalMacro="SPARTAC_Flag_B";
        displayName="Flag (SPARTAC B)";
        editorCategory = "SPARTAC";
        editorSubcategory = "Spartac_Items";
        class EventHandlers
        {
            init="(_this select 0) setFlagTexture ""\x\spartac\addons\items\data\spartac_flag_b_co.paa""";
        };
    };
    class SPARTAC_Intel_Laptop: Land_Laptop_unfolded_F
    {
        scope=2;
        author="Spartan Tactical Group";
        _generalMacro="SPARTAC_Intel_Laptop";
        displayName="Laptop (SPARTAC; Login Screen)";
        editorCategory = "SPARTAC";
        editorSubcategory = "Spartac_Items";        
        hiddenSelections[]=
        {
            "camo"
        };
        hiddenSelectionsTextures[]=
        {
            "\x\spartac\addons\items\data\spartac_intel_laptop_co.paa"
        };
    };
    class SPARTAC_Intel_Screen_A: Land_PCSet_01_screen_F
    {
        scope=2;
        author="Spartan Tactical Group";
        _generalMacro="SPARTAC_Intel_Screen_A";
        displayName="PC Set (SPARTAC; Login Screen)";
        editorCategory = "SPARTAC";
        editorSubcategory = "Spartac_Items";        
        hiddenSelectionsTextures[]=
        {
            "\x\spartac\addons\items\data\spartac_intel_screen_a_co.paa"
        };
        class EventHandlers
        {
            init="(_this select 0) setFlagTexture ""\x\spartac\addons\items\data\spartac_intel_screen_a_co.paa""";
        };
    };
    class SPARTAC_Intel_Screen_B: Land_PCSet_01_screen_F
    {
        scope=2;
        author="Spartan Tactical Group";
        _generalMacro="SPARTAC_Intel_Screen_B";
        displayName="PC Set (SPARTAC; Empty Screen)";
        editorCategory = "SPARTAC";
        editorSubcategory = "Spartac_Items";        
        hiddenSelectionsTextures[]=
        {
            "\x\spartac\addons\items\data\spartac_intel_screen_b_co.paa"
        };
        class EventHandlers
        {
            init="(_this select 0) setFlagTexture ""\x\spartac\addons\items\data\spartac_intel_screen_b_co.paa""";
        };
    };
    class SPARTAC_Intel_Mobile: Land_MobilePhone_smart_F
    {
        scope=2;
        author="Spartan Tactical Group";
        _generalMacro="SPARTAC_Intel_Mobile";
        displayName="Mobile Phone (SPARTAC)";
        editorCategory = "SPARTAC";
        editorSubcategory = "Spartac_Items";        
        hiddenSelections[]=
        {
            "camo"
        };
        hiddenSelectionsTextures[]=
        {
            "\x\spartac\addons\items\data\spartac_intel_mobile_co.paa"
        };
    };
    class Items_base_F;
    class NonStrategic;
    class Land_DataTerminal_01_F;
    class SPARTAC_DataTerminal: Land_DataTerminal_01_F
    {
        author = "Spartan Tactical Group";
        mapSize = 4.02;
    class UserActions
    {
        class TerminalOpenAction
        {
            displayNameDefault = "Open Data Terminal";
            showWindow = 0;
            hideOnUse = 1;
            displayName="Open Data Terminal";
            position="action";
            radius=2;
            onlyForPlayer = 1;
            condition="(alive this)";
            statement="this execVM ""\x\spartac\addons\items\Scripts\OpenTerminal.sqf""";
        };
        class TerminalCloseAction
        {
            displayNameDefault = "Close Data Terminal";
            showWindow = 0;
            hideOnUse = 1;
            displayName="Close Data Terminal";
            position="action";
            radius=2;
            onlyForPlayer = 1;
            condition="(alive this)";
            statement="this execVM ""\x\spartac\addons\items\Scripts\CloseTerminal.sqf""";
        };        
    };            
        class SimpleObject
        {
            eden = 0;
            animate[] = {{"upload_1_cover_hide_1",931.85},{"upload_2_cover_hide_1",931.85},{"upload_3_cover_hide_1",931.85},{"wifi_1_hide_1",931.85},{"wifi_2_hide_1",931.85},{"wifi_3_hide_1",931.85},{"wifi_4_hide_1",931.85},{"wifi_5_hide_1",931.85},{"vent_1_rot_1",931.85},{"vent_2_rot_1",931.85},{"vent_3_rot_1",931.85},{"vent_4_rot_1",931.85},{"base_stripes_1_1_move_1",0},{"base_stripes_2_1_move_1",0},{"base_stripes_3_1_move_1",0},{"base_stripes_4_1_move_1",0},{"lid_stripes_1_1_move_1",0},{"lid_stripes_2_1_move_1",0},{"lid_stripes_3_1_move_1",0},{"lid_stripes_4_1_move_1",0},{"base_stripes_1_2_move_1",0},{"base_stripes_2_2_move_1",0},{"base_stripes_3_2_move_1",0},{"base_stripes_4_2_move_1",0},{"lid_stripes_1_2_move_1",0},{"lid_stripes_2_2_move_1",0},{"lid_stripes_3_2_move_1",0},{"lid_stripes_4_2_move_1",0},{"base_stripes_1_2_move_2",0},{"base_stripes_2_2_move_2",0},{"base_stripes_3_2_move_2",0},{"base_stripes_4_2_move_2",0},{"lid_stripes_1_2_move_2",0},{"lid_stripes_2_2_move_2",0},{"lid_stripes_3_2_move_2",0},{"lid_stripes_4_2_move_2",0},{"base_stripes_1_3_move_1",0},{"base_stripes_2_3_move_1",0},{"base_stripes_3_3_move_1",0},{"base_stripes_4_3_move_1",0},{"lid_stripes_1_3_move_1",0},{"lid_stripes_2_3_move_1",0},{"lid_stripes_3_3_move_1",0},{"lid_stripes_4_3_move_1",0},{"lock_1_rot_1",0},{"lock_2_rot_1",0},{"lid_rot_1",0},{"lid_pistons_rot_1",0},{"base_pistons_rot_1",0},{"button_7_rot_1",0},{"switch_2_rot_1",0},{"switch_5_rot_1",0},{"switch_6_rot_1",0},{"dish_1_01_rot_1",0},{"dish_1_02_rot_1",0},{"dish_1_03_rot_1",0},{"dish_1_04_rot_1",0},{"dish_1_05_rot_1",0},{"dish_1_06_rot_1",0},{"dish_1_07_rot_1",0},{"dish_1_08_rot_1",0},{"dish_1_09_rot_1",0},{"dish_1_10_rot_1",0},{"dish_1_11_rot_1",0},{"dish_1_12_rot_1",0},{"dish_1_13_rot_1",0},{"dish_1_14_rot_1",0},{"dish_1_15_rot_1",0},{"dish_1_16_rot_1",0},{"dish_1_17_rot_1",0},{"dish_1_18_rot_1",0},{"dish_1_19_rot_1",0},{"dish_1_20_rot_1",0},{"antenna_piston_1_move_1",0},{"antenna_piston_2_move_1",0},{"antenna_piston_3_move_1",0},{"antenna_base_rot_1",0},{"antenna_center_rot_1",0},{"dish_2_01_rot_1",0},{"dish_2_02_rot_1",0},{"dish_2_03_rot_1",0},{"dish_2_04_rot_1",0},{"dish_2_05_rot_1",0},{"dish_2_06_rot_1",0},{"dish_2_07_rot_1",0},{"dish_2_08_rot_1",0},{"dish_2_09_rot_1",0},{"dish_2_10_rot_1",0},{"dish_2_11_rot_1",0},{"dish_2_12_rot_1",0},{"dish_2_13_rot_1",0},{"dish_2_14_rot_1",0},{"dish_2_15_rot_1",0},{"dish_2_16_rot_1",0},{"dish_2_17_rot_1",0},{"dish_2_18_rot_1",0},{"dish_2_19_rot_1",0},{"dish_2_20_rot_1",0},{"screen_1_text_01_fakeunhide_1",0},{"cpu_cover_fakehide_1",0},{"ram_cover_fakehide_1",0},{"cpu_1_rot_1",0},{"cpu_2_rot_1",0},{"ram_1_rot_1",0},{"ram_2_rot_1",0},{"screen_1_text_02_fakeunhide_1",0},{"screen_1_text_03_fakeunhide_1",0},{"screen_1_text_04_fakeunhide_1",0},{"screen_1_text_05_fakeunhide_1",0},{"screen_1_text_06_fakeunhide_1",0},{"screen_1_text_07_fakeunhide_1",0},{"screen_1_text_08_fakeunhide_1",0},{"screen_1_text_09_fakeunhide_1",0},{"screen_1_text_10_fakeunhide_1",0},{"screen_1_text_11_fakeunhide_1",0},{"screen_1_text_12_fakeunhide_1",0},{"screen_1_text_13_fakeunhide_1",0},{"screen_1_text_14_fakeunhide_1",0},{"screen_1_text_15_fakeunhide_1",0},{"screen_1_text_16_fakeunhide_1",0},{"screen_1_text_17_fakeunhide_1",0},{"screen_1_text_18_fakeunhide_1",0},{"screen_1_text_19_fakeunhide_1",0},{"screen_1_text_20_fakeunhide_1",0},{"screen_1_text_21_fakeunhide_1",0},{"screen_1_text_22_fakeunhide_1",0},{"screen_1_text_23_fakeunhide_1",0},{"screen_1_text_24_fakeunhide_1",0},{"screen_1_text_25_fakeunhide_1",0},{"screen_1_text_26_fakeunhide_1",0},{"screen_1_text_27_fakeunhide_1",0},{"screen_1_logo_fakeunhide_1",0},{"screen_2_text_01_fakeunhide_1",0},{"screen_2_text_02_fakeunhide_1",0},{"screen_2_text_03_fakeunhide_1",0},{"screen_2_text_04_fakeunhide_1",0},{"screen_2_text_05_fakeunhide_1",0},{"screen_2_text_06_fakeunhide_1",0},{"screen_2_text_07_fakeunhide_1",0},{"screen_2_text_08_fakeunhide_1",0},{"screen_2_text_09_fakeunhide_1",0},{"screen_2_text_10_fakeunhide_1",0},{"screen_2_text_11_fakeunhide_1",0},{"screen_2_text_12_fakeunhide_1",0},{"screen_2_text_13_fakeunhide_1",0},{"screen_2_text_14_fakeunhide_1",0},{"screen_2_text_15_fakeunhide_1",0},{"upload_fakeunhide_1",0},{"wifi_cover_fakehide_1",0}};
            hide[] = {};
            verticalOffset = 0.009;
            verticalOffsetWorld = 0;
        };
        editorPreview = "\A3\EditorPreviews_F\Data\CfgVehicles\Land_DataTerminal_01_F.jpg";
        _generalMacro = "SPARTAC_DataTerminal";
        scope = 2;
        scopeCurator = 2;
        displayName = "Data Terminal";
        editorCategory = "SPARTAC";
        editorSubcategory = "Spartac_Items";        
        hiddenSelections[] = {"Camo_1","Camo_2","Camo_3","Camo_4","Camo_5"};
        hiddenSelectionsTextures[] = {"#(argb,8,8,3)color(0,0,0,0.0,co)","#(argb,8,8,3)color(0,0,0,0.0,co)","#(argb,8,8,3)color(0,1,1,1.0,co)","#(argb,8,8,3)color(0.75,0.5,0,1.0,co)","#(argb,8,8,3)color(0.25,0.75,0.25,1.0,co)"};
        hiddenSelectionsMaterials[] = {"\A3\Data_F\Lights\Lamp_lcd.rvmat","\A3\Data_F\Lights\Lamp_lcd.rvmat","\A3\Props_F_Exp_A\Military\Equipment\Data\DataTerminal_blue.rvmat","\A3\Props_F_Exp_A\Military\Equipment\Data\DataTerminal_orange.rvmat","\A3\Props_F_Exp_A\Military\Equipment\Data\DataTerminal_green.rvmat"};
        class AnimationSources
        {
            class Sesame_source
            {
                source = "user";
                initPhase = 0;
                animPeriod = 1;
            };
            class Lock_source: Sesame_source
            {
                sound = "TerminalLockSound";
                soundPosition = "Lock_1_axis";
            };
            class Antenna_source: Sesame_source
            {
                sound = "TerminalAntennaSound";
                soundPosition = "Antenna_piston_2_axis";
            };
        };
    };    
};

 

Share this post


Link to post
Share on other sites

so far i have tried:

 


        class TerminalOpenAction
        {
            displayNameDefault = "Open Data Terminal";
            showWindow = 0;
            hideOnUse = 1;
            displayName="Open Data Terminal";
            position="action";
            radius=2;
            onlyForPlayer = 1;
            condition="(alive this)";
            statement="this addAction ""["Open Data Terminal", {[this, 3] call BIS_fnc_DataTerminalAnimate}]; this addAction ["Open Virtual Arsenal", {["Open",true] spawn BIS_fnc_arsenal}]""";

Share this post


Link to post
Share on other sites

In useractions of your config you don't need to put "this addaction" in the statement. That's only for missions I think. 

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×