Coder Social home page Coder Social logo

bg3se's Introduction

Norbyte's Baldur's Gate 3 Script Extender

Downloads available here

The Script Extender adds Lua/Osiris scripting support to the game. API Documentation

Configuration

The following configuration variables can be set in the ScriptExtenderSettings.json file:

Variable Type Default Description
CreateConsole Boolean false Creates a console window that logs extender internals. Mainly useful for debugging.
EnableLogging Boolean false Enable logging of Osiris activity (rule evaluation, queries, etc.) to a log file.
LogRuntime Boolean false Log extender console and script output to a log file.
LogCompile Boolean false Log Osiris story compilation to a log file.
LogFailedCompile Boolean true Log errors during Osiris story compilation to a log file.
LogDirectory String My Documents\OsirisLogs Directory where the generated Osiris logs will be stored.
EnableExtensions Boolean true Make the Osiris extension functionality available ingame or in the editor.
SendCrashReports Boolean true Upload minidumps to the crash report collection server after a game crash.
DumpNetworkStrings Boolean Not implemented yet Dumps the NetworkFixedString table to LogDirectory. Mainly useful for debugging desync issues.
DeveloperMode Boolean false Enables various debug functionality for development purposes.
DisableModValidation Boolean true Disable module hashing when loading modules.
EnableAchievements Boolean true Re-enable achievements for modded games.
EnableDebugger Boolean false Enables the Osiris debugger interface
DebuggerPort Integer 9999 Port number the Osiris debugger will listen on
EnableLuaDebugger Boolean false Enables the Lua debugger interface
LuaDebuggerPort Integer 9998 Port number the Lua debugger will listen on

Build Instructions

Download the latest external dependencies from here and extract them to the External/ folder.

bg3se's People

Contributors

aahzmandius avatar atilioa avatar azzurite avatar fallenstar08 avatar feliperenault avatar greymeister avatar mycroftjr avatar norbyte avatar osirisofgit avatar piepie62 avatar varriount avatar warzone762 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bg3se's Issues

Does not enable Achievements

I tested this with the "No Penny Required" and the "Fetch Quest" Achievements.
Both did not pop. I own the game on steam.
i tried both the version with the console and the one without. both do not activate achievements.

Error using Script Extender(Steam)

Do you have any idea why when following the script extender steps of extracting the DWrite.dll to my bin folder, and then adding
WINEDLLOVERRIDES="DWrite.dll=n,b" PROTON_NO_ESYNC=1 %command%
to my launch options on steam, I then get this error code?
It says, "Windows cannot find 'WINEDLLOVERRIDES=DWrite.dll=n,b' Make sure you typed the name correctly, and then try again".
It makes me be unable to use your Script Extender, and I would like to use it to enable some mod(s). Thank you!

Script extender update failed

When I load the game up I get an alert saying

"Script extender update failed. Script extender not available for game version v4.36.22.274"

I don't understand is the not the latest version of the game?

ScriptExtender::CompileWrapper: Compilation FAILED.

I installed the latest version of the script extender. It doesnt't appear to be working with the Appearance Edit mod.

Here is the compiler log:

### Compile("C:/Users/evely/AppData/Local/Larian Studios/Baldur's Gate 3/Temp/Story/story_generated.div","r+")
DeleteAllData
line 1360: error: Osiris fact/proc/query NRD_KillStory does not start with "DB_"/"PROC_"/"QRY_"
line 1362: error: Osiris fact/proc/query NRD_BadCall does not start with "DB_"/"PROC_"/"QRY_"
line 1377: error: Osiris fact/proc/query NRD_KillStory does not start with "DB_"/"PROC_"/"QRY_"
line 1379: error: Osiris fact/proc/query NRD_BadCall does not start with "DB_"/"PROC_"/"QRY_"

4 error(s), 0 warning(s). Compilation ended.

Console does not appear

I downloaded the script extender with console, and I followed the installation instructions to the letter. However, the console window does not appear when I launch the game.

Steam version 4.1.1.3686210

Error Code When CallingOsiris

Using an addon, we are now receiving this error since your update on 8/31. It appears that this is not fixed with the latest update. Can you shed some light on whether this will be fixed or not? Please note, this was working fine before your 8/31 update.

Error while dispatching event SessionLoaded: [string "AutoSaver/Server/Autosave.lua"]:2: Attempted to access Osiris t
stack traceback:
[C++ Code]: in field 'TimerLaunch'
AutoSaver/Server/Autosave.lua:2: in function <AutoSaver/Server/Autosave.lua:1>
[C++ Code]: in function 'xpcall'
builtin://Libs/Event.lua:129: in method 'Throw'
builtin://Libs/Event.lua:184: in function builtin://Libs/Event.lua:183

Can't get Boostrap file to load

Hi,

im currently trying to get my mod to load.
Im using the 2023/09/04 release (v3) and the Script Extender console shows up and also shows some debug info.

BG3 Script Extender Debug Console
******************************************************************************
*                                                                            *
*                     BG3 Script Extender Debug Console                      *
*                                                                            *
******************************************************************************

BG3Ext v2 built on Sep  4 2023 22:39:05
Game version v4.36.96.83 OK
ScriptExtender::Initialize: Starting
Library startup took 548 ms
LibraryManager::PostStartupFindLibraries() took 31 ms
Extender runtime log written to 'C:/Users/Ferdinand/AppData/Local/Larian Studios/Baldur's Gate 3//Extender Logs\Extender Runtime 2023-09-06 12-01-34.log'
Initializing client with target context Load
Modded achievements enabled.
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
Initializing client with target context Game
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
ecl::ScriptExtender::OnGameStateChanged(): Loaded module
esv::ScriptExtender::OnGameStateChanged(): Unloading session
ecl::ScriptExtender::OnGameStateChanged(): Unloading session
ecl::ScriptExtender::OnClientGameStateChanged(): Loading game session
Initializing client with target context Game
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
esv::ScriptExtender::OnGameStateChanged(): Loaded module
Initializing server with target context Game
CustomFunctionManager::ClearDynamicEntries(): Clearing dynamic functions
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
esv::ScriptExtender::OnGameStateChanged(): Loading game session
ScriptExtender::RestartLogging: Starting Osiris Runtime debug logging.
        Path=C:/Users/Ferdinand/AppData/Local/Larian Studios/Baldur's Gate 3//Extender Logs\Osiris Runtime 2023-09-06 12-02-15.log
ScriptExtender::OnAfterOsirisLoad: 129375 nodes
ExtensionStateServer::StoryLoaded()
CustomFunctionInjector mapping phase: 1264 -> 1264 functions

I then created my mod inside the steamapps\common\Baldurs Gate 3\Data\Mods folder

tree
PS E:\SteamLibrary\steamapps\common\Baldurs Gate 3\Data\Mods> tree /F
Folder PATH listing for volume Micron
Volume serial number is 04FD-4599
E:.
โ”‚   .gitignore
โ”‚
โ”œโ”€โ”€โ”€.vscode
โ”‚       settings.json
โ”‚
โ”œโ”€โ”€โ”€GustavDev
โ”‚   โ””โ”€โ”€โ”€Story
โ”‚       โ””โ”€โ”€โ”€RawFiles
โ””โ”€โ”€โ”€SCOutfitToCorpse
    โ”‚   meta.lsx
    โ”‚
    โ”œโ”€โ”€โ”€.vscode
    โ”‚       settings.json
    โ”‚
    โ””โ”€โ”€โ”€ScriptExtender
        โ”‚   Config.json
        โ”‚
        โ””โ”€โ”€โ”€Lua
            โ”‚   BootstrapClient.lua
            โ”‚   BootstrapServer.lua
            โ”‚
            โ””โ”€โ”€โ”€Utils
                    Utils.lua

Ill attach my meta.lsx, Config.json and the lua scripts.
I also tried adding my mod to the modsettings.lsx inside the PlayerProfiles\Public folder (didn't resolve the problem)
SCOutfitToCorpse.zip
Note: I tried RequiredVersion: 1, 2 and 3 and neither changed anything

Also out of fustration, i tried loading it by Moving it into the %localappdata%\Larian Studios\Baldur's Gate 3\Mods folder, which didn't help either.

My ScriptExtenderSettings.json is set to:

{
  "CreateConsole": true,
  "EnableLogging": true,
  "LogRuntime": true,
  "LogCompile": true,
  "LogFailedCompile": true,
  "DeveloperMode": true
}

What am i missing ?

Method to call CharacterCreationMaterialOverride

Hi, me and some other character appearance modders are wondering if there is a way to expose these material calls
"CharacterCreationMaterialOverride"

e.g: When the player is in the Character Creator (CC), they click on UI elements which call these to change the appearance of the CC character. This is inaccessible with AddCustomMaterialOverride AFAIK as the CC Character is different and doesn't have an UUID.

I was wondering if it works similarly to:
"AddCustomMaterialOverride(GetHostCharacter(), SomeOverride)

Thanks for the script extender ๐Ÿ™

Achievements still don't work

I've installed the Script Extender correctly, and made sure to download and extract it using the BG3 Mod Manager, AND have the Enable Achievements preference ticked in the Script Extender settings, and my achievements still aren't working. I've tested it with playing fetch with Scratch, and the Bottoms Up achievement, and nothing happening.
I can't use the Achievements mod on Nexus as the creator has set that mod to disable when it detects the Script Extender, and I can't get rid of the Script Extender as I need it for some of my mods, so ideally I want to get the Script Extender working properly.

Feature Request: Preserve console window location

Great work!

A super small and not time sensitive feature request, could you make the console window remember it's location from run to run? Right now I have to drag it over to my second monitor every time I test my mod.

Audio artifacting

Since installing this, the game and non game audio often become distorted and static-y, especially when alt tabbing. This wasn't an issue beforehand so I'm thinking it must be because of the script extender.

Problem with v2

I downloaded v2 but my mod manager tells me that v1 is installed. I clicked the v2 download and have 3 copies of the zip file. the .dll says it was last modified on Aug 15, which would be v1 I believe.

So where is v2 then?

Console doesn't register enter

I tried to press enter, and nothing happens when the console is open. I had the poly romance mod installed, and it uses the script extender so I'm not sure if that is causing the problem or if it's something else.

My issue is just that, game is open, character moves around, I switch over to the console and press enter, then nothing. Any help would be appreciated.
console

Script extender keeps crashing

Im on version 4.36.69.438, script extender keeps crashing my game.
How can i see the crash dump?

image
this is what i see before it crashes and exits the cmd console

crash to desktop

Placed in bin folder and now game crashes at 97% for initial loading screen. removal stops crash from occurring.

No match found for mapping

After booting via the bg3.exe or the bg3_dx11.exe file the activated console receives the following error.

No match found for mapping 'EoCServer2/EoCClient2' [CRITICAL]
ScriptExtender::Initialize: Could not load libraries; skipping scripting extension initialization.

I have ensured that I have the latest version and the DWrite.dll as well as both .json files are both in the bin folder with the executable.

EnableAchievements don't work

Hi,

When i load my save i still get the warning

this is what there is in my "ScriptExtenderSettings.json"

{ "EnableAchievements": true }

anybody have a solution ?

No console?

I download script extender w/ console, but get no console when running the game? How do I open it?

Many internal events are not recognized by RegisterListener()

Hey, Nice Day~
There are some problem when I creating some script in BootstrapServer.lua to functional a custom spell.
It seems RegisterListener() cant register some Osiris internal event anymore.

I received:

bg3se::esv::lua::OsirisCallbackManager::RegisterNodeHandler(): Couldn't register Osiris subscriber for StatusRemoved/3: Symbol not found in story.

The same problem happens on StatusApplied also. But BG3SE can correctly working on TurnEnded, CastedSpell etc. Is my usage wrong? Or are these events no longer supported in Osiris? Is there a new API list that I can refer to?

Are you accepting contributions?

Hiya!

Thanks for the cool project.

I've spent the last couple hours dealing with dependencies etc to make it build. Alas, trying to run the thing after I got it to build gave me a bunch of memory corruption errors, and I figured I was wasting my time going any further without dropping a message here. Based on what I've seen while trying to make it build, I get the feeling it depends on symbols provided by Larian, so I'm not sure how much I can help, but I would like to get involved if I can.

If you're curious what terrible sins I had to commit to make the thing build, you can check here: Liareth@55d9052

Please let me know if you're looking for help, and if you are, how I can get involved! Thank you.

Script Extender Crashes on main save after Patch #1

After trying to continue the save that had been using the Script Extender, after Patch 1 it gets to 60% loading then crashes to desktop almost instantly. Not entirely sure how to go about fixing it, or if it's just due to Patch 1

Script Extender Error Code

Once I download the Script Extender, I get a message saying "Script Extender update failure; make sure your connected to the internet and try again. Unable to download manifest (35) SSL connect error." Please help.

Ext.Print() doesn't seem to work

I'm getting an error when trying to use Ext.Print().

BootstrapServer.lua:

Ext.Print("TEST")

Error:

Loading bootstrap script: Mods/TmpTest/ScriptExtender/Lua/BootstrapServer.lua
bg3se::lua::State::LoadScript(): Failed to execute script: [string "TmpTest/BootstrapServer.lua"]:1: attempt to call a nil value (field 'Print')
stack traceback:
        TmpTest/BootstrapServer.lua:1: in main chunk
        [C++ Code]: in field 'Include'
        builtin://BuiltinLibrary.lua:99: in function <builtin://BuiltinLibrary.lua:71>

[BUG ?] Variable scope in event handler

In the following example the "handle" value has an ID and unsubscribing works :

local handle = 0

local function _OnStateChange(e)
    if e.ToState == "Running" then
        _P("Handle=")
        _D(handle)
        Ext.Events.GameStateChanged:Unsubscribe(handle)
    end
end

handle = Ext.Events.GameStateChanged:Subscribe(_OnStateChange)

In the following case "null" is displayed :

local handle = Ext.Events.GameStateChanged:Subscribe(function(e)
    if e.ToState == "Running" then
        _P("Handle=")
        _D(handle)
        Ext.Events.GameStateChanged:Unsubscribe(handle)
    end
end)

If this is not a bug and an expected behavior it would be nice to have a way to unsubcribe with something like "Ext.Events.GameStateChanged:Unsubscribe()" without parameter or e.handle when called inside the event handler.

Initial Installation

Hi there, I just decided to install this, and noticed that the zip file for latest release only had the DWrite.dll in the ZIP. Is the scriptextendersettings file separate? Does it populate on its own after running the game? Any info would be appreciated, thank you.

PS: I'm only interested in the enabled achievements, so if this sitting is ON by default, then no worries.

Crashes on Linux with CreateConsole set to true

I tried to follow the guide for deleting characters from a campaign but I can't seem to launch the game with CreateConsole set to true.

The game just immediately exits on start. Setting it to false and the game launches with no issues.

Not sure if the proton log helps you out but here it is:
steam-1086940.log

Error

line 1355: error: Osiris fact/proc/query NRD_KillStory does not start with "DB_"/"PROC_"/"QRY_"
line 1357: error: Osiris fact/proc/query NRD_BadCall does not start with "DB_"/"PROC_"/"QRY_"

2 error(s), 0 warning(s). Compilation ended.
Captura de Tela (120)
Can I ignore this or some faulty mod?

Command line cuts off at edge of window

Does what it says on the tin. Can't type longer lines of commands and when I try, it writes over the parts of the line I had just typed, making it impossible to execute the intended commands (Example: "Osi.DB_ApprovalRating:Delete("companion UUID", "player UUID", )", with added UUIDs)

Problems with my version?

I tried installing with the last two versions of the extension, but the error message appears in both: Scrip extension not available for game version v4.36.24.901

Script Extender Error Message - No internet?

Error

Every time I launch the game I get this error saying I am not connected to the internet but I have cleared the "NGX Updater" to connect in my firewall. Is there some hidden process I need to whitelist or is there a "non-updating" version of this mod I can use? The message is rather annoying.

Console won't launch on game start, dependent mod won't work

No console opens when I launch BG3 (Steam, latest patch and hotfix), and in the main menu I get an alert saying the SE can't update, accompanied by "HTTP error 403". I extracted the files from the latest release (post-hotfix 15) to BaldursGate3/bin. My other mod works, but the mod dependent on the SE doesn't (mods are managed by vortex and the modsettings.lsx seems to match what the creator specified), which leads me to think this an issue with bg3se specifically.

Moonrise Tower Minthara looping dialogue [possible game spoilers]

Encountered this issue where once Minthara joins the party whether pre-formal join (as follower) or as full party member (and you bring her back to MR Tower) she would keep on initiating dialog with main character or if NPC initiates dialog with Minthara causing a nonstop loop.

I only found out this is an issue with BG3SE from a reddit post and confirmed that by disabling BG3SE, the issue stops and currently the workaround is to avoid MR Tower with Minthara in party or disable BG3SE. BG3SE has to be disabled to get her out of the tower.

I did this by renaming DWrite.dll to get her out of the tower as a follower. I found out about the NPC looping dialogue with Minthara only because I brought her back to MR Tower with BG3SE reenabled to finish up the area and the NPC guards initiated dialogue with Party and Minthara was the closest party member and so got stuck in the dialog loop again.

Doesn't work with patch 1

I downloaded the Update-wConsole-v1.zip package and the console never show up in game. Pls fix so I can romance mommy K.

Executing Lua file from console

Hey, is there currently a way to execute a Lua file from the console which is outside the games paks for quicker iterating of code/making the console experience more bareable?

Failures and Updates

I've been unable to go back into one of my campaigns for a few days, and have tried a whole bunch of stuff to no avail.

I did see the following in the crashdump for the script extender and don't know how to fix them

Key : Failure.Bucket
Value: NULL_POINTER_READ_c0000005_bg3_dx11.exe!Unknown

Key  : Failure.Hash
Value: {0915c37a-44ac-c947-c10d-ae131d365117}

Also, in the Mod Manager it keeps telling me that I'm using v1 instead of v3, despite having downloaded/installed v3 repeatedly. I don't know if that's part of the problem either. Any insight would be great.

Other things I've tried include:

  • Deleting the modsetting.lsx file and reloading all mods again
  • Validating files on Steam
  • Redownloading/installing all mods
  • Reinstalling the Script Extender
  • Enabling/Disabling Export Default Values in the script extender
  • Change the game path from bg3.exe to bg3_dx11.exe
  • Moving ImprovedUI from Overrides to the load order it was in before the update
  • Updating all mods that have updates available
  • Removing mods that I added before encountering this problem
  • Enabling/Disabling DirectX 11 Mode, launching through Steam, and Auto Add Missing Dependencies When Exporting

Red exclamation mark?

Hi,

I haven't been able to find anything that explains what does the red exclamation mark means in your active mods list. So i would appreciate having a clarification on this. Thanks in advance.

image

Ext.getCharacter Problem

When calling GetCharacter method with correct GUID passing, FIXME message is called and nil type is returned.

Do I understand correctly that this is a temporary problem and it will go away in the next releases?
Is there any other way to get Object of type esv::Character?

Combined Logging Levels leading to unexpected performance issues due to "crazy" console updates.

Couldn't enable modded achievements (symbol not mapped)
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
Configuration for '5eSpells':
MinVersion 1; Feature flags: Osiris Lua
Configuration for 'Warcaster':
MinVersion 1; Feature flags: Lua
Configuration for 'AutoSaver':
MinVersion 2; Feature flags: Lua
Configuration for 'KvCampEvents - v0.4.4':
MinVersion 2; Feature flags: Lua
Configuration for 'RespecIllithidPowers':
MinVersion 1; Feature flags: Lua
Configuration for 'DeityTagActivator':
MinVersion 1; Feature flags: Lua
6 mod configuration(s) loaded.
Merged configuration:
MinVersion 2; Feature flags: Osiris Lua
Initializing client with target context Game
Couldn't enable modded achievements (symbol not mapped)
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
Loading bootstrap script: Mods/5eSpells/ScriptExtender/Lua/BootstrapClient.lua
ecl::ScriptExtender::OnGameStateChanged(): Loaded module

It seems that logging level 2 of lua works fine for mod output but was too much for Osiris Lua output, so that developer was using logging level 1, but once you mix the "right" mods together it combines to use the Maximum for each feature, so you get Logging level 2 of Osiris Lua and the console goes crazy especially when loading or starting conversations.

I expect this is behind some of the "random" performance drops or behaviour people can't understand that they just can't quite nail down to repeat...
And unless you moved the console to the front you might not ever find out it was scrolling like crazy with every trigger and tag.
Reminds me of doing things in the old days and having to minimise the console, because it was faster if it didn't have to update the screen while it was printing!

Is it possible to keep the debug levels of normal lua and story lua separate?

thanks for your work.

An example of the end of output.
image

It changes as I move of course.
i'd hate/love to see it in a big fight!

no console

im pretty sure I installed it correctly, but I cant get the console to show up

Osiris user query subscribing currently doesn't work

When attempting to subscribe to a user query, you get the following warnings:

bg3se::esv::lua::OsirisCallbackManager::RegisterNodeHandler(): Couldn't register Osiris subscriber for QRY_CampNight_MeetsRequirements/1: Symbol must be an event, query, call, DB, PROC or QRY.

bg3se::esv::lua::OsirisCallbackManager::RegisterNodeHandler(): Couldn't register Osiris subscriber for QRY_CampNight_MeetsRequirements_StartDating/1: Symbol must be an event, query, call, DB, PROC or QRY.

The queries themselves work when used from Osi, like Osi.QRY_CampNight_MeetsRequirements("") etc.

Code example:

Ext.Osiris.RegisterListener("QRY_CampNight_MeetsRequirements", 1, "before", function (flag)
	
end)

Ext.Osiris.RegisterListener("QRY_CampNight_MeetsRequirements_StartDating", 1, "after", function (flag)

end)

These are queries located in GLO_CampNights.txt:

QRY
QRY_CampNight_MeetsRequirements((FLAG)_Var1)
AND NOT
QRY_CampNight_MeetsRequirements_IsInFallback(_Var1)
AND
QRY_CampNight_MeetsRequirements_Flags(_Var1)
AND
QRY_CampNight_MeetsRequirements_Approval(_Var1)
AND
QRY_CampNight_MeetsRequirements_Partner(_Var1)
AND
QRY_CampNight_MeetsRequirements_Dating(_Var1)
AND
QRY_CampNight_MeetsRequirements_StartDating(_Var1)
AND
QRY_CampNight_MeetsRequirements_SameUser(_Var1)
THEN
DB_NOOP(1);

Error on launch from Steam

I followed the instructions exactly as given for instalation, but every time I try to boot the game it tells me "Windows cannot find n,b'. Make sure you typed the name correctly, and then try again." I have no idea what the actual issue could be.

Edit: I'm stupid. I put the launch options in on a Windows computer.

Osiris 4 compilation errors when starting new game

Always get this compilation error when clicking to start a new game, even without any Script Extender mods:

### Compile("C:/Users/The Lion/AppData/Local/Larian Studios/Baldur's Gate 3/Temp/Story/story_generated.div","r+")
DeleteAllData
line 1355: error: Osiris fact/proc/query NRD_KillStory does not start with "DB_"/"PROC_"/"QRY_"
line 1357: error: Osiris fact/proc/query NRD_BadCall does not start with "DB_"/"PROC_"/"QRY_"
line 1372: error: Osiris fact/proc/query NRD_KillStory does not start with "DB_"/"PROC_"/"QRY_"
line 1374: error: Osiris fact/proc/query NRD_BadCall does not start with "DB_"/"PROC_"/"QRY_"

4 error(s), 0 warning(s). Compilation ended.

This is the generated story_generated.div file:
Pastebin

The relevant lines:

[1355]: call NRD_LuaCall((STRING)_Mod, (STRING)_Func, (STRING)_Arg1, (STRING)_Arg2, (STRING)_Arg3, (STRING)_Arg4, 
(STRING)_Arg5, (STRING)_Arg6) (1,1,16777227,1)
[1357]: call NRD_LuaCall((STRING)_Mod, (STRING)_Func, (STRING)_Arg1, (STRING)_Arg2, (STRING)_Arg3, (STRING)_Arg4, (STRING)_Arg5, (STRING)_Arg6, (STRING)_Arg7, (STRING)_Arg8) (1,1,16777229,1)
[1372]: query NRD_StringFormat([in](STRING)_Format, [out](STRING)_Result, [in](STRING)_Arg1, [in](STRING)_Arg2, [in](STRING)_Arg3, [in](STRING)_Arg4, [in](STRING)_Arg5, [in](STRING)_Arg6, [in](STRING)_Arg7) (2,2,16777225,1)
[1374]: query NRD_StringFormat([in](STRING)_Format, [out](STRING)_Result, [in](STRING)_Arg1, [in](STRING)_Arg2, [in](STRING)_Arg3, [in](STRING)_Arg4, [in](STRING)_Arg5, [in](STRING)_Arg6, [in](STRING)_Arg7, [in](STRING)_Arg8, [in](STRING)_Arg9) (2,2,16777227,1)

Attempted to access Osiris function in restricted context

i have a really simple script that won't run since patch 2 - attempting to launch a timer causes an Attempted to access Osiris function in restricted context error; is there a different event i can subscribe to that will allow firing a timer on game load?

BootstrapServer.lua:

Ext.Require("Server/Timer.lua")

Server/Timer.lua:

Ext.Events.SessionLoaded:Subscribe(function(e)
    Osi.TimerLaunch("Trigger_CustomTimer", 3000)
end)

Ext.Osiris.RegisterListener("TimerFinished", 1, "after", function(finishedTimer)
    if finishedTimer == "Trigger_CustomTimer" then
         Ext.Utils.Print("Timer finished")
    end
end)

run log:

******************************************************************************
*                                                                            *
*                     BG3 Script Extender Debug Console                      *
*                                                                            *
******************************************************************************

BG3Ext v2 built on Aug 31 2023 17:39:20
Game version v4.36.86.210 OK
ScriptExtender::Initialize: Starting
No match found for mapping 'KillLauncher'
Library startup took 931 ms
LibraryManager::PostStartupFindLibraries() took 51 ms
Configuration for 'SimpleTimer':
        MinVersion 1; Feature flags: Lua
1 mod configuration(s) loaded.
Merged configuration:
        MinVersion 1; Feature flags: Lua
Initializing client with target context Load
Modded achievements enabled.
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
Configuration for 'SimpleTimer':
        MinVersion 1; Feature flags: Lua
1 mod configuration(s) loaded.
Merged configuration:
        MinVersion 1; Feature flags: Lua
Initializing client with target context Game
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
ecl::ScriptExtender::OnGameStateChanged(): Loaded module
esv::ScriptExtender::OnGameStateChanged(): Unloading session
ecl::ScriptExtender::OnGameStateChanged(): Unloading session
ecl::ScriptExtender::OnClientGameStateChanged(): Loading game session
Configuration for 'SimpleTimer':
        MinVersion 1; Feature flags: Lua
1 mod configuration(s) loaded.
Merged configuration:
        MinVersion 1; Feature flags: Lua
Initializing client with target context Game
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
esv::ScriptExtender::OnGameStateChanged(): Loaded module
Configuration for 'SimpleTimer':
        MinVersion 1; Feature flags: Lua
1 mod configuration(s) loaded.
Merged configuration:
        MinVersion 1; Feature flags: Lua
Initializing server with target context Game
CustomFunctionManager::ClearDynamicEntries(): Clearing dynamic functions
bg3se::ExtensionStateBase::LuaResetInternal(): LUA VM reset.
Loading bootstrap script: Mods/SimpleTimer/ScriptExtender/Lua/BootstrapServer.lua
esv::ScriptExtender::OnGameStateChanged(): Loading game session
ScriptExtender::OnAfterOsirisLoad: 129330 nodes
ExtensionStateServer::StoryLoaded()
CustomFunctionInjector mapping phase: 1264 -> 1264 functions
ScriptExtender::OnAfterOsirisLoad: 129330 nodes
ExtensionStateServer::StoryLoaded()
CustomFunctionInjector mapping phase: 1264 -> 1264 functions
ScriptExtender::MergeWrapper() - Started merge
ScriptExtender::MergeWrapper() - Finished merge
Error while dispatching event SessionLoaded:    [string "SimpleTimer/Server/Timer.lua"]:2: Attempted to access Osiris function in restricted context
stack traceback:
        [C++ Code]: in field 'TimerLaunch'
        SimpleTimer/Server/Timer.lua:2: in function <SimpleTimer/Server/Timer.lua:1>
        [C++ Code]: in function 'xpcall'
        builtin://Libs/Event.lua:129: in method 'Throw'
        builtin://Libs/Event.lua:184: in function <builtin://Libs/Event.lua:183>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.