SLB2k11

help Addaction to Buildingparts

5 posts in this topic

Hiho

i tried to get an addaction to the new buildingparts on that i work.

i tried to override the CfgInteractionMenus in the missionfile config.cpp

Original Code:

class ExileAbstractAction {
    title = "";
    condition = "true";
    action = "";
    priority = 1.5;
    showWindow = "false";
};

class CfgInteractionMenus {
    class Car {
        targetType = 2;
        target = "Car";
        
        class Actions {
            class Lock : ExileAbstractAction {
                title = "Lock";
                condition = "((locked ExileClientInteractionObject) isEqualTo 0) && ((locked ExileClientInteractionObject) != 1)";
                action = "true spawn ExileClient_object_lock_toggle";
            };
            
            class Unlock : ExileAbstractAction {
                title = "Unlock";
                condition = "((locked ExileClientInteractionObject) isEqualTo 2) && ((locked ExileClientInteractionObject) != 1)";
                action = "false spawn ExileClient_object_lock_toggle";
            };
            
            class Repair : ExileAbstractAction {
                title = "Repair";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_Repair";
            };
            
            class Flip : ExileAbstractAction {
                title = "Flip";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call Exileclient_object_vehicle_flip";
            };
            
            class Refuel : ExileAbstractAction {
                title = "Refuel";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_refuel";
            };
            
            class DrainFuel : ExileAbstractAction {
                title = "Drain Fuel";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_drain";
            };
        };
    };
    
    class Air {
        target = "Air";
        targetType = 2;
        
        class Actions {
            class Lock : ExileAbstractAction {
                title = "Lock";
                condition = "((locked ExileClientInteractionObject) isEqualTo 0) && ((locked ExileClientInteractionObject) != 1)";
                action = "true spawn ExileClient_object_lock_toggle";
            };
            
            class Unlock : ExileAbstractAction {
                title = "Unlock";
                condition = "((locked ExileClientInteractionObject) isEqualTo 2) && ((locked ExileClientInteractionObject) != 1)";
                action = "false spawn ExileClient_object_lock_toggle";
            };
            
            class Repair : ExileAbstractAction {
                title = "Repair";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_Repair";
            };
            
            class Flip : ExileAbstractAction {
                title = "Flip";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call Exileclient_object_vehicle_flip";
            };
            
            class Refuel : ExileAbstractAction {
                title = "Refuel";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_refuel";
            };
            
            class DrainFuel : ExileAbstractAction {
                title = "Drain Fuel";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_drain";
            };
            
            class RotateLeft : ExileAbstractAction {
                title = "Rotate Left";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "[ExileClientInteractionObject,-15] call ExileClient_object_vehicle_rotate";
            };
            
            class RotateRight : ExileAbstractAction {
                title = "Rotate Right";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "[ExileClientInteractionObject,15] call ExileClient_object_vehicle_rotate";
            };
        };
    };
    
    class Safe {
        targetType = 2;
        target = "Exile_Container_safe";
        
        class Actions {
            class Lock : ExileAbstractAction {
                title = "Lock";
                condition = "((ExileClientInteractionObject getvariable ['ExileIsLocked',1]) isEqualTo 0)";
                action = "true spawn ExileClient_object_lock_toggle";
            };
            
            class Unlock : ExileAbstractAction {
                title = "Unlock";
                condition = "((ExileClientInteractionObject getvariable ['ExileIsLocked',1]) isEqualTo -1)";
                action = "false spawn ExileClient_object_lock_toggle";
            };
            
            class Pack : ExileAbstractAction {
                title = "Pack";
                condition = "((ExileClientInteractionObject getvariable ['ExileIsLocked',1]) isEqualTo 0)";
                action = "_this spawn ExileClient_object_container_pack";
            };
            
            class SetPinCode : ExileAbstractAction {
                title = "Set PIN";
                condition = "((ExileClientInteractionObject getvariable ['ExileIsLocked',1]) isEqualTo 0)";
                action = "_this spawn ExileClient_Object_lock_SetPin";
            };
        };
    };
    
    class Tent {
        targetType = 2;
        target = "Exile_Container_CamoTent";
        
        class Actions {
            class Pack {
                title = "Pack";
                condition = "true";
                action = "_this spawn ExileClient_object_container_pack";
            };
        };
    };
    
    class Construction {
        targetType = 2;
        target = "Exile_Construction_Abstract_Static";
        
        class Actions {
            class Unlock : ExileAbstractAction {
                title = "Unlock";
                condition = "((ExileClientInteractionObject getvariable ['ExileIsLocked',1]) isEqualTo -1)";
                action = "false spawn ExileClient_object_lock_toggle";
            };
            
            class Lock : ExileAbstractAction {
                title = "Lock";
                condition = "((ExileClientInteractionObject getvariable ['ExileIsLocked',1]) isEqualTo 0)";
                action = "true spawn ExileClient_object_lock_toggle";
            };
            
            class Move : ExileAbstractAction {
                title = "Move";
                condition = "true";
                action = "_this spawn ExileClient_object_construction_move";
            };
            
            class Deconstruct : ExileAbstractAction {
                title = "Remove";
                condition = "true";
                action = "_this spawn ExileClient_object_construction_deconstruct";
            };
            
            class AddALock : ExileAbstractAction {
                title = "Add a Lock";
                condition = "call ExileClient_object_construction_lockAddShow";
                action = "_this spawn ExileClient_object_construction_lockAdd";
            };
            
            class Upgrade : ExileAbstractAction {
                title = "Upgrade";
                condition = "call ExileClient_object_construction_upgradeShow";
                action = "_this call ExileClient_object_construction_upgrade";
            };
        };
    };
    
    class Flag {
        targetType = 2;
        target = "Exile_Construction_Flag_Static";
        
        class Actions {
            class Upgrade : ExileAbstractAction {
                title = "Upgrade";
                condition = "true";
                action = "_this call ExileClient_gui_upgradeterritoryDialog_request";
            };
        };
    };
    
    class Boat {
        targetType = 2;
        target = "Ship";
        
        class Actions {
            class Lock : ExileAbstractAction {
                title = "Lock";
                condition = "((locked ExileClientInteractionObject) isEqualTo 0) && ((locked ExileClientInteractionObject) != 1)";
                action = "true spawn ExileClient_object_lock_toggle";
            };
            
            class Unlock : ExileAbstractAction {
                title = "Unlock";
                condition = "((locked ExileClientInteractionObject) isEqualTo 2) && ((locked ExileClientInteractionObject) != 1)";
                action = "false spawn ExileClient_object_lock_toggle";
            };
            
            class Repair : ExileAbstractAction {
                title = "Repair";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_Repair";
            };
            
            class Refuel : ExileAbstractAction {
                title = "Refuel";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_refuel";
            };
            
            class DrainFuel : ExileAbstractAction {
                title = "Drain Fuel";
                condition = "call ExileClient_object_vehicle_interaction_show";
                action = "_this call ExileClient_object_vehicle_drain";
            };
            
            class Push : ExileAbstractAction {
                title = "Fus Ro Dah!";
                condition = "((crew ExileClientInteractionObject) isEqualTo [])";
                action = "_this call Exileclient_object_vehicle_push";
            };
        };
    };
    
    class Bikes {
        targetType = 2;
        target = "Exile_Bike_OldBike";
        
        class Actions {
            class Flip : ExileAbstractAction {
                title = "Flip";
                condition = "true";
                action = "_this call Exileclient_object_vehicle_flip";
            };
        };
    };
 

My Edit below:

class newbuilding {
        targetType = 2;
        target = ""; here i tried  Land_WaterCooler_01_new_F , newbuildingpartsvariable   (nothing worked)
        
        class Move : ExileAbstractAction {
                title = "Move";
                condition = "true";
                action = "_this spawn ExileClient_object_construction_move";
            };
        };
    };

};

is it not possible to do this? or is there a mistake form my side?

is there another way to say that the buildingpart get an addaction for moving or removing?

i need this for the extendet Building System

 

Edited by SLB2k11

Share this post


Link to post
Share on other sites

Would something like this work?

        _ct = cursorTarget;
        _object = _ct isKindOf "variabletoobjects";
        _condition = "player distance _target < 5";
        _txt = gettext(configFile >> 'cfgvehicles' >> (typeOf _ct) >> 'displayName');
        
        _object = _ct addAction [format["Move",_txt],"_this spawn ExileClient_object_construction_move"; _condition];
        _object = _ct addAction [format["Remove",_txt],"_this spawn ExileClient_object_construction_deconstruct"; _condition];

Share this post


Link to post
Share on other sites
Advertisement

Question

If i move CfgInteractionMenus class to my mission config.cpp

it is auto override this class ? or i need to setup something more?

Share this post


Link to post
Share on other sites

The tank is no Exile vehicle class so you can't use this without modify every tank to an Exile tank config 

Share this post


Link to post
Share on other sites

So I need to create every single classname tank class???

class CfgInteractionMenus {

    class tank_1 {
        targetType = 2;
        target = "tank_class_namess";

and next one and next one.....

*******  ????????

hmmm... also not working :(

Edited by Screamer

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.