Metabolism System

🌊 CAS Metabolism System - Complete Documentation

📋 Table of Contents

  • Overview

  • Features

  • Requirements

  • Installation

  • Configuration

  • API Documentation

  • Theme System

  • Level/XP System

  • Item System

  • Customization

  • Troubleshooting

  • Performance

  • Support


🌟 Overview

CAS Metabolism System is the most advanced metabolism and HUD system for RedM servers, built specifically for the VORP Framework. This system combines modern React/TypeScript technology with comprehensive gameplay mechanics to deliver an unparalleled player experience.

🎯 Key Highlights

  • 🎨 3 Unique Themes: Western, Minimal, and Wave with animated effects

  • ⚡ Modern React UI with TypeScript for maximum performance

  • 🎮 Complete VORP Integration with character system

  • 🔧 Advanced Customization with drag & drop interface

  • 📊 Comprehensive Level/XP System with persistent data storage

  • 🌍 Multi-language Support (EN, FR, ES, DE, TR)

  • 🎨 Advanced Color System with presets and individual customization


✨ Features

🎨 Three Stunning Themes

1. Western Theme 🤠

  • Traditional hexagonal design with gradient fills

  • Progress text display with percentage values

  • Classic western aesthetic with detailed SVG elements

  • Perfect for traditional roleplay servers

2. Minimal Theme ⚪

  • Clean circular progress rings with white stroke indicators

  • Modern minimalist design

  • SVG icon fill system for health/stamina cores

  • Ideal for modern/futuristic servers

3. Wave Theme 🌊 [NEW!]

  • Square containers with animated wave effects

  • Bottom-to-top liquid fill animation

  • Realistic wave physics with CSS animations

  • Dynamic wave colors based on status

  • Gold core enhancement with glowing wave effects

📊 Comprehensive Metabolism System

Core Statistics

  • Health System: Inner/Outer cores with gold enhancement support

  • Stamina System: Inner/Outer cores with gold enhancement support

  • Hunger: Realistic decay with running multipliers

  • Thirst: Dynamic decrease based on activity

  • Stress System: Visual effects and screen shake

  • Dirt/Cleanliness: Automatic tracking

  • Temperature Display: Real-time weather integration

  • Alcohol Effects: Progressive drunk system with visual distortion

  • Voice Chat Indicator: Real-time microphone status

  • Horse Integration: Health & stamina when mounted

Gold Core Enhancement System ✨

  • Visual Effects: Glowing icons and wave effects

  • Timer Display: Remaining enhancement time shown above elements

  • Dual Core Support: Inner and outer cores independently enhanced

  • Animation Effects: Pulse and glow animations for enhanced attributes

  • Theme Integration: Works across all three themes

🎯 Level/XP System

Visual Progress

  • Animated XP Bars: Smooth progress animations across all themes

  • Level Display: Current level with XP progress (0-100 per level)

  • Real-time Updates: Instant visual feedback

  • Theme Integration: Unique display for each theme

Data Management

  • JSON Storage: Persistent character data in levelsystem.json

  • Character-based: Individual progress per character identifier

  • Automatic Leveling: XP overflow handling (100 XP per level)

  • Export System: Full API for other resources


🔧 Requirements

Framework Dependencies

  • VORP Core (Latest version) - Required for character system

  • VORP Inventory - Required for item usage system

  • RedM Server (Latest artifacts recommended)

Optional Dependencies

  • CAS Progress Bar - Enhanced progress bar visuals

  • CAS Notification - Custom notification system

  • PMA-Voice or Mumble - Voice chat integration


🚀 Installation

Step 1: Download & Extract

Step 2: Server Configuration

Add to your server.cfg:

Step 3: Database Setup

No database setup required! The system uses JSON file storage for XP data, which is automatically created and managed.


⚙️ Configuration

🎮 Client Configuration (config/client_config.lua)

🎨 HUD Colors Configuration

🌈 Color Presets System

🍎 Item Configuration (config/shared_config.lua)

🌍 Localization (config/locale.lua)


📖 CAS-Metabolism Exports Documentation

This document explains all available exports in the CAS-Metabolism system. You can use these exports in your scripts to get, set, or update player metabolism values such as health, stamina, hunger, thirst, stress, etc.


🔹 Available Metabolism Keys

Each metabolism type is stored in PlayerMetabolism.Values.

Some keys are simple values (e.g., hunger, thirst), while others are tables with multiple attributes (e.g., health, stamina).

✅ Simple values

  • hunger0 - 100

  • thirst0 - 100

  • stress0 - 100

  • dirt0 - 100

  • weather0 - 100

  • drunk0 - 100

✅ Complex values (with gold cores)

These contain inner, outer, and gold core states:

  • stamina

  • microphone

  • horsehealth

  • health

Each of these has:


🔹 Exports

1. getMetabolismValue(metabolism)

Get the current value of a metabolism key.


2. getAllMetabolismValues()

Get all metabolism values at once.

This returns the full PlayerMetabolism.Values table.


3. setMetabolismValue(metabolism, value)

Set a specific metabolism value. This will update the player status and sync with React.

Example 1 – Simple value

Example 2 – Complex value (with gold core)


🔹 Notes

  • All values are clamped between 0 and 100 automatically.

  • Gold cores (innerGold, outerGold) are boolean values (true/false).

  • Gold core timers (innerGoldTime, outerGoldTime) are integers in seconds.

  • When setting a complex value, you must provide the full table structure.


✅ Example Use Case


With these exports, you can fully control the metabolism system for your players in CAS-Metabolism.


🎨 Theme System

Theme Switching

Players can switch between themes in real-time through the HUD settings menu:

Western Theme

  • Design: Hexagonal containers with gradient fills

  • Progress: Text-based percentage display

  • Colors: Traditional western color palette

  • Animation: Smooth fill animations from bottom to top

Minimal Theme

  • Design: Circular progress rings

  • Progress: White stroke progress indicators

  • Colors: Clean, modern color scheme

  • Animation: SVG fill animations for inner cores

Wave Theme 🌊

  • Design: Square containers with liquid wave effects

  • Progress: Animated wave fill from bottom to top

  • Colors: Dynamic wave colors with gold enhancement

  • Animation: Realistic wave physics with CSS animations

Theme Configuration


📊 Level/XP System

System Overview

  • XP per Level: 100 XP required for each level

  • Storage: JSON file (levelsystem.json) for persistence

  • Character-based: Individual progress per character identifier

  • Real-time Updates: Instant UI feedback with animations

📘 CAS Level System – Export Usage Guide

This document explains how to use the exports provided by the CAS Level System. These functions allow you to get, add, and remove XP/levels for characters.


🔹 Getting Started

First, make sure you correctly retrieve the player’s character identifier from your core system:

You will need identifier for all function calls.


📥 Available Exports

1. getXP(identifier)

Returns the current XP of the given character.


2. addXP(amount, identifier, source)

Adds XP to a character. If XP reaches 100, it automatically levels up.

💡 Example: Reward player XP after finishing a mission.


3. removeXP(amount, identifier, source)

Removes XP from a character. If XP goes below 0, the character levels down.


4. getLevel(identifier)

Returns the current level of the given character.


5. getPlayerLevelData(identifier)

Returns a table with both XP and level values.


📌 Example Use Case

Reward a player with XP when completing a job:


✨ That’s it! With these exports you can easily integrate XP and leveling into your scripts.

🍎 Item System

40+ Pre-configured Items

Alcoholic Beverages

  • whisky: High alcohol content with drunk effects

  • wine: Moderate alcohol with thirst restoration

  • beer: Light alcohol with stamina boost

  • vodka: Strong alcohol with health boost

  • tequila: Premium alcohol with enhanced effects

  • tropicalPunchMoonshine: Moonshine variant

  • wildCiderMoonshine: Cider moonshine variant

  • raspberryale: Fruit-flavored alcoholic beverage

Food Categories

  • Breakfast Items: consumable_breakfast

  • Fruits: consumable_peach, consumable_pear

  • Vegetables: consumable_veggies

  • Fish: consumable_bluegil, consumable_salmon, consumable_trout

  • Desserts: consumable_chocolate, cheesecake, consumable_blueberrypie

  • Baked Goods: Various cakes and pastries

Medical Supplies

  • bandage_2: Outer health restoration with bandage animation

  • syringe_2: Inner health restoration with injection animation

Beverages

  • consumable_coffee: Stamina boost with gold core enhancement

  • milk: Nutritious drink with health benefits

  • consumable_raspberrywater: Fruit-flavored water

Advanced Item Configuration

Gold Core Enhancement Items

Animation System

Available animation types:

  • "eat": General eating animation with props

  • "drink": Drinking animation with bottles

  • "coffee": Special coffee drinking animation

  • "stew": Eating stew with spoon animation

  • "syringe": Medical injection animation

  • "bandage": Bandage application animation

Screen Effects

Item Usage Flow

  1. Player uses item → VORP Inventory triggers usage

  2. Animation plays → 6-second animation with prop

  3. Effects applied → Metabolism values updated

  4. Screen effects → Visual effects if configured

  5. Notification → Success message displayed

  6. Return item → Optional item returned (e.g., empty bottle)


🎨 Customization

Drag & Drop Interface

  • Activation: Use /hudsettings → "Drag Elements"

  • Visual Feedback: DnD indicators appear on all elements

  • Persistent Positions: All positions saved automatically

  • Reset Function: One-click position reset to defaults

Individual Element Sizing

  • Scale Range: 0.5x to 2.0x for each element

  • Independent Scaling: Each element sized individually

  • Real-time Preview: See changes instantly

  • Persistent Settings: Saved across sessions

Advanced Color System

Three Color Types per Element

  1. Background/Stroke Color: Main element color (theme-dependent)

  2. Icon Color: Full state icon color

  3. Empty Icon Color: Empty state icon color

Color Presets

  • 5 Pre-made Presets: Default, Neon, Nature, Fire, Ice

  • One-click Application: Apply entire color scheme instantly

  • Theme Compatibility: Works across all themes

Individual Customization

  • Per-element Colors: Customize each element individually

  • Bulk Operations: Apply colors to all elements at once

  • Real-time Preview: See changes immediately

  • Persistent Storage: Colors saved in localStorage

Theme-specific Color Behavior

Western Theme

  • Background Color: Hexagon fill gradient

  • Icon Color: SVG icon fill color

  • Empty Icon Color: Icon color when empty

Minimal Theme

  • Stroke Color: Circular progress ring color

  • Icon Color: Full SVG icon fill

  • Empty Icon Color: Empty SVG icon fill

Wave Theme 🌊

  • Wave Color: Liquid wave fill color

  • Icon Color: Center icon color

  • Empty Icon Color: Container background color


🔧 Advanced Features

Gold Core Enhancement System

Visual Effects

  • Glowing Icons: Enhanced icons with gold color and glow effect

  • Wave Enhancement: Gold-colored waves in Wave theme

  • Pulse Animation: Breathing glow effect for enhanced attributes

  • Timer Display: Remaining enhancement time above elements

Implementation

Stress System

  • Progressive Effects: Different intensities based on stress level

  • Screen Shake: Configurable shake effects at high stress

  • Shooting Integration: Stress increases when shooting

  • Visual Feedback: Real-time stress indication in HUD

Alcohol System

  • Progressive Intoxication: Multiple drunk levels

  • Screen Effects: Visual distortion when drunk

  • Ragdoll Effects: Character stumbles when heavily intoxicated

  • Realistic Recovery: Time-based alcohol decrease

Horse Integration

  • Automatic Detection: Shows horse stats when mounted

  • Health & Stamina: Both inner and outer cores

  • Dynamic Display: Appears/disappears based on mount status

  • Gold Core Support: Enhanced horse attributes

Voice Chat Integration

  • Real-time Indicator: Shows when player is talking

  • Multiple Systems: Supports PMA-Voice and Mumble

  • Visual Feedback: Microphone element fills when active


🎮 User Experience

In-Game Commands

Settings Menu Features

1. Element Visibility

  • Show/hide any HUD element

  • Individual toggle switches

  • Real-time preview

  • Persistent settings

2. Drag Elements

  • Move elements anywhere on screen

  • Visual drag indicators

  • Snap-to-grid feel

  • Position memory

3. HUD Themes

  • Switch between Western/Minimal/Wave

  • Instant theme changes

  • Position preservation

  • Theme-specific optimizations

4. Individual Sizes

  • Scale each element 0.5x-2.0x

  • Real-time size preview

  • Independent scaling

  • Size memory

5. Color Presets

  • Apply pre-made color schemes

  • 5 beautiful presets included

  • One-click application

  • Theme compatibility

6. Color Customization

  • Individual element color control

  • 3 colors per element

  • Bulk color operations

  • Real-time preview


🔧 Technical Implementation

React/TypeScript Architecture

Performance Optimizations

  • Efficient Rendering: Only updates changed elements

  • Memory Management: Proper cleanup of resources

  • Network Optimization: Minimal network traffic

  • Animation Performance: 60fps smooth animations

Data Persistence


🎯 Integration Examples

Basic Integration

Metabolism Monitoring

XP Rewards System


🔧 Advanced Configuration

Metabolism Decay Rates

Stress System Configuration

Voice Chat Configuration


🎨 Customization Guide

For Server Owners

Setting Default Colors

Adding Custom Items

For Players

Theme Customization

  1. Use /hudsettings to open settings

  2. Select "HUD Themes" to switch themes

  3. Use "Color Presets" for quick color schemes

  4. Use "Color Customization" for individual control

Layout Customization

  1. Use "Drag Elements" to move elements

  2. Use "Individual Sizes" to scale elements

  3. Use "Element Visibility" to show/hide elements

  4. All changes are saved automatically


🐛 Troubleshooting

Common Issues

HUD Not Showing

XP Not Updating

  1. Check server console for errors

  2. Verify character identifier exists

  3. Check levelsystem.json file permissions

  4. Ensure VORP Core is running properly

Items Not Working

  1. Verify VORP Inventory is running

  2. Check item names match exactly in database

  3. Ensure items exist in VORP items table

  4. Check console for item registration errors

Colors Not Applying

  1. Clear browser cache (F5 in NUI)

  2. Check localStorage for saved settings

  3. Reset to defaults in HUD settings

  4. Verify color format is valid hex

Positions Not Saving

  1. Check browser localStorage permissions

  2. Verify position keys are correct

  3. Reset positions if corrupted

  4. Check console for position errors

Debug Mode

Enable debug mode for detailed logging:

This enables:

  • Detailed console logging

  • Automatic HUD display for testing

  • Development XP data loading

  • Enhanced error messages

Console Commands for Testing


📈 Performance

Resource Usage

  • Client Memory: ~15-25MB

  • Server Memory: ~5-10MB

  • Network Usage: <1KB/s per player

  • CPU Usage: <1% on modern hardware

  • Update Frequency: 250ms for smooth animations

Optimization Features

  • Efficient React Rendering: Minimal re-renders with proper state management

  • Optimized Network Traffic: Only sends changed data

  • Memory Leak Prevention: Proper cleanup of event listeners

  • Smooth Animations: 60fps performance with Framer Motion

  • Lazy Loading: Components loaded only when needed

Scalability

  • High Player Count: Tested with 200+ concurrent players

  • Low Latency: Minimal network overhead

  • Stable Performance: No memory leaks or performance degradation

  • Cross-platform: Works on all RedM supported platforms


🔒 Security & Validation

Server-side Validation

  • Metabolism Changes: All changes validated server-side

  • XP System: Anti-cheat protection for level manipulation

  • Item Usage: Secure item validation through VORP Inventory

  • Configuration Protection: Server-side config validation

Data Integrity

  • Character-based Storage: Secure per-character data

  • JSON Validation: Proper data format validation

  • Backup System: Automatic data backup on changes

  • Error Recovery: Graceful handling of corrupted data


🌍 Multi-language Support

Supported Languages

  • English (en) - Default

  • French (fr) - Français

  • Spanish (es) - Español

  • German (de) - Deutsch

  • Turkish (tr) - Türkçe

Adding New Languages

Dynamic Language Loading

  • Language changes without server restart

  • Automatic UI updates

  • Fallback to English for missing translations

  • Client-side language switching


🚀 Future Updates

Planned Features

  • Additional Themes: More visual themes

  • Enhanced Animations: More animation types

  • Extended API: More integration options

  • Performance Improvements: Continued optimization

Community Requests

  • Custom Themes: User-created theme support

  • More Languages: Additional language support

  • Enhanced Effects: More visual effects

  • Mobile Optimization: Touch-friendly interface


📞 Support

Getting Help

  1. Read Documentation: Check this guide thoroughly

  2. Check Console: Look for error messages

  3. Debug Mode: Enable for detailed logging

  4. Community: Ask in our Discord server

Reporting Issues

Include in your report:

  • Server Version: RedM build number

  • VORP Version: Core and inventory versions

  • Error Messages: Full console output

  • Steps to Reproduce: Detailed reproduction steps

  • Configuration: Your config files

Feature Requests

We welcome suggestions! Include:

  • Detailed Description: What you want to achieve

  • Use Case: Why this feature would be useful

  • Implementation Ideas: How you think it should work


📄 License & Credits

License

This resource is protected and licensed. Please respect the license terms and do not redistribute without permission.

Credits

  • Development: Code After S*x Team

  • Framework: VORP Core Integration

  • UI Framework: React + TypeScript

  • Animations: Framer Motion

  • State Management: Redux Toolkit


📊 Version Information

Current Version: v2.0.0

  • ✅ Complete metabolism system

  • ✅ 3 unique themes (Western, Minimal, Wave)

  • ✅ Advanced customization system

  • ✅ Level/XP system with JSON storage

  • ✅ 40+ pre-configured items

  • ✅ Gold core enhancement system

  • ✅ Multi-language support

  • ✅ VORP Framework integration


This documentation covers the complete CAS Metabolism System for RedM servers using the VORP Framework. For additional support or custom development, contact the Code After Sx team.*

🌊 Experience the future of RedM metabolism systems with CAS Metabolism!

Last updated