arrow-left

Only this pageAll pages
gitbookPowered by GitBook
1 of 40

NativeDB · Documentation

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

CLASSES

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Home

Space to store and share documentation of RTTI definitions.

This space stores documentation and is used to show it when browsing RTTI dump using NativeDB.

If you have an issue or feedback to share, come and talk about it on NativeDB@wikiarrow-up-right channel.

If you want to contribute, please go to the next guide:

Contributing

This guide will give you a tour of everything you need to know to document the codebase of NativeDB.

hashtag
Use GitBook

This space is used to write and store documentation. It will synchronize the data in a GitHub repositoryarrow-up-right. NativeDB get the documentation from this repository to show it when browsing the codebase.

circle-info

GitHub Api limits free access to 60 requests per hour. It doesn't require you to login with a GitHub account from NativeDB. It should be good enough for now.

If you never used GitBook before, you'll see that it is easy to use after learning some basics. to find your way around.

NativeDB provides buttons to quickly open GitBook in the right place:

hashtag
NativeDB and GitBook

NativeDB expects a custom format and structure to get the data from GitBook, and to show it as beautifully as possible. You first need to learn a few rules, you can start with . It will also explain some guidelines on what to write or not when documenting.

Now that you made a change request, wrote some documentation, you can request a review. An administrator will check it, and if it is alright, merge your change request.

NativeDB will store the documentation in your browser as a cache. It helps improve performance and it reduces the usage of the network's bandwidth. It will only refresh the list of documented classes every 10 minutes (to see if there are changes to update locally). If NativeDB is already open, it will not show your last merged change request. You can wait up to 10 minutes or hit F5 to refresh your tab.

Thank you for your contributions!

circle-info

If you get lost, If you think a guide lack information, If you think a guide is not clear enough, If you have any other feedback to share,

Please do reach us on Discord in the channel.

this guide
NativeDB@wikiarrow-up-right
Showcase quick access to open documentation in GitBook from NativeDB.

AIVehicleJoinTrafficCommand

hashtag
Description

Cause the vehicle to join traffic and be immune to bumping. Useful in scripted scenes to prevent unexpected outcomes.

Use [vehicleJoinTrafficVehicleEvent] instead if you want the vehicle to behave like normal traffic.

gameDelaySystemScriptedDelayCallbackWrapper

hashtag
Description

Allows creating custom callbacks to use in-game with [DelaySystem].

If you're looking to trigger callbacks outside of game sessions, see wiki of Codewarearrow-up-right for custom events.

hashtag
Functions

hashtag
Call() -> Void

Method which gets automatically called after delay, see [DelayCallback] and [DelaySystem.DelayCallbackNextFrame].

gameScriptableSystem

hashtag
Description

Only available in-game, and re-created on each load.

See Codeware ScriptableServicearrow-up-right if you need to add logic outside of game sessions.

hashtag
Functions

hashtag
WasRestored() -> Bool

Whether session was restored (e.g. on save load), or not (e.g. on new game).

hashtag
IsSavingLocked() -> Bool

Whether saving is currently disabled or not (e.g. during combat).

hashtag
OnAttach() -> Void

Automatically called when attached to game session (e.g. on save load).

hashtag
OnDetach() -> Void

Automatically called when detached from game session (e.g. on exit to main menu).

hashtag
OnRestored(saveVersion: Int32, gameVersion: Int32) -> Void

Automatically called when restoring game session (e.g. on save load).

gamemountingMountingRelationship

hashtag
Description

  • [this.otherObject] is not imported in script-side. You must use [IMountingFacility.RelationshipGetOtherObject] to get this property.

gameTimeSystem

hashtag
Description

Use with everything time-based:

  • real time

  • time in V's storyline

  • REDengine simulation time

  • time dilation (e.g. when activating Sandevistan)

You can convert real-time to/from game-time with the table below (or use [this.RealTimeSecondsToGameTime]):

  • GameTime to RealTime

  • 24:00:00.000 to 03:00:00.000

  • 00:08:00.000

hashtag
Functions

hashtag
GetGameTime() -> GameTime

Time elapsed in V's storyline.

hashtag
GetGameTimeStamp() -> Float

Real time, as a .

hashtag
GetSimTime() -> EngineTime

REDengine simulation time.

hashtag
IsTimeDilationActive(opt reason: CName) -> Bool

Whether V or NPCs are currently using time dilation (usually via cyberware, e.g. Sandevistan).

hashtag
RealTimeSecondsToGameTime(seconds: Float) -> GameTime

Convert from real-time seconds to game time.

gameDelaySystem

hashtag
Description

Allows to schedule callbacks, events or system requests in various ways. Time / delay is expressed in seconds.

  • callback is triggered only once, but nothing prevents from rescheduling it manually at your convenience.

  • callback will not get triggered when set over a certain delay (like 1 or 3 minutes), but nothing prevents from rescheduling while keeping track of how long has elapsed, with a timestamp (see [TimeSystem]).

  • [DelayID] can be kept around to interrupt a running callback, event or tick anytime (see [this.CancelDelay], [this.CancelEvent] and [this.CancelTick]). You can also check how long remains before being eventually called (see [this.GetRemainingDelayTime]).

hashtag
Functions

hashtag
DelayCallback(delayCallback: handle:gameDelaySystemScriptedDelayCallbackWrapper, timeToDelay: Float, opt isAffectedByTimeDilation: Bool) -> gameDelayID

  • timeToDelay : delay duration in seconds.

  • isAffectedByTimeDilation: whether callback will be slowed down based on current active time dilation (e.g. when time slows during Sandevistan).

More info and code snippets .

hashtag
DelayEvent(entity: whandle:entEntity, eventToDelay: handle:redEvent, timeToDelay: Float, opt isAffectedByTimeDilation: Bool) -> gameDelayID

Supports any class inheriting from [Event], including custom ones.

More info and code snippets .

hashtag
GetRemainingDelayTime(delayID: gameDelayID) -> Float

How long remains before associated callback, event or tick gets called.

hashtag
TickOnEvent(entity: whandle:entEntity, eventToTick: handle:gameTickableEvent, duration: Float) -> gameDelayID

More info and code snippets .

GLOBALS

hashtag
GetGameInstance() -> ScriptGameInstance

When Codewarearrow-up-right is installed, you can use this function without issues. Otherwise, you may need to get [GameInstance] through other functions like [GameObject.GetGame] for example.

This function will only work when the game engine is initialized, meaning a [GameInstance] do exists.

hashtag
FTLog(value: script_ref:String) -> Void

Use this function to write in logs, along with [FTLogWarning] and [FTLogError].

See for more about logging.

hashtag
LogChannel() -> Void

See [FTLog] instead.

gameScriptableSystemRequest

hashtag
Description

Allows triggering callbacks on [ScriptableSystem].

Prefer [DelayCallback] whenever possible.

More info and code snippets .

to
00:01:00.000
  • 00:01:00.000 to 00:00:07.500

  • timestamp epocharrow-up-right
    therearrow-up-right
    therearrow-up-right
    therearrow-up-right
    wikiarrow-up-right
    hashtag
    Functions

    hashtag
    Cancel() -> Void

    Cancel currently running request.

    therearrow-up-right

    EngineTime

    hashtag
    Description

    Time is in seconds when converted to a [Float].

    ScriptGameInstance

    hashtag
    Description

    Main entry-point to get systems for gameplay / environment / etc.

    See the global function [GetGameInstance] which explains how to get a `GameInstance`.

    hashtag
    Functions

    hashtag
    GetAchievementSystem(self: ScriptGameInstance) -> handle:gameAchievementSystem

    CDPR only.

    hashtag
    GetDelaySystem(self: ScriptGameInstance) -> handle:gameDelaySystem

    Get system used to execute callback functions after a delay. It runs functions asynchronously in game loop.

    hashtag
    GetFxSystem(self: ScriptGameInstance) -> handle:gameFxSystem

    Get system used to spawn particle effects in the world.

    hashtag
    GetSimTime(self: ScriptGameInstance) -> EngineTime

    Get elapsed time since the simulation started. Time is reset when navigating between menu and in-game scenes. Time is paused when game is paused (e.g. inventory menu is open).

    hashtag
    GetTelemetrySystem(self: ScriptGameInstance) -> handle:gameTelemetryTelemetrySystem

    CDPR only.

    hashtag
    GetTeleportationFacility(self: ScriptGameInstance) -> handle:gameTeleportationFacility

    Get system used to teleport a [GameObject] to [Vector4] coordinates or to a [NodeRef].

    hashtag
    GetTimeSystem(self: ScriptGameInstance) -> handle:gameTimeSystem

    Get system used to change game time, including time dilation.

    hashtag
    GetVehicleSystem(self: ScriptGameInstance) -> handle:gameVehicleSystem

    Get system used to summon vehicles and unlock vehicles in V's garage.

    See also [VehicleObject], [VehicleComponent] and [vehicleController] to access more vehicle behaviours.

    gameFxInstance

    hashtag
    Functions

    hashtag
    BreakLoop() -> Void

    Stops emitting new particles. This is a smooth way to stop your effect's animation.

    hashtag
    Kill() -> Void

    Force the effect to stop right away.

    hashtag
    UpdateTransform(transform: WorldTransform) -> Void

    Change position and orientation of this effect in the world.

    gameBlackboardSystem

    hashtag
    Description

    Blackboard is a kind of shared data storage and a framework to access/notify/listen to the data in the storage. Similar to a real blackboard, [GameObject]s put their data on the board ([IBlackboard]). Other objects can observe, react to and update the data.

    Blackboard uses a key-value pattern to store data. Keys are defined through a [BlackboardDefinition]. You can know what keys (ids) a [IBlackboard] is using with its corresponding [BlackboardDefinition]. A list of known definitions can be found in [AllBlackboardDefinitions].

    See also this post on StackExchangearrow-up-right.

    hashtag
    Functions

    gameStatPoolsSystem

    hashtag
    Functions

    hashtag
    RequestRegisteringListener(objID: gameStatsObjectID, statPoolType: gamedataStatPoolType, listener: handle:gameIStatPoolsListener) -> Void

    You can make your own listener by creating a class inheriting [ScriptStatPoolsListener]. You can use [this.RequestUnregisteringListener] when you need to remove your listener.

    entIComponent

    hashtag
    Description

    Components in the game define the functionality of various objects and NPCs, such as physics, animations, interactions, and more. IComponent serves as a base class for all the specific components that can be attached to entities.

    • Modularity: components can be thought of as modules that add specific functionality to an entity. For example, you could add a physics component to give an object physical interactions with the environment or an AI component to allow an NPC to make decisions.

    • Reuse: since components are reusable, you can apply the same component to different entities. This makes it easier to add consistent behavior across various objects or NPCs.

    • Separation of Concerns: each component is responsible for handling a specific aspect of an entity. This makes it easier to focus on one feature at a time (such as movement, interaction, or combat behavior).

    hashtag
    Functions

    hashtag
    GetEntity() -> whandle:entEntity

    Retrieve entity owner.

    Contributors

    We welcome contributions, even tiny one, by anyone who wants to share knowledge with NativeDB.

    You can leave a trace of your passage by adding your username below (Discord, Nexus or GitHub).

    In alphabetical order, many thanks to:

    • manavortex

    • psiberx

    • Rayshader

    • rfuzzo

    • RollermineC

    • roms1383

    • Seijax

    • void*

    gamemappinsMappinSystem

    hashtag
    Description

    You can get a list of [IMappin], see the function provided by Codewarearrow-up-right.

    gameTargetSearchQuery

    hashtag
    Description

    Used by functions of [TargetingSystem], to specify the parameters for searches of targets.

    • [this.testedSet] decides the shape of the area of the search (in the limits of [this.maxDistance]). [TargetingSet.Frustum] covers the whole cone of vision of the instigator. [TargetingSet.Visible] and [TargetingSet.ClearlyVisible] additionally require differing degrees of line-of-sight. [TargetingSet.Complete] covers a sphere around the instigator.

    • [this.searchFilter] identifies the nature of the objects that will qualify for the search. See REDmod script resources for examples of currently used filters, like [TSF_NPC].

    gameIStatPoolsListener

    hashtag
    Description

    DON'T directly inherit this class to create your own listener. Game will crash to desktop if you try. You must use [ScriptStatPoolsListener] instead.

    vehicleVehicleBumpEvent

    hashtag
    Description

    Event is only triggered when a vehicle collides with another vehicle.

    entEntity

    hashtag
    Description

    An Entity is essentially a "thing" in the game world. This can be a player character, NPC, vehicle, or an object like a weapon or a door. Each entity has specific attributes, like health, position, and abilities, that define how it behaves and interacts with the environment.

    • Components: these are smaller parts that make up an entity, such as physics, animations, and behaviors. Components are what give an entity its abilities, like moving, interacting, or taking damage.

    • Properties: these are data fields that define things like health, speed, size, or position in the world.

    • Events: entities can send and receive events to trigger actions. For instance, an NPC can trigger an event when it detects the player.

    hashtag
    Functions

    hashtag
    CanServiceEvent(evtName: CName) -> Bool

    Whether [this.QueueEvent] is currently available or not.

    hashtag
    Dispose() -> Void

    Mark entity for disposal.

    hashtag
    FindComponentByName(componentName: CName) -> handle:entIComponent

    Retrieve any component on entity by name.

    hashtag
    GetCurrentAppearanceName() -> CName

    Retrieve currently applied .

    hashtag
    QueueEvent(evt: handle:redEvent) -> Void

    Enqueue event for entity on game's events loop.

    gameFxSystem

    hashtag
    Description

    This system allows you to spawn (particle) effects in the world. It should be able to spawn any [FxResource]. You can find a list of effects with WolvenKit in the AssetBrowser by filtering files with .effect extension.

    hashtag
    Functions

    hashtag
    SpawnEffect(resource: gameFxResource, transform: WorldTransform, opt ignoreTimeDilation: Bool) -> handle:gameFxInstance

    Create a new effect at transform position in the world, based on a resource (your effect). You need to keep a reference of the returned [FxInstance] to later control and stop your effect.

    See these snippets of code for and for to create a [FxResource].

    Guidelines

    This guide describes how documentation should be written. It also explains what should be documented or not, and why.

    hashtag
    Introduction

    The goal of this documentation is to share acquired knowledge about the codebase. It is not useful to document every single class and functions of this entire codebase.

    circle-check

    Structure

    This guide explains the structure to follow when writing documentation for NativeDB.

    One sub-page = one class

    One sub-page = one struct

    Sub-page of a class or a struct must be within page "CLASSES".

    Order sub-pages alphabetically (from A to Z).

    circle-info

    It is useful to quickly navigate between classes and to add new classes.

    IScriptable

    hashtag
    Functions

    hashtag
    IsA(className: CName) -> Bool

    className

    NPCPuppet

    hashtag
    Description

    Represents non-player characters (NPCs) in the game.

    These are the characters that the player interacts with but doesn't directly control, such as enemies, civilians, vendors, and allies.

    vehicleBaseObject

    hashtag
    Functions

    hashtag
    GetCurrentSpeed() -> Float

    Value is meaningless as-is. You can convert the value to KPH or MPH by using the code from

    inkScriptHashMap

    hashtag
    Functions

    hashtag
    Set(key: Uint64, value: handle:IScriptable) -> Void

    Update value

    redEvent

    hashtag
    Description

    Dispatched throughout game session to trigger gameplay logic, for various purposes:

    • combat

    redResourceReferenceScriptToken

    hashtag
    Description

    See for more about ResRef.

    gameObject

    hashtag
    Description

    A GameObject is any in-game item or structure that the player or NPCs can interact with. This includes things like weapons, doors, vending machines, lootable containers, and even some environmental elements.

    hashtag

    gameTransactionSystem

    hashtag
    Functions

    hashtag
    GiveMoney(target: handle:gameObject, amount: Int32, currency: CName) -> Bool

    must be the native name (Pseudocode). For example, you must use
    n"entEntity"
    instead of
    n"Entity"
    .

    See also Safe downcastingarrow-up-right to use a straightforward syntax.

    AI Behaviors: contains the logic for how NPCs think and act. This includes things like combat AI (how an enemy attacks, seeks cover, or flees), daily routines (what civilians do during the day), and response behaviors (like reacting to gunfire or the player's presence).
  • Factions: NPCs can belong to factions (e.g., gangs or corporate groups), and this affects how they interact with other factions and the player. You can adjust faction relationships, which influences whether NPCs are hostile, friendly, or neutral.

  • of entry at
    key
    , when an entry already exists. You must use [this.Insert] instead, when you want to add an entry for the first time.

    traffic

  • ...

  • Event can be dispatched in-game on instances of class inheriting from [Entity].

    More info and code snippets therearrow-up-right.

    If you're looking to dispatch events outside of game sessions, see wiki of Codewarearrow-up-right for custom events.

    Functions

    hashtag
    RegisterInputListener(listener: handle:IScriptable, opt name: CName) -> Void

    name (of action) is allowed but using known object (e.g. [PlayerPuppet]) as listener is a source of potential issues. Mods should always declare and use a custom listener object, like in this examplearrow-up-right.

    Known currency values:
    n"money"
    .

    hashtag
    RemoveMoney(obj: handle:gameObject, amount: Int32, currency: CName) -> Bool

    Known currency values: n"money".

    hashtag
    TransferMoney(source: handle:gameObject, target: handle:gameObject, amount: Int32, currency: CName) -> Bool

    Known currency values: n"money".

    appearancearrow-up-right
    redscriptarrow-up-right
    CETarrow-up-right
    wiki of Codewarearrow-up-right
    .
    script car_hudarrow-up-right

    gameDelayID

    hashtag
    Description

    Use with [DelaySystem].

    When undefined, a DelayID is equal to [GetInvalidDelayID].

    WorldWidgetComponent

    hashtag
    Description

    This class is named worlduiWidgetComponent when scripting.

    Guidelines below are not hard rules that you must absolutely and always follow. The purpose is to give you (and contributors) a common ground to start from.

    hashtag
    Explicit

    One big rule is to add documentation when a class / a function is not explicit.

    For example, the name of the class PreventionSystemarrow-up-right is not clear for someone who only played the game. In this case it is useful to add a sentence describing that Prevention means NCPD / the police.

    circle-check

    DO add documentation to describe a behavior that is not already explicit.

    triangle-exclamation

    DON'T add documentation about a class like PlayerPuppetarrow-up-right, only to say "Class of the player".

    triangle-exclamation

    DON'T add documentation about a function like IsMovingarrow-up-right, only to say "Return true when player is moving, false otherwise".

    hashtag
    Keep it short

    One phrase, one idea.

    Reading is hard, keep it as short as possible. Below are patterns you can reuse to structure your comment:

    hashtag
    Explain behavior

    When a general description is somehow required and useful to provide context.

    hashtag
    Pattern

    1. Short description (up to 3 phrases).

    2. Elaborate description (optional, when short description is not enough to fit knowledge).

    3. Provide related resources / references (optional, when related and newcomers are not aware of it).

    hashtag
    Example

    hashtag
    Explain arguments

    When behavior is already explicit, but an argument requires a description and more information like a default value, list of known values, etc.

    hashtag
    Pattern

    1. Short description (optional).

    2. Argument with description and optionally the default value / a list of known values.

    hashtag
    Example

    circle-info

    Patterns above are propositions. It is easier as a reader to see and read documentation when it uses the same format everywhere. It might take a bit of an effort to get used to it as a writer.

    hashtag
    Avoid code

    This documentation is not about showing how to use a snippet of code: be it in Redscript, Lua or else. In this spirit, writing code in the documentation should be avoided. If it is deemed really useful, it should be as short as possible.

    circle-check

    is already present to share knowledge about the code and scripting in general. You should share your findings in this space, not in this documentation.

    hashtag
    Game vocabulary

    More than often, people played the game and knows about the vocabulary it uses. It is preferable to use game's vocabulary to be on the same page.

    For example, it is preferred to tell Prevention is about NCPD. This way, when you document other parts of the game related to Prevention, you can use the keyword NCPD. Others will understand what you're talking about.

    As another example, you can write V when talking about the PlayerPuppetarrow-up-right. It should be explicit for anyone, and is shorter to write than the player.

    hashtag
    List known data

    A function might need some kind of predefined data as arguments. Think about the CName type, it is a string-like type but values are not listed like enums. We don't know about them. In this case, a modder will have to dig and search what values the function accepts as a CName.

    If you know all or even only one valid value, you should list them when documenting the function. This way, others know what data to use when they need to call this function too.

    If the list of values is very big, use a link instead to reference some Sheet-like document containing all known values.

    If the list of values is accessible using WolvenKit, add a note about it and provide the path where to look for the data.

    hashtag
    Optional argument

    An argument of a function is optional when marked with the opt prefix. It can be helpful to describe what default value is used. It can look like this:

    hashtag
    CDPR only

    In the codebase, you can find features that are not related to the gameplay, saves, the world, etc. For example, you should not care nor mess around with the TelemetrySystemarrow-up-right.

    In this case, you can add the comment "CDPR only". It is short and explicit enough to tell other modders:

    There is nothing to see for modding purpose.

    hashtag
    Conclusion

    After reading this, you should better grasp what you can document and how. Don't hesitate to go through the current documentation. It can be helpful to see how other parts are already documented, to get more familiar with these guidelines.

    hashtag
    Class / Struct

    You have to follow a small set of rules to write documentation about a class. The format described below is required to show the documentation in NativeDB.

    circle-info

    A minimal example shows you how it should look like with Markdown, at the end of this guide.

    hashtag
    Setup page

    Option "Page description" must be turned off in "Page options". You can find the feature when moving your mouse over the title of the page.

    Title of the page must be the native name of the class. You can configure code syntax in NativeDB with option Pseudocode · Legacy to only show native names.

    circle-check

    DO write vehicleBaseObject

    triangle-exclamation

    DON'T write VehicleObject

    hashtag
    Add a description

    Add header "Description" using block "Heading 1".

    circle-check

    DO write Description

    triangle-exclamation

    DON'T write anything else, like descriptionS

    After this header, you can add content (like a paragraph) to describe useful knowledge about the class. It will be visible like this in NativeDB:

    Showcase of a class description in NativeDB.

    hashtag
    Add functions

    Add header "Functions" using block "Heading 1", if it doesn't exist already. You can then add functions after this header, as described below.

    circle-check

    DO write Functions

    triangle-exclamation

    DON'T write anything else, like Methods

    Add a function using block "Heading 3". This header must be the signature of the function using the Pseudocode · Legacy code syntax.

    circle-exclamation

    If the signature of the function is not valid, your change request will not be merged.

    You should use the feature provided by NativeDB to quickly copy the signature of a function in your clipboard. You can do so like this:

    Showcase NativeDB feature to copy the signature of a function for GitBook.

    As an example with the function FindEntityById, it will look like this in your clipboard, ready to paste in GitBook:

    Like with the description, you can then add content below the header of the function to describe it.

    circle-info

    You don't have to write both sections (Description and Functions) when creating a new class. You need to at least add one of the two sections, be it Description or Functions.

    When present, the section Description must be at the very top of the page.

    hashtag
    Minimal example

    You're ready to go on with the next guide:

    inkTextWidget

    hashtag
    Functions

    hashtag
    SetFontFamily(fontFamilyPath: String, opt fontStyle: CName) -> Void

    Known relative paths for fontFamilyPath, in root path base\gameplay\gui\fonts\:

    • foreign\chinese_traditional\ar_fang_xing_run_yuan\ar_fang_xing_run_yuan.inkfontfamily

    • foreign\arabic\ara_es_nawar\ara_es_nawar.inkfontfamily

    • arame\arame.inkfontfamily

    hashtag
    SetFontStyle(fontStyle: CName) -> Void

    This call is not enough to redraw the widget with the new font style. You can trigger a redraw by calling another function too, for example using [this.SetText] or [this.SetFontSize] with the same current value.

    fontStyle values are unique per font family, you can find them in .inkfontfamily files using WolvenKit. List of known values: Regular, Light, Medium, Heavy, Semi-Bold, Bold, Extra Bold, Italic, Bold Italic, Black, Demi,

    gameGameAudioSystem

    hashtag
    Description

    Responsible for managing all audio-related functionality within the game. This system controls everything from background music and sound effects to character dialogue and environmental sounds.

    Game sounds can be browsed and listened to on .

    Sounds can be replaced with , with predefined .

    #### GetVehicleSystem(self: ScriptGameInstance) -> handle:gameVehicleSystem
    
    Get system used to summon vehicles and unlock vehicles in V's garage.
    
    See also [VehicleObject], [VehicleComponent] and [vehicleController] to access more 
    vehicle behaviours.
    #### Lerp(a: Vector3, b: Vector3, t: Float) -> Vector3
    
    Linearly compute an intermidiate position between `a` and `b`.
    
    `t` is a factor with values between `0.0` and `1.0`:
    - when `t = 0.0` it returns `a`
    - when `t = 0.5` it returns `(b - a) * 0.5 + a`
    - when `t = 1.0` it returns `b`
    `nameOfArgument` optional description of argument (default is `value`).
    FindEntityByID(self: ScriptGameInstance, entityId: entEntityID) -> handle:entEntity
    # gameweaponObject
    
    ## Description
    
    Tell me what is not explicit about this object. It should be relevant information.
    You can omit this section when you have nothing to say here.
    
    ## Functions
    
    #### CanReload(self: handle:gameweaponObject) -> Bool
    
    This is an example of what you should NOT write documentation for. The signature
    of the function and the name are already explicit about what this function does.
    
    #### GetAttack(recordName: CName) -> handle:gameIAttack
    
    You can append functions one after the other, preferably in alphabetical order. In 
    this case, it could be useful to list known values used by the argument `recordName`.
    Or reference a place where the list is already available (maybe using WolvenKit) 
    for example. If in WKit, you can indicate the path where to look for the data.
    arial\arial.inkfontfamily
  • blender\blender.inkfontfamily

  • digital_readout\digitalreadout.inkfontfamily

  • industry\industry.inkfontfamily

  • foreign\chinese_traditional\jing_xi_heig_b5\jing_xi_heig_b5.inkfontfamily

  • foreign\chinese\jing_xi_heig\jing_xi_heig.inkfontfamily

  • foreign\korean\kbiz_go\kbiz_go.inkfontfamily

  • foreign\japanese\mgenplus\mgenplus.inkfontfamily

  • foreign\korean\nanum_square\nanum_square.inkfontfamily

  • orbitron\orbitron.inkfontfamily

  • foreign\thai\printable4u\printable4u.inkfontfamily

  • foreign\russian\raj_rus.inkfontfamily

  • raj\raj.inkfontfamily

  • foreign\japanese\smart_font_ui\smart_font_ui.inkfontfamily

  • foreign\thai\th_sarabun_new\th_sarabun_new.inkfontfamily

  • Book
    ,
    Book Italic
    .
    If you need more control over how sounds can be played in-game, you might want to consider Audiowarearrow-up-right.

    hashtag
    Functions

    hashtag
    Play(eventName: CName, opt entityID: entEntityID, opt emitterName: CName) -> Void

    Play a sound by its event name, optionally specifying an entity as emitter with its name.

    Emitter name is used with chatters and subtitles.

    hashtag
    Stop(eventName: CName, opt entityID: entEntityID, opt emitterName: CName) -> Void

    Stop a previously played sound, optionally defined on an entity with specific name.

    hashtag
    Switch(switchName: CName, switchValue: CName, opt entityID: entEntityID, opt emitterName: CName) -> Void

    Switch from one sound to another, optionally specifying an entity as emitter with its name.

    hashtag
    VoIsPerceptible(entityId: entEntityID) -> Bool

    Whether entity's voice (a.k.a voiceover) can be heard from where player stands.

    SoundDBarrow-up-right
    REDmodarrow-up-right
    audio parametersarrow-up-right

    Format and syntax

    This guide explains what syntax you can use to format the documentation for NativeDB.

    🟢 fully supported

    🟠 partially supported

    🔴 not supported

    Blocks
    Markdown
    Description

    Paragraph

    🟢​​

    Some text

    circle-info

    Don't hesitate to look at other classes to see how the syntax is used, and how it looks like in NativeDB. If you are not sure, you can always come and ask on Discord.

    hashtag
    Example

    The following example is only made to show all possible syntax options. There is nothing related to the game:

    Basic block to show text.

    Code

    🟢​​

    `content`

    Useful to highlight arguments of a function. Note: it doesn't support complex code block with a language (like ```lua ```).

    URL

    🟢

    [label](https://)

    You can add URL link with a label. URL must starts with https://.

    Lists

    🟠​

    • - Item A

    • - Item B

    1. 1. Item 1

    2. 2. Item 2

    You can add ordered lists, unordered lists and tasks lists. In all cases, they will be visible as unordered lists using - as a prefix.

    Note: you must not add newlines per item. It is not supported for now and formatting will not work as expected in NativeDB.

    Markdown example will look like this: - Item A - Item B - Item 1 - Item 2 - Item T - Item D

    Bold / Italic

    🔴​

    **bold**

    *italic*

    Headers

    🔴

    # H1 ## H2 ### H3

    Hint

    🔴

    {% hint %} {% endhint %}

    Class reference

    🟢

    [ClassName]

    Write the native name / alias name of a class between brackets ([]). NativeDB will automatically format it as a link to navigate to the class.

    Property reference

    🟢

    [this.prop] [ClassName.prop]

    When documenting a class, you can reference its own properties using this. followed by the name of the property.

    You can also reference properties of other classes using ClassName. instead of this..

    It must be surrounded by brackets ([]) in both cases.

    Function reference

    🟢

    [this.GetStuff] [ClassName.SetStuff]

    When documenting a class, you can reference its own functions using this. followed by the name of the function. You can also reference functions of other classes using ClassName. instead of this.. It must be surrounded by brackets ([]) in both cases.

    Enum / Bitfield reference

    🟢

    [Enum.Value] [Bitfield.Value]

    You can reference value of an enum and value of a bitfield.

    # FigTree
    
    ## Description
    
    It is made of branches and leaves. A [FigBranch] can spawn up to 5 other branches. 
    It can also grow [FigFruit], up to 16 on a single branch.
    
    See also [Wikipedia](https://en.wikipedia.org/wiki/Fig).
    
    ## Functions
    
    #### GetAge() -> Uint32
    
    UTC timestamp in seconds.
    
    Same as [this.age].
    
    #### GrowFruits(opt probability: Float) -> array:handle:FigFruit
    
    `probability` can be between 0.0 and 1.0 (default is 0.5):
    - 0.0 grows zero fruits.
    - 1.0 grows fruits on all branches based on their capacity.
    Scripting Cyberpunk

    inkWidget

    hashtag
    Description

    See wikiarrow-up-right of Codeware to learn more about creating a UI. You should install RedHotToolsarrow-up-right too. It provides a powerful InkInspector tool to help you design a UI while in-game.

    hashtag
    Functions

    hashtag
    BindProperty(propertyName: CName, stylePath: CName) -> Bool

    Bind a style to a property of a widget, based on the current theme of the game. You must define a style resource using [this.SetStyle], otherwise this function will have no effect.

    Example to use the red color of the game on a widget: BindProperty(n"tintColor", n"MainColors.Red").

    hashtag
    RegisterToCallback(eventName: CName, object: handle:IScriptable, functionName: CName) -> Void

    You need to setup your widget to listen for events and trigger callbacks. You can do so using [this.SetInteractive] on the widget.

    You can listen to the following common events (see also the ):

    • n"OnEnter": when cursor enters the widget (hover in)

    • n"OnLeave": when cursor leaves the widget (hover out)

    • n"OnPress": when mouse left button is pressed inside the widget

    You must declare your callback method with cb qualifier, and with one argument of type ref<[inkPointerEvent]>.

    hashtag
    SetStyle(styleResPath: redResourceReferenceScriptToken) -> Void

    You must define an .inkstyle file to use [this.BindProperty]. When you add a widget with a script, this call is required on each widget you create.

    A common styleResPath used to define colors is: r"base\\gameplay\\gui\\common\\main_colors.inkstyle". You can see a Json representation of this file on .

    You can find other styles using WolvenKit.

    n"OnRelease": when mouse left button is released inside the widget

    full listarrow-up-right
    Discordarrow-up-right
    See this guide