Only this pageAll pages
Powered 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...

Contributing

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

Use GitBook

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

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:

Showcase quick access to open documentation in GitBook from NativeDB.

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 this guide. 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!

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.

NativeDB@wiki

Guidelines

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

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.

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.

Explicit

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

For example, the name of the class PreventionSystem 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.

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

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

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

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:

Explain behavior

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

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).

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

  1. Short description (optional).

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

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.

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 . It should be explicit for anyone, and is shorter to write than the player.

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.

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:

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 .

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.

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.

#### 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`).

Example

Explain arguments

Pattern

Example

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.

Avoid code

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.

Game vocabulary

List known data

Optional argument

CDPR only

Conclusion

list of known values
PlayerPuppet
TelemetrySystem
PlayerPuppet
IsMoving

gameObject

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.

Functions

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 example.

gameTimeSystem

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 to 00:01:00.000

Time elapsed in V's storyline.

Real time, as a .

REDengine simulation time.

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

Convert from real-time seconds to game time.

entIComponent

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).

Retrieve entity owner.

redResourceReferenceScriptToken

See for more about ResRef.

Functions

GetEntity() -> whandle:entEntity

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

  • Functions

    GetGameTime() -> GameTime

    GetGameTimeStamp() -> Float

    GetSimTime() -> EngineTime

    IsTimeDilationActive(opt reason: CName) -> Bool

    RealTimeSecondsToGameTime(seconds: Float) -> GameTime

    timestamp epoch

    Description

    wiki of Codeware

    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).

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

    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.

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

    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.

    DO write vehicleBaseObject

    DON'T write VehicleObject

    Add a description

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

    DO write Description

    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:

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

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

    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:

    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.

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

    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.

    Add functions

    DO write Functions

    DON'T write anything else, like Methods

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

    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.

    Minimal example

    end of this guide
    Showcase of a class description in NativeDB.
    Showcase NativeDB feature to copy the signature of a function for GitBook.

    AIVehicleJoinTrafficCommand

    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.

    Description

    Scripting Cyberpunk

    gameFxInstance

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

    Force the effect to stop right away.

    Change position and orientation of this effect in the world.

    Functions

    BreakLoop() -> Void

    Kill() -> Void

    UpdateTransform(transform: WorldTransform) -> Void

    gameDelayID

    Use with [DelaySystem].

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

    Description

    gameFxSystem

    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.

    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].

    Description

    Functions

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

    redscript
    CET

    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*

    gameIStatPoolsListener

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

    Description

    gameDelaySystem

    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]).

    • 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 .

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

    More info and code snippets .

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

    More info and code snippets .

    GLOBALS

    When 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.

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

    See for more about logging.

    See [FTLog] instead.

    gameScriptableSystemRequest

    Allows triggering callbacks on [ScriptableSystem].

    Prefer [DelayCallback] whenever possible.

    More info and code snippets .

    Cancel currently running request.

    gamemappinsMappinSystem

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

    Functions

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

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

    GetRemainingDelayTime(delayID: gameDelayID) -> Float

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

    there
    there
    there

    GetGameInstance() -> ScriptGameInstance

    FTLog(value: script_ref:String) -> Void

    LogChannel() -> Void

    Codeware
    wiki

    Description

    Functions

    Cancel() -> Void

    there

    Description

    Codeware

    ScriptGameInstance

    Description

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

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

    Functions

    GetAchievementSystem(self: ScriptGameInstance) -> handle:gameAchievementSystem

    CDPR only.

    GetDelaySystem(self: ScriptGameInstance) -> handle:gameDelaySystem

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

    GetFxSystem(self: ScriptGameInstance) -> handle:gameFxSystem

    Get system used to spawn particle effects in the world.

    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).

    GetTelemetrySystem(self: ScriptGameInstance) -> handle:gameTelemetryTelemetrySystem

    CDPR only.

    GetTeleportationFacility(self: ScriptGameInstance) -> handle:gameTeleportationFacility

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

    GetTimeSystem(self: ScriptGameInstance) -> handle:gameTimeSystem

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

    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.

    IScriptable

    Functions

    IsA(className: CName) -> Bool

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

    See also Safe downcasting to use a straightforward syntax.

    gameTargetSearchQuery

    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].

    gameTransactionSystem

    Functions

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

    Known currency values: n"money".

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

    Known currency values: n"money".

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

    Known currency values: n"money".

    gameGameAudioSystem

    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 .

    If you need more control over how sounds can be played in-game, you might want to consider .

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

    Emitter name is used with chatters and subtitles.

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

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

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

    inkWidget

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

    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").

    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 ):

    gameStatPoolsSystem

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

    WorldWidgetComponent

    This class is named worlduiWidgetComponent when scripting.

    vehicleVehicleBumpEvent

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

    Functions

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

    Description

    Description

    Description

    Functions

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

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

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

    VoIsPerceptible(entityId: entEntityID) -> Bool

    SoundDB
    REDmod
    audio parameters
    Audioware
    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

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

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

    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 Discord.

    You can find other styles using WolvenKit.

    Description

    Functions

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

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

    wiki
    RedHotTools
    full list

    SetStyle(styleResPath: redResourceReferenceScriptToken) -> Void

    redEvent

    Description

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

    • combat

    • traffic

    • ...

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

    More info and code snippets there.

    If you're looking to dispatch events outside of game sessions, see for custom events.

    entEntity

    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.

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

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

    Mark entity for disposal.

    Retrieve any component on entity by name.

    Retrieve currently applied .

    Enqueue event for entity on game's events loop.

    Description

    EngineTime

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

    Description

    Functions

    CanServiceEvent(evtName: CName) -> Bool

    Dispose() -> Void

    FindComponentByName(componentName: CName) -> handle:entIComponent

    GetCurrentAppearanceName() -> CName

    QueueEvent(evt: handle:redEvent) -> Void

    appearance

    gameDelaySystemScriptedDelayCallbackWrapper

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

    If you're looking to trigger callbacks outside of game sessions, see for custom events.

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

    Description

    Functions

    Call() -> Void

    wiki of Codeware

    gamemountingMountingRelationship

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

    Description

    gameBlackboardSystem

    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 .

    Description

    Functions

    StackExchange
    See this guide

    inkScriptHashMap

    Update value 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.

    vehicleBaseObject

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

    Functions

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

    Functions

    GetCurrentSpeed() -> Float

    script car_hud

    inkTextWidget

    Functions

    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

    • 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

    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

    ,
    Book
    ,
    Book Italic
    .

    SetFontStyle(fontStyle: CName) -> Void

    gameScriptableSystem

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

    See Codeware if you need to add logic outside of game sessions.

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

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

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

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

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

    Description

    Functions

    WasRestored() -> Bool

    IsSavingLocked() -> Bool

    OnAttach() -> Void

    OnDetach() -> Void

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

    ScriptableService

    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 channel.

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

    NativeDB@wiki

    NPCPuppet

    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.

    • 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.

    Description

    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

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

    Paragraph

    ๐ŸŸขโ€‹โ€‹

    Some text

    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.

    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.

    Example

    # 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.