mdx_Gate Script!
Config File Guide for the Gate System
This Config file allows you to manage the gates that players can interact with in your game. You can set up multiple gates, each with different settings like their positions, models, and animations. Below is a guide on how to use and modify the config.
Basic Structure
The Config
file contains a table of stations, and under each station, you define the gates. Each gate has its own settings for where it’s located, how it behaves, and what animations it uses.
Example of the Config:
How to Add a Gate
To add a new gate, you just need to add a new entry in the Config.Gates
section for a new station. Each gate needs some basic information:
Gate Position: Where the gate is located in the world (coordinates).
Gate Rotation: How the gate is facing when it spawns.
Key Positions: Where the player can press a button to interact with the gate (one outside and one inside).
Gate Model: The 3D model of the gate.
Animation: The animation to play when interacting with the gate.
Example: Adding a New Gate
Just copy the structure, change the values to fit the new gate, and you're good to go!
What Each Setting Does
GateCoords: This is where the gate will appear in the game world. You can get these coordinates by using a map editor or finding the spot manually in-game.
GateRotation: This controls which direction the gate is facing when it spawns. You usually don't need to worry about this unless the gate is facing the wrong way.
KeyCoordsOutside and KeyCoordsInside: These are the positions where players can press the interaction key to open the gate. One position is outside, and the other is inside. Place these coordinates near the gate.
model: This is the name of the gate model (like
mdx_alp_bifolding
), which tells the game what 3D object to use. Make sure the model exists and is properly set up in the game files.animationDict and animationName: These are the animations that play when the gate is opened. You can use custom animations or existing ones, depending on what you have in your resource files.
InteractionDistance: The distance (in meters) from the gate at which players can press the interaction key (
E
by default) to open the gate. You can change this distance if you want players to be able to interact from farther away or up close.
Key Interaction
The default key to interact with the gate is
E
. Players need to be close to the key positions (outside or inside) to interact with the gate.When the player is close enough to the gate's key position, a notification will appear telling them to press
E
to open the gate.
Summary
To add a gate: Copy the format of a gate configuration, change the coordinates, model, and animation details, and you're ready to go.
Customize distances: Adjust the interaction distance to fit your needs.
Make sure models and animations are loaded properly: Ensure the gate model and animations are available in your resource files.
Last updated