Redscript
HomeGitHubDiscord
  • Home
  • Getting Started
    • Downloads
    • Setup for VSCode
    • Setup for JetBrains IDEs
    • How to start REDscripting
      • Step 1: Mod structure
      • Step 2: Finding the right class
  • Language
    • Intro
      • REDscript in 2 minutes
      • How to create a hook
        • Things to hook
    • Language Features
      • Intrinsics
      • Loops
      • Strings
      • Modules
      • Annotations
      • Conditional compilation
      • Configurable user hints
    • Built-in Types
    • Built-in Functions
      • Math
      • Random
      • Utilities
  • References and examples
    • Common Patterns
      • Safe downcasting
      • Class constructors
      • Hash maps
      • Heterogeneous array literals
      • Scriptable systems (singletons)
      • DelaySystem and DelayCallback
      • Generic callbacks
      • Persistence
    • Logging
    • UI Scripting
      • Logging Widget Trees
      • Popups
    • Vehicle system
    • Weapons
    • Codeware callbacks
      • Scriptables comparison
    • Libraries
    • Gameplay
      • Sleeping and Skipping Time
  • Help
    • Community
    • Troubleshooting
Powered by GitBook
On this page
  1. References and examples
  2. Codeware callbacks

Scriptables comparison

What is ScriptableSystem vs. ScriptableService?

PreviousCodeware callbacksNextLibraries

Last updated 1 year ago

Was this helpful?

CtrlK
  • RedScript's ScriptableSystem
  • Codeware's ScriptableService

Was this helpful?

RedScript's ScriptableSystem

Class in base RedScript.

  • Is bound to the game session (save)

    • Is created (attached) when loading a save

    • Is destroyed (detached) when unloading a save

  • Can store things in a save

    • persistent properties will be saved in game's save file and value can differ between saves

Example and documentation: Scriptable systems (singletons)

Codeware's ScriptableService

Class added by Codeware (Cannot be used without Codeware).

  • Independent of saves

    • Is created when starting the game

    • Is destroyed when quitting the game

  • Always runs with the game

  • Can store things globally for all saves

    • persistent properties will be saved globally and will be same between saves

  • Usually used for patching/modifying resources

Example and documentation: https://github.com/psiberx/cp2077-codeware/wiki#lifecycle

Previously was named ScriptableEnv. Kept for backwards compatibility, do not use that name in new code.