forked from RigsOfRods/rigs-of-rods
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
STATUS: ALPHA! Glitchy, only adding a part works, the remove-button is dummy. This adds a new mod type "addonpart" (file pattern *.addonpart) which works as a partial truck file - when selected, it adds additional elements to it. Currently supported features are: managedmaterials, props, flexbodies. The point is to automate what users had to do manually before: https://docs.rigsofrods.org/tools-tutorials/addons/ The addon parts receive all usual treatment from modcache: they can have preview images, name + description are always displayed, they can be searched for, the MainSelectorUI can be opened in mode 'LT_AddonPart' to show only addon parts. In addition, the search can be filtered by a vehicle GUID, much like with SkinZips. This is an example addonpart (port of https://forum.rigsofrods.org/resources/heavy-bumper-for-the-chevy-k3500.461/): ``` addonpart_name "Heavy Bumper for the Chevy K3500 (Prop, Black)" addonpart_description "For use with GMT400 88-98 Chevy Truck Pack" ;addonpart_guid <guid> ~ multiple GUIDs can be specified addonpart_guid 057b21c8-cb54-496d-88ce-4855a8d6d43d ; * 1990 Chevy 454ss, * 1990 Chevy k3500 * 1990 Chevy K3500HD addonpart_guid 6a53ad83-255d-4d5e-bf14-ca0714e5228d ; * 1990 Chevy k2500 Blazer, -SAS, -Suburban managedmaterials CHeavyBumper mesh_standard HeavyBumper.dds HeavyBumper_s.dds props 39, 62, 34, 0.50, 0.32, -0.5, 0, 180, 180, CHeavyBumper.mesh ``` There's a new menu in TopMenubarUI: "Tuning". It lists already installed addonparts and contains [add parts] button which opens MainSelectorUI in 'LT_AddonPart' mode, with GUID filtering for the current vehicle. To remember what addonparts user selected, an additional mod type was added: "tuneup" (file pattern *.tuneup) - this works like ".skin for addonparts" and has intentionally similar syntax. There are 2 power tools: * "use_addonpart <filename>" to install an addonpart on the vehicle (multiple can be used!) * "remove_prop <meshname>" to strip an existing prop from the vehicle. Note: An option to replace prop was intentionally not implemented because that would be a duplicate feature with addonparts. It's up to user to remove props if and only if they don't want them together with new parts. When user uses addonpart with a vehicle for the first time, the game creates a .tuneup file for it in {Documents\My Games\Rigs of Rods\projects\}. When spawning the vehicle next time, the .tuneup is loaded automatically. In the future the menu will be able to save custom tuneups. Here's an example: ``` Tuned 1990 Chevy 454ss { use_addonpart = CHeavyBumperBlackProp.addonpart preview = description = author_name = ohlidalp author_id = -1 category_id = 8100 guid = 057b21c8-cb54-496d-88ce-4855a8d6d43d } ``` Under the hood, applying the addonparts to the vehicle works entirely in system memory, no truck files are modified or written. * "use_addonpart" works by literally introducing a fake 'section/end_section' to the truck file parsed in memory - see `class RigDef::File::Module` and function `ActorSpawner::ConfigureAddonParts()` for details. * "remove_prop" works as last-minute check in `ActorSpawner::ProcessProp()`, skipping props which are blacklisted.
- Loading branch information
Showing
28 changed files
with
1,058 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.