Garry's Mod

Garry's Mod

50 ratings
Scaler Keys Module
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Tool
Addon Tags: Fun, Scenic, Realism
File Size
Posted
Updated
12.523 KB
24 Jan, 2023 @ 9:02pm
2 Apr, 2023 @ 12:06pm
2 Change Notes ( view )

Subscribe to download
Scaler Keys Module

In 1 collection by Cpt. Hazama
Cpt. Hazama's Addons
58 items
Description
Welcome to my Scaler Keys Module! This module allows scaler keys to be utilized in Garry's Mod through lua.


This module is for developer usage. They may require you to download this for their mod. Please ignore the rest of the description unless you are trying to develop a mod utilizing the module :)


Source Code[github.com]


HOW TO USE
This tool was developed with MeltyPlayer's Model Extractor tool in mind, though you can manually create the scaler data if you wish or write your own script to generate it. I will eventually make my own script but at the moment I have only needed scaler data for Pikmin models. This guide will assume you are using MeltyPlayer's Model Extractor tool. To enable this feature, 'scaler_enabled' must be set to 1 in your console (by default it will be turned on upon first installation).
  • Grab your bone_scale_animations.txt file and rename the extension to .lua, then paste it into your entity's lua folder
  • Open the file and change ScalerKeysTable to ENT.ScalerKeysTable
  • For optimization sake, replace any Vector(1, 1, 1) with defScale
  • Go to your shared.lua of your entity (or any file that has the client realm) and at the top add:
    • include("bone_scale_animations.lua")
  • Make sure you have 'scaler_enabled' command set to '1'
  • Test it out!
  • You might need to manually change some stuff in the exported data but its not wild!


NOTES
  • While this code has been as optimized as possible, it is possible that having excessive amounts of entities/bones with scaling might impact performance. Most models I've tested from games only have a few bones that scale so this shouldn't be an issue
  • If you are manually creating a data table, I highly recommend checking the GitHub page example file. Only bones that have scaling should be inserted into the animation's data
  • You can force scalers on any entity regardless of the convar, though I don't recommend this as the module is entirely client-side and the client should have the option to disable scaling in the event their PC is trash or they installed 700+ mods


COMMUNITY LINKS
Click on the icons to open the links!
    [discordapp.com]


CREDITS
  • Cpt. Hazama (me) - Coding
  • MeltyPlayer - Adding export scaler data to his tool


Copyright © 2023 by Cpt. Hazama, All rights reserved.
All trademarks belong to their respective owners.
All content not owned or claimed by Cpt. Hazama belong to their respective owners.
Nothing in these files or/and code may be reproduced, adapted, merged or modified without prior written consent of the original author, Cpt. Hazama. Any and all content that Cpt. Hazama has ported and rigged for Garry's Mod may NOT be used or reuploaded under any circumstance. Doing so would be violating Valves Terms and Conditions