Jump to content
TeardownMods

Universal Door Latch Framework 1.5.2

   (4 reviews)

1 Screenshot

About This File

This mod will be migrated to steam workshop when available and will no longer be updated. Files will remain. This line will contain a link to the workshop page when this occurs. I apologize for the inconvenience, and thank you for your interest.

 

 

What it does:

This script allows for a generalized approach to latching doors without the need to give joints individual names and write custom scripts to look for those name specifically.

 

Permissions:

You can use this in any map without the need to ask for permission as long as you:

  1. List credit on the mod page with a link to this page.
  2. Do not include the script within your map itself, as this can cause problems; Instead, have your users grab the newest version from here.
     

How it works:

When the door is near enough to the closed position (limit "0"), it will apply a slight force to keep it closed. When you grab the door, it removes that force, allowing you to open the door. following this, it will remain loose until the door returns to its closed position. That means that if you leave a car door open, you could use your brakes to close it. This is different than other implementations that use interactions (button prompt) that switch the direction of the force. This is due mostly to my own preference, but also due to how the script checks for each door. It could probably be easily changed though if you prefer that method.

 

For Users:

Drop the folder from the .zip into your /documents/teardown/mods/ folder.

308235531_LEBI.png.34d62164ac8b4d4930f269356122bc7e.png

 

For developers:

Add "tags="Latch"" to the VOX of each shape. DO NOT TAG THE JOINT! Otherwise, the script will not work.

Add sound effects by extending the tag to "Latch=Vehicle" or "Latch=Structure".

Custom sounds can be added with "LatchOpenSound=../mod_name/path_to_sound.ogg" and "LatchCloseSound=../mod_name_path_to_sound.ogg". Ensure that the path always starts with "../" followed by the name of the FOLDER your mod is in, and then the rest of the path to the sound. If you get no sound instead of a custom one, it's probably a typo.

Please ensure that all joints you wish to latch are in the closed position at limit 0, as this is what the script considers the "closed" position. This generally means that the door is closed in the .vox file.

An example vehicle (The yellow van from the thumbnail) is included in the files.

xml.png.06cd1097b2a5d97a8ee6a7cf885894f5.png

 

Edited by Magnymbus
Added migration disclaimer


What's New in Version 1.5.2   See changelog

Released

NEW FEATURES

Custom sounds now have a fallback if the Latch tag has a value and only one custom sound is listed. Currently, this does not check if the file and path are valid, as I have no idea how to do that. Once I figure that out, it will be a PROPER fallback system. Syntax below.

tags="Latch=Vehicle LatchOpenSound=../mod_name/path_to_sound.ogg LatchCloseSound=../mod_name/path_to_sound.ogg"


BUG FIXES

If the Latch tag has a value, the script will attempt to use that as a fallback if you included either LatchOpen/CloseSound tags but did not give them values. Fallbacks do not currently work if the file path is simply invalid.
Error reports should be slightly more verbose now.


UNDER THE HOOD

A few systems were completely rewritten in order to fix how tables were being handled and to slightly increase the potential verbosity of debugging. Other than the (admittedly not very useful yet) fallback system, this shouldn't effect how users or developers interact with the script.

  • Like 2
  • Thanks 1

User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest

KV Productions

  

Wonderful script, very helpful and easy to use, deserves more attention and credit, this is one of those mods that just need to become a must for modders to have always at hand

Link to comment
XertoxGaming

   0 of 1 member found this review helpful 0 / 1 member

Hello. I wanna download this mod, but the problem is... I CAN'T READ. Can you send a tutorial video how to use that mod? I need that mod, please. -Xer.

 

Link to comment
1NS4N3

   1 of 1 member found this review helpful 1 / 1 member

This is a Very Good Addon To The Game! Does it Works With Cars From Mods?

Response from the author:

It should. As long as you add the proper tags, and the doors are meant to be closed at position 0. Let me know if you find any that don't work.

Link to comment
saltyleg

   2 of 2 members found this review helpful 2 / 2 members

Works like a charm

Link to comment
×
×
  • Create New...

How to Disable AdBlock - And why you should do it?

I have disabled AdBlocker. Refresh the page.