Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Nov 2017
I
apprentice
OP Offline
apprentice
I
Joined: Nov 2017
The wiki page for DB_SceneManager() gives this description:

Quote
The scene manager can be used to group a number of NPCs and areas into a scene that should normally run in an uninterrupted way. If a player nevertheless manages to interrupt it in some way, it offers a generic interface to detect any interruptions so they can be easily handled.


On this page are included calls to build the databases (SceneManager and SceneTriggerManager) and procs for when the scene is interrupted or ends.

So how does one start a scene? Is it started when the INIT section builds the databases or can I trigger a scene to start when Osiris throws an event? And how does one define the content of the scene itself? How do I say, "In this scene, I want character X to walk over here and complete action Y"?

Is it that the scene starts on INIT and all characters defined therein are assumed to be part of the scene until the proc to end or interrupt it is called? But if that's the case, how do you differentiate scripted behavior that's related to the scene and scripted behavior that is not?

Is it possible to create new scenes at all?

Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
I'm afraid you may be overestimating what the scene manager does.
It doesn't actually manage the content of the scene. Rather, it provides a framework that suspends generic crime reactions so they don't interrupt a scripted scene, and an easy way to re-enable this generic behaviour, add custom reactions to events interrupting the scene, and re-enable the behaviour again once the scene is over.

The behaviour within the scene still needs to be scripted separately.

If you need to keep track of whether a given scene is active, you can use
Code
IF
DB_SceneManager((CHARACTERGUID)_NPC,_SceneName)
AND
[...]
THEN
...

to set a flag or a database entry and then clear it again
on

Code
PROC
Proc_SceneOver((STRING)_SceneName)
AND
[...]
THEN

and
Code
PROC
Proc_SceneInterrupted((_NPC,(CHARACTERGUID)NULL_00000000-0000-0000-0000-000000000000,_SceneName,_)
AND
[...]
THEN
...

Joined: Nov 2017
I
apprentice
OP Offline
apprentice
I
Joined: Nov 2017
OK. I think I get that. Thanks. smile How do set a scene as active in the first place? Does it activate on INIT or can it be activated by an Osiris event?

Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
It is considered "activated" the moment you put characters in the
Code
DB_SceneManager((CHARACTERGUID)_NPC,(STRING)_SceneName)

database. You can put them into that database in the INIT or in response to an in-game event, as you prefer.

Joined: Nov 2017
I
apprentice
OP Offline
apprentice
I
Joined: Nov 2017
That makes sense. Thank you. smile


Moderated by  Larian_KVN 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5