Jump to content
Sign in to follow this  
tofarley

UserActions class not working for Buildings?

Recommended Posts

Hey all. I am having trouble implementing the UserActions class for any type of Building Object. I have it working just fine for other types of items.

For example, this works just fine if I put the following UserActions class inside in my CfgVehicles class while extending ReammoBox_F:

class ReammoBox_F;

class TransportStation: ReammoBox_F
{
 scope = 2;					
 displayName = "Transport Station";								
 model = "transport\model.p3d";		
 picture = "transport\data\picture.paa";					
 icon = "transport\data\icon.paa";

 class UserActions
 {
   class EnterTransportStation
   {
     displayName = "Enter Transport Station";
     displayNameDefault = "Enter Transport Station";
     priority = 3;
     radius = 5;
     position = "action";
     showWindow = 0;
     onlyForPlayer = 1;
     shortcut = "reloadMagazine";
     condition = "(alive this)";
     statement = "this execVM ""transport\enter_transport.sqf"";";

   };
 };

 class EventHandlers {
 init = "this allowDamage false;";
};

Now, noting that in the above I used position "action", which appears to be a default position and works just fine for small objects.

I have attempted to use the action point in a building, BUT my model also has a Memory LOD with two points defined, "door_point" and "console_point".

The Transport is actually a building. "Entering" the transport teleports the player to it's location on the map. From there I want the player to be able to walk around the building and select various destinations from the console actions. The exit action will return the player to the new location of the transport.

The following does not work:


// I have tried extending Static, Building, NonStrategic, HouseBase, and House.
class Static;
class TransportInterior: Static
 {
   model = "transport\transport_interior.p3d";
   armor = 2000;
   scope = 2;
   vehicleClass = "Objects";
   displayName = "Transport Interior";

   class UserActions
   {
     class ExitTransport
     {
       displayName = "Exit Transport";
       displayNameDefault = "Exit Transport";
       priority = 3;
       radius = 200;
       position = "door_point";  // door_point is defined in Memory LOD
       showWindow = 0;
       onlyForPlayer = 1;
       shortcut = "reloadMagazine";
       condition = "(alive this)";
       statement = "this execVM ""transport\exit.sqf"";";
     };
   };

   // There are other actions to be added, but in the interest of keeping this post simple...

   class EventHandlers {
           init = "this allowDamage false;";
       }; 
 };

So you can see, it is effectively the same usage (I have even tried copying/pasting the EXACT same usage) but it just own't work for buildings?!

Edited by tofarley
typo

Share this post


Link to post
Share on other sites

So, I decided to try making the Interior (building) a subclass of ReammoBox_F (and eventually I changed to ThingX, which is the parent of ReammoBox_F). This seems to work out pretty well. Everything seems to be working. My Memory LOD, my collision... Everything is good, except I'd like to be able to remove the "Inventory" option that comes from ThingX. Anyone have any ideas on how to remove a built-in "Action"?

Share this post


Link to post
Share on other sites

Sup m8's i have a little trouble here and i need ur help.
I decided to implement the ability 2 open and close da door (lock unlock), but not 2 BIS houses, this feature is implemented using with variable "bis_disabled_Door_1, but unfortunately, this variable work apparently only with BIS houses.
K i decided 2 do differently in the cfg file, do check on UserAction, that if the house is closed, do not show UserAction "Scroll menu".
class open_door_1 { 
displayName = "Open Door"; 
position = "Interact1"; 
radius = 1; 
onlyForplayer = "true"; 
condition = "((this animationPhase 'Door_1') < 0.5) && (this getVariable 'tc_house_unlock')"; 
statement = "this animate ["Door_1", 1]"; 
};
this getVariable 'tc_house_unlock'
K, u see this now, but unfortunately the cfg generates an error when i add the second condition, a possible reason that "this" here is the door, not the house.
Guys i ask ur help, why this error is appears and there are options whether to remove she?
P.s - sorry 4 my bad eng.

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  

×