Skip to content

πŸ“¦ Content managing tool for Garry's Mod

License

Notifications You must be signed in to change notification settings

RavMda/content_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Build Release Version

Content Manager πŸ“¦

Tool designed to simplify content management for Garry's Mod server owners.
It allows you to organize your addons into "addon packs," merging materials, models, and more.
Check out the structure in the Usage section for a visual guide.

Building πŸ› οΈ

To get started, follow these steps:

  1. Install Rust
  2. Clone this repository using the following command:
    git clone https://github.com/RavMda/content_manager
  3. Now, build it
    cargo build

Once the build process is complete, locate the executable in the target folder and proceed to the next section.

Usage πŸš€

  1. Download latest release here
  2. Organize your server content in the following folder structure:
    .
    └── my_content/
        β”œβ”€β”€ input/
        β”‚   └── playermodels/
        β”‚       β”œβ”€β”€ neco_arc_pm/
        β”‚       β”‚   β”œβ”€β”€ models/
        β”‚       β”‚   β”œβ”€β”€ materials/
        β”‚       β”‚   └── lua/
        β”‚       β”œβ”€β”€ spongebob_pm/
        β”‚       β”‚   β”œβ”€β”€ models/
        β”‚       β”‚   β”œβ”€β”€ materials/
        β”‚       β”‚   └── lua/
        β”‚       └── models.json
        β”œβ”€β”€ output/
        β”‚   β”œβ”€β”€ _lua/
        β”‚   β”œβ”€β”€ _lua_merged/
        β”‚   └── playermodels/
        β”‚       β”œβ”€β”€ models/
        β”‚       └── materials/
        β”œβ”€β”€ source-mdl-rs.exe
        └── Config.toml
    
  3. Run the source-mdl-rs executable

Your repacked addons will be available in the output folder.

Models whitelist πŸ“œ

The tool allows you to create a whitelist for models in your addon packs, eliminating unnecessary content. This is useful for playermodels.
Follow these steps:

  1. Use this example lua script for DarkRP to generate a list of used models

    local models = {}
    
    for _, job_extra in ipairs(RPExtraTeams) do
    	if not job_extra.model then
    		continue
    	end
    
    	if isstring(job_extra.model) then
    		table.insert(models, job_extra.model)
    	end
    
    	if istable(job_extra.model) then
    		table.Add(models, job_extra.model)
    	end
    end
    
    local json = util.TableToJSON(models, true)
    
    SetClipboardText(json)
  2. Paste the generated content into a file named models.json` within your addon pack.

Config βš™οΈ

Customize the tool to fit your needs:

  • input_folder: Specifies the original server content folder. (Default: "input")
  • output_folder: Sets the folder for repacked addons. (Default: "output")
  • ignored_addon_packs: Skips specified addon packs during repacking. (Default: ["playermodels", "playermodels2"])
  • model_whitelist: Enables (true) or disables (false) the models whitelist feature. (Default: **true**)

License πŸ“„

GPL-3.0 License