Tank Tracks Framework & API
Фото и видео: 1 из 2. Материалы автора из Steam Workshop.
О материале
«Tank Tracks Framework & API» — материал мастерской Space Engineers. Моды, чертежи кораблей, скрипты и миры для Space Engineers. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
This provides other mods the ability to have tracks over specific types of blocks.
Video courtesy of Patrick.
Player usage
You need other mods that use this to have something actually happen.
List of known mods using this:
If you make a mod that uses this framework, contact me and I'll add it to this list.
Features
-
Framework & API Any mod can use this to make their own tracks over specific blocks with their own model. It also has a C# modding API, refer to the tank track builder mod as an example.
-
Flexible and animated (View) Track "stretches" over any number of chosen wheels as a convex shape. It animates 1:1 to vehicle movement and it reacts to terrain or grids under it. But do mind that it's visual only! At least by default, other mods can use the API to give it special properties.
-
Static rollers Non-suspension wheels can also be used with or without rotors. They're also rotated with track movement (or a subpart can be instead).
-
Car controls maintained Suspensions still physically steer but visually they remain straight, allowing you to control it like a car. For actual tank-steering you'll have to use the various options already out there like PB scripts or mods.
-
Debris when destroyed The pieces get scattered from the broken wheel location and live for about 10s. Also an option for particle effect per broken segment (ones near the broken wheel are tagged as broken segments).
-
Multiplayer-ready Track creation and removal is synchronized to/from players (the API too).
-
Blueprints, projection and copy-paste support Tracks get saved in one of the blocks, this means they carry over to blueprints, pastes, etc. Designed to work with projectors by waiting until all blocks are present. It also shows up in projection itself (currently only static and suspension can do this).
-
Coloring and skinning support The tracks take on the color and skin of the base block (suspension, rotor, or the wheel block itself if static).
-
Optimized Various optimizations are made to help alleviate the impact
-
Animations are computed player-side, DS still computes some track checking things but no animations.
-
Update-rate based on changes and distance as well as track size, a huge track will still update smoothly over a longer distance. Also stops updating and goes invisible after a high distance.
-
Each track is computed in parallel to all others while simulation waits for all to complete, this reduces the linear increase in compute time with more tracks present.
-
Still a lot more left to be optimized, primarily in avoiding the mod profiler hit...
Modders: Adding Tracks
A few things needed:
-
A model for the track segment (can use zonechip item model as a temporary one). Recommended to be 1m wide to aid with scaling guesstimates.
-
Blocks to allow them on, can be vanilla or custom (supported types: MotorSuspension and static CubeBlock/Wheel/etc.)
-
TankTracks.ini file in your mod's Data folder, see: https://gist.github.com/THDigi/d9d41e35a97fd9b55a3e9d3a7e0a8d72 It is important for this file to be named exactly that and be directly Data folder, the modAPI cannot search for files.
-
This mod as dependency (also let me know if you want your mod linked in this page).
You can look at (https://steamcommunity.com/sharedfiles/filedetails/?id=3209008231)'s contents as a practical example.
For fine tweaks there's /tanktracks reload to reload all the TankTracks.ini from all mods and respawn tracks. Only works in offline worlds.
Modders: API
NOTE: This is optional! To add new tracks you don't need to program anything, see the above section instead.
The (https://steamcommunity.com/sharedfiles/filedetails/?id=3209005014) mod can act as an example for the API usage.
The gist is:
-
Go to this mod's downloaded files and copy the Data\Scripts\TankTracks\API folder to your mod (can rename the folder of course).
-
A session component to handle instancing and unloading of the TankTracksAPI class: https://gist.github.com/THDigi/d515209c9dce1d0bee1deb86235a654a
-
And that's it, now you can interact with the tank tracks API.
Mind that the API is not even close to complete so don't be shy in asking for things to be exposed or fixed.
mod io?
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.