Frameworking Tutorial

From GECK
Jump to: navigation, search

Trait System

Traits add a simple and compatible way of extending the data on forms. These files provide an easy way for other modders to utilize your framework via Devkit.

Defining Traits We start by going into the "Fallout New Vegas\Data\DevKit" folder and creating a new text file. Make sure to give this text file the `.trait` extension so it's recognized by the system. Traits are form type specific, so we have to give our traits a TypeID.

Syntax to add new traits starts with the name of your trait, followed by a colon `:` and any argument types you'd like your trait to take. Here we defined a weapon (Type: 40) trait that takes two integer arguments.

Inside "Data/Devkit/MyFrameworkTraits.trait":

Type: 40
   RecoilAmount: int int

Using Traits The `(*)` syntax defines that the string argument is a key. Multiple `MoveNode` traits can be assigned to the same weapon form. Here’s an example of how a `MoveNode` trait can be used in a kit mod.

Inside "Data/Devkit/MyFrameworkTraits.trait":

Type: 40
   RecoilAmount: float float
   MoveNode: *string float float float

Here’s how someone would utilize our new `RecoilAmount`, `MoveNode` traits in their mods.

Inside "Data/Devkit/Your_Mod_Name/[Weapon]Edits_To_9mm.txt":

Link: WeapNV9mmPistol {
  RecoilAmount: 8 2
  MoveNode: "ProjectileNode" 0 52 54.2
  MoveNode: "BarrelNode" 8 23 1
}

New Actor Traits for NPCs Actors are Type 42, and we're going to add some new stats like `Deception`, `Persuasion`, and `Intimidation`.

Inside "Data/Devkit/MyFrameworkTraits.trait":

Type: 42
   Deception: int
   Persuasion: int
   Intimidation: int

Now someone can assign `Deception`, `Persuasion`, and `Intimidation` values to their NPCs via their DevKit files.

Inside "Data/Devkit/Your_Mod_Name/[NPC]Edits_To_EasyPete.txt":

Link: GSEasyPete {
  Name: "Super Easy Pete"
  Deception: 60
  Persuasion: 21
  Intimidation: 5
}