View unanswered posts | View active topics


Post a new topicPost a reply
Previous topic | Next topic 

  Experienced Modder Experienced ModderMember since: 06.09.2012, 20:32Posts: 442Location: Canyonlands, Utah Likes: 0
 

 Post Topic: Adding a new event to a vehicle?
PostPosted 26.10.2012, 12:18 
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:

Code:
      <Table name="AccessInventory" optional="1">
      </Table>


Then in the HMMWV.xml file in the Actions element I added a section like so:

Code:
    <Action class="AccessInventory">
       <Activations>
          <Activation type="OnUsed" param1="component" param2="back_door"/>
       </Activations>
    </Action>


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.



Miscreated - Official Website: http://miscreatedgame.com
Steam Greenlight: http://bit.ly/14h87r8
Facebook: http://on.fb.me/XBeB3p
Twitter: http://bit.ly/XBeyEK