Skip to content

BodyState (for Weapons)

Grinch_ edited this page Jan 22, 2024 · 2 revisions

Weapon State Change Feature

Overview

This feature enables you to add some realism and variety to your weapons by changing their states based on CJ's body state. For example, you can have a shotgun model that looks different when CJ is fat, slim, or muscular.

Requirements

To use this feature, you need to have the following:

  • A weapon model (.dff file) that you want to apply the state change feature to.
  • Three different models (.dff files) that represent the different states of your weapon: fat, slim, and muscle.
  • A dummy object named x_body_state inside your weapon's .dff file, with three children named fat, slim, and muscle.

Steps

To use the state change feature, follow these steps:

  1. Create three different models for your weapon using any modeling software, such as 3ds Max, Blender, or ZModeler. The models should have the same name as your weapon, but with suffixes _fat, _slim, and _muscle. For example, if your weapon is named Shotgun, your models should be named Shotgun_fat, Shotgun_slim, and Shotgun_muscle. The models should have some differences in their appearance to reflect CJ's body state. For example, the Shotgun_fat model could have a wider barrel and a shorter stock, while the Shotgun_muscle model could have a longer barrel and a larger stock.
  2. Create a dummy object inside your weapon's .dff file using any modeling software. The dummy object should be named x_body_state.
  3. Add three children to the dummy object, named fat, slim, and muscle. These nodes will only be visible when their criteria are met. For example, the fat node will only be visible when CJ is fat, the slim node will only be visible when CJ is slim, and the muscle node will only be visible when CJ is muscular.
  4. Attach your models to the corresponding nodes. For example, attach the Shotgun_fat model to the fat node, the Shotgun_slim model to the slim node, and the Shotgun_muscle model to the muscle node.
  5. Save your weapon's .dff file and place it in the appropriate folder in your game directory.
  6. Enjoy the state change feature when you use your weapon in the game.

Example

Here is an example of how the state change feature works:

  • Suppose you have a shotgun model with three different models named Shotgun_fat, Shotgun_slim, and Shotgun_muscle.
  • You create a dummy object inside your shotgun's .dff file, named x_body_state.
  • You add three children to the dummy object, named fat, slim, and muscle.
  • You attach your models to the corresponding nodes.
  • You save your shotgun's .dff file and place it in the appropriate folder in your game directory.
  • When you use your shotgun model in the game, it will change its state based on CJ's body state. If CJ is fat, the shotgun will have a wider barrel and a shorter stock. If CJ is slim, the shotgun will have a normal barrel and a normal stock. If CJ is muscular, the shotgun will have a longer barrel and a larger stock. The state will change dynamically as CJ's body state changes.