VehicleInfo Class

From KitHack Model Club Wiki
Jump to navigation Jump to search

Back to SDK API Reference

VehicleInfo Class

The `VehicleInfo` class represents information about a vehicle in the game. It includes properties for vehicle details such as name, description, author, costs, dimensions, and more. This class also handles the loading and management of vehicle configuration data.

Public Fields

  • `public string name` - The name of the vehicle.
  • `public string description` - The description of the vehicle.
  • `public string Author` - The author of the vehicle.
  • `public string craftID` - The unique ID of the vehicle craft.
  • `public FSVersion Version` - The version of the vehicle.
  • `public ConfigNode vehicleNode` - The configuration node for the vehicle.
  • `public bool loaded` - Indicates whether the vehicle is loaded.
  • `public float cost` - The cost of the vehicle.
  • `public float xpcost` - The experience cost of the vehicle.
  • `public float repairCost` - The repair cost of the vehicle.
  • `public Vector3 dimensions` - The dimensions of the vehicle.
  • `public int partCount` - The number of parts in the vehicle.
  • `public float mass` - The mass of the vehicle.
  • `public bool invalid` - Indicates whether the vehicle is invalid.
  • `public ulong PublishID` - The publish ID of the vehicle.
  • `public string PublishTags` - The publish tags of the vehicle.
  • `public string craftPath` - The path to the craft file.

Public Properties

  • `public string FileNameWithoutExtension` - Gets the file name without the extension.
  • `public bool isAddonCraft` - Indicates whether the vehicle is an addon craft.
  • `public bool isStockCraft` - Indicates whether the vehicle is a stock craft.

Public Methods

  • `public VehicleInfo()` - Default constructor.
  • `public VehicleInfo(Construct construct)` - Constructor that initializes the vehicle with a construct.
  • `public VehicleInfo Load(ConfigNode node, string craftPath)` - Loads the vehicle information from a configuration node.
  • `public bool GetShallowLoadedStats(out float cTot, out int partCount, out float mass, out float repairCost, bool forceReload = false)` - Gets the shallow loaded stats of the vehicle.
  • `internal void OnVehicleSaved(string filePath, ConfigNode vNode)` - Handles the event when the vehicle is saved.
  • `public bool CanPublish()` - Determines if the vehicle can be published.
  • `public void SetName(string str)` - Sets the name of the vehicle.
  • `public string GetName()` - Gets the name of the vehicle.
  • `public string GetDescription()` - Gets the description of the vehicle.
  • `public string GetLocKey()` - Gets the localization key for the vehicle.
  • `public Construct GetConstruct(bool reload = false)` - Gets the construct of the vehicle.
  • `public void UncacheConstruct()` - Uncaches the construct of the vehicle.
  • `public List<ActionFigureInfo> GetCrew(bool reload = false)` - Gets the crew of the vehicle.
  • `public List<string> GetWorkshopTags()` - Gets the workshop tags of the vehicle.

See Also

  • Construct Class
  • ConfigNode Class
  • FSVersion Class
  • ActionFigureInfo Class
  • GameLogic Class
  • RWUtil Class
  • PartLoader Class