Note: I created this topic in this forum instead of the Development forum in hopes that people who create vehicles will know about the xml files and how the work - I'm guessing this is the correct forum for modding vehicles...
I don't know if this is possible using the code we have access to, but I'm asking the question on hopes of someone knowing the answer at least - or has any additional ideas on what I can try.
I'm currently working on adding storage to vehicles (for my inventory system I've demoed in my videos). To access the inventory, I'd like the user to walk up to the vehicle and then press the inventory key and display the inventory for the vehicle, but only if they're targeting certain areas of the vehicle. For example, on the HMMWV it is the "back_door" component that is defined in the XML file
Here's what I tried to do, but it doesn't work:
In the def_vehicle.xml file, after the Activations element I added a new table entry like so:
<Table name="AccessInventory" optional="1">
Then in the HMMWV.xml file in the Actions element I added a section like so:
<Activation type="OnUsed" param1="component" param2="back_door"/>
I then added a new CVehicleActionAccessInventory that is derived from IVehicleAction and registered in the GameFactory. All of that seems to work so far as everything gets loaded on game start and no errors are displayed.
Now for my question:
The OnUsed in the Activation type above (and there's also one in an Enum in the def_vehicle.xml file, is there any way of adding my own like OnInventory? I have no idea how or what the OnUsed really does, but I can't seem to do anything besides OnUsed. Where does OnUsed get invoked and defined at?
If I do walk up to the HMMWV and target the back_door, it does fire an event into my class (I get the eVAe_IsUsable event), but I never get any sort of "use" event even when I press the use key.