How to Create a Lever

From Runic Games Wiki
Jump to: navigation, search

Contents

Summary

In this tutorial I will cover how to add a new exported lever (a unit trigger) to your mod through the editor based off the zip file supplied.

Example file

File:Mod lever 01.zip

First you will need to extract this zip to "your mod folder"\media\models\triggers\mod_lever_01

This Zip includes:

  • mod_lever_01.MESH, the model.
  • mod_lever_01.dds, the texture. The texture format needs to be a dds. Nvidia offer a dds converter.
  • mod_lever_01.material, the material file. This file declares how the outward apperance of the model will be represented. It's essentially a basic shader definition. Within it, one of the things it does is it states that the model uses the mod_lever_01.dds texture.
  • mod_lever_01.SKELETON, the bind skeleton file. This file is the bind data for how the model is attached to a set of bones for animation.
  • on.SKELETON, the on animation. This is the animation that plays for turning the lever on.
  • off.SKELETON, the off animation. This is the animation that plays for turning the lever off.

First Step: Create Lever GUTS Animation File

  1. Start up GUTS
  2. Create a generic model for the lever.
    1. Right click on the worskpace in the Layout panel.
    2. From the menu choose Building Blocks > Generic Model.
      Generic Model 01.png
  3. In the Property: GenericModel panel click on the FILE field and then click the "..." button to the right of it and browse to "your mod folder"\media\models\triggers\mod_lever_01\mod_lever_01.MESH. The editor now has a file that list the animations that can be used with mod_lever_01.
    Filepath 01.png
  4. While the Generic Model is still selected in the Layout panel, click the Button 01.png button at the top of the panel.
    Generic Model 02.png
  5. This brings up the Animation Editor. From here click on the Plus 01.png button and select Auto Add Missing Skeletons from the drop down menu.
    Animation Editor 01.png
  6. The Animation AutoAdder dialog will pop up. Make sure all 3 .skeleton files are listed and checked. Click the Add Checked button. Your Animation Editor window should now have all the skeletons listed.
    Animation Editor 02.png

You have now created a mod_lever_01.animation in your "your mod folder"\media\models\triggers\mod_lever_01 directory. This file is used in the game to associate the correct animations with the mod_lever_01.

Second Step: Create the Unit Trigger File

  1. Click the Data Editors menu > Units > Props. This opens up the Props unit editor window.
    Props Unit Editor 01.png
  2. Click the Plus 02.png. This will open up the So you want to add a new unit file... window. In this window you are creating a unit .dat file for your lever to be referenced in.
    Props Unit Editor 02.png
  3. Type "mod_lever_01" in the Single File field. This will be the name of the unit trigger file.
  4. Click the "..." button next to the Folder field and create folder structure and select the folder to "your mod folder"\media\units\props\triggers.
    Props Unit Editor 03.png
  5. Hit the OK button.
  6. Back in the Props unit editor window, many of the fields need to be filled out.
    1. Name field should say "mod_lever_01".
    2. Display Name' field should be "Lever". This is the name that will show up on the trigger in game.
    3. Unittype drop down should be set to "INTERACTABLE".
    4. Create As drop down should be set as "TRIGGER".
    5. Sound drop down should be set to "INTERACTSOUND".
    6. Resource Directory should be set to "your mod folder"\media\models\triggers\mod_lever_01 directory.
    7. Mesh File drop down should be set to "mod_lever_01".
    8. Fill out the States tab spreadsheet below. These are the two states for the unit.
      Props Unit Editor 05.png
  7. Hit the Button 02.png button to save the changes.

Conclusion

Now you have a new lever unit with and off and on states that can be hooked into logic to drive events on these states. For more information on how to use this with your level logic please see

Personal tools
Namespaces

Variants
Actions
Navigation
Runic Sites
Toolbox