Skip to main content

Installation

1

Download

Get the latest release from our Tebex store and download it from your Keymaster
2

Extract

Extract the spooni_ambientPedManager folder to your server’s resources directory
3

Configure

Add ensure spooni_ambientPedManager to your server.cfg
4

Customize

Edit config.lua to match your server logic and requirements

Configuration

The script is configured through the config.lua file. Here are the main configuration sections:

Relationship types

Define the numeric values for each relationship type:

Group relationships

Set static relationships between two AI groups:

Player relations

Configure how groups behave around the player:

Conditional rules

Dynamic rules based on game context (time, job, weather, etc.):
Use "player" in conditional rules to dynamically resolve the player’s group. The rel_cop group maintains persistent relationships via a background loop.

Spawn frequency

Set global ambient spawn values (0.0-1.0):

Location-specific spawn frequency

Area-specific spawn density overrides:

Location restrictions

Restrict or allow ped types in volumes (box or sphere):

Model replacements

Replace ped appearances visually in a zone:
Model types must match (e.g., human with human, horse with horse). Model replacements only affect visual appearance, not base behavior.

Advanced configuration

Custom conditions

Define custom conditions as Lua functions directly in the config:

Debug mode

Enable verbose logging for development:

Usage examples

Creating faction conflicts

Time-based behavior

Event zones

Performance considerations

The script is optimized for performance with several key features:
  • Conditional checking: Configurable tick rate via ConditionCheckTimer
  • Volume-based restrictions: Efficient area-based ped control
  • Selective spawning: Location-specific spawn density management
  • Background processing: Persistent relationship maintenance for critical groups

Performance tips

  • Check timer: Increase ConditionCheckTimer for less frequent condition checks
  • Volume optimization: Use appropriate volume sizes for restrictions
  • Spawn limits: Set reasonable spawn frequencies to prevent performance issues
  • Debug mode: Disable debug mode in production for optimal performance

Troubleshooting

Verify group names are correct, check that conditional functions return proper boolean values, and ensure the script is properly started in your server.cfg.
Confirm volume names exist in the game map or are manually created, check coordinate accuracy, and verify spawn frequency values are between 0.0 and 1.0.
Ensure model types match (human with human, animal with animal), verify coordinates and radius are correct, and check that target models exist on your server.
Reduce condition check frequency, limit the number of conditional rules, optimize volume sizes, and disable debug mode in production.
Verify volume names are valid, check coordinate positioning, and ensure the volume is properly defined in the game world or created manually.

Framework integration

The script includes built-in support for multiple frameworks:

Support

If you encounter issues or need assistance:

Discord support

Join our Discord community for support and updates.

Documentation

Docs home - installation basics and links to every script.