rollnw.kernel

class rollnw.kernel.Config

Configuration service

initialize(options: ConfigOptions)

Initialize config system

install_path() str

Gets game install path

options() ConfigOptions

Gets config options

set_paths(install: str, user: str)

Sets game paths

Note: Must be called before initialize

set_version(version: GameVersion)

Sets game paths

Note: Must be called before initialize

user_path() str

Gets game install path

class rollnw.kernel.ConfigOptions

Configuration options

include_install: bool = True

If true, load base game data.

include_nwsync: bool = True

If true, load NWSync data.

include_user: bool = True

If true, load user data.

class rollnw.kernel.EffectSystem
add_effect(type, apply, remove)

Adds an effect type to the registry

add_itemprop(type, generator)

Adds an item property type to the registry

apply(obj: ObjectBase, effect: Effect) bool

Applies an effect to an object

create(type) Effect

Creates an effect

destroy(effect: Effect) None

Destroys an effect

effect_limits_ability() Tuple[int, int]

Gets ability effect minimum and maximum

effect_limits_armor_class() Tuple[int, int]

Gets armor class effect minimum and maximum

effect_limits_attack() Tuple[int, int]

Gets attack effect minimum and maximum

effect_limits_skill() Tuple[int, int]

Gets skill effect minimum and maximum

ip_cost_table(table: int) TwoDA | None

Gets an item property cost table

ip_definition(type)

Gets an item property definition

ip_param_table(table: int) TwoDA | None

Gets an item property param table

remove(obj: ObjectBase, effect: Effect) bool

Removes an effect to an object

set_effect_limits_ability(min: int, max: int) None

Sets ability effect minimum and maximum

set_effect_limits_armor_class(min: int, max: int) None

Sets armor class effect minimum and maximum

set_effect_limits_attack(min: int, max: int) None

Sets attack effect minimum and maximum

set_effect_limits_skill(min: int, max: int) None

Sets skill effect minimum and maximum

stats() EffectSystemStats

Gets stats regarding the effect system

class rollnw.kernel.EffectSystemStats

Effect system stat data

free_list_size: int
pool_size: int
class rollnw.kernel.Objects

The object system creates, serializes, and deserializes entities

area(resref: str) Area
creature(resref: str) Creature
destroy(obj: ObjectHandle) None

Destroys an object and removes it from object system

door(resref: str) Door
encounter(resref: str) Encounter
get(handle: ObjectHandle)

Gets an object by its handle

get_by_tag(tag: str, nth: int = 0) ObjectBase | None

Gets an object with specific tag

placeable(resref: str) Placeable
store(resref: str) Store
trigger(resref: str) Trigger
valid(handle: ObjectHandle) bool

Checks if an object handle is still valid

waypoint(resref: str) Waypoint
class rollnw.kernel.Resources(parent: Resources | None)

Resources service

class rollnw.kernel.Rules

Rules service

class rollnw.kernel.Strings

Strings service

class rollnw.kernel.TwoDACache

2da cache

get(name: str | Resource) TwoDA | None

Gets a cached twoda

rollnw.kernel.config()

Gets config service

rollnw.kernel.effects()

Gets effects service

rollnw.kernel.load_module(path: str, manifest: str) Module

Loads a module

Parameters:
  • path (str) – path to module, can be a directory (with module.ifo), a mod file, or a zip file

  • manifest (str) – NWSynch manifest hash

rollnw.kernel.objects()

Gets objects service

rollnw.kernel.resman() Resources

Gets resman service

rollnw.kernel.rules()

Gets rules service

rollnw.kernel.start(options: ConfigOptions | None)

Starts kernel services

Parameters:

config (rollnw.ConfigOptions | None) – Optionally pass in configuration. Default behavior is to search for whatever NWN(:EE) install that it can find

rollnw.kernel.strings()

Gets strings service

rollnw.kernel.unload_module() None

Unloads the currently loaded module