Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
Tested in game the area stay's black, when the PC runs into the trigger.

Last edited by Detect; 11/02/18 07:33 PM.
Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
It doesn't unlock automatically, you need to call 'UnlockSecretRegion()' from some kind of event.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
Originally Posted by Windemere
It doesn't unlock automatically, you need to call 'UnlockSecretRegion()' from some kind of event.

Sweet thanks for the heads up.

Quote
IF
CharacterEnteredTrigger(_Char,_EnteredTrig)
AND
DB_SecretRegions_OnEnteredTrig(_Trig,(TRIGGERGUID)_EnteredTrig)
AND
DB_IsPlayer(_Char)
THEN
UnlockSecretRegion(_Trig);
NOT DB_SecretRegions_OnEnteredTrig(_Trig,_EnteredTrig);


This is working now.
Quote

INIT
DB_IsPlayer(CHARACTERGUID_S_GLO_CharacterCreationDummy_001_da072fe7-fdd5-42ae-9139-8bd4b9fca406);
TriggerRegisterForPlayers(TRIGGERGUID_SecretRegionTrigger_000_5ffba307-5dc8-40a7-99c4-6bf9a4d84057);

KB
IF
CharacterEnteredTrigger(_Char,TRIGGERGUID_SecretRegionTrigger_000_5ffba307-5dc8-40a7-99c4-6bf9a4d84057)
THEN
UnlockSecretRegion(TRIGGERGUID_SecretRegionTrigger_000_5ffba307-5dc8-40a7-99c4-6bf9a4d84057);




Last edited by Detect; 12/02/18 02:26 PM.
Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
A quick note: it is generally better to use ProcTriggerRegisterForPlayers than simply TriggerRegisterForPlayers.

Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
Originally Posted by LarIlya
A quick note: it is generally better to use ProcTriggerRegisterForPlayers than simply TriggerRegisterForPlayers.


thanks. Can I just find and replace?

Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
little more on this now that I have about 10 hours steeped in it...Yesh!

You can tack on another 8 hours to dungeon development and design for this 5-6 room dungeon. I maybe very slow right now but will speed up as I do more of this...

This area had 6 secret rooms/door and HAD to have the secret areas blacked out... A lot of work.
25 triggers, and 25 scripts for this zone...How can I consolidate this? Its working. A lot of time spent going back and fiddling, because you just see this little slivers of light in places giving it away.. so it not 100%.. more like 97.5... Add in camlocks, traps, and locked doors I can add another 30 hours to this dungeon ,for a grand total of 75 hours on one level of a dungeon with 6 rooms...

is it just me?.. I am slow right? I haven't even added monsters/ treasure yet and I'm not happy with the level even...

I seem to be complaining about the time commitment because its onerous...

we need some developers to take this tool and speed up a lot of these tasks with new tools/Mods...

anyways

thanks as always for your help guys!

Last edited by Detect; 12/02/18 08:40 PM.
Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
Originally Posted by Detect
Originally Posted by LarIlya
A quick note: it is generally better to use ProcTriggerRegisterForPlayers than simply TriggerRegisterForPlayers.


thanks. Can I just find and replace?


You're welcome, and I see no reason why you couldn't!

Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
Additionally - as I logged another bunch of hours ( over 5, came back to post this ). Your going to want to add redundant Secret areas in the negative spaces.
( this is what I mean)
Halls, rooms are positive spaces. The empty spaces around the area of your Dungeon are a negative space. so fill those areas with a non-scripted Secret area trigger so they stay black. (have fun with that, is a lot of work)

Last edited by Detect; 14/02/18 01:04 AM.
Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
Originally Posted by LarIlya
Originally Posted by Detect
Originally Posted by LarIlya
A quick note: it is generally better to use ProcTriggerRegisterForPlayers than simply TriggerRegisterForPlayers.


thanks. Can I just find and replace?


You're welcome, and I see no reason why you couldn't!


Is there any argument to not doing this?

ProcTriggerRegisterForPlayers
why is this a better call? For this situation?
as compared to my current option?

Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
Description
This procedure registers the _Trigger for all players, so that they throw CharacterEnteredTrigger events. Unlike TriggerRegisterForPlayers, it also registers the trigger for characters that later become players. It also allows registering of triggers in other levels.

so it can be global?

Last edited by Detect; 14/02/18 11:27 PM.
Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
Yes, it's probably a good idea to use ProcTriggerRegisterForPlayers instead of TriggerRegisterForPlayers everywhere (except, of course, in ProcTriggerRegisterForPlayers itself, otherwise it will just call itself recursively and accomplish nothing). If there are cases where CharacterEnteredTrigger is better, which would be exceptional indeed, they are unlikely enough to be negligible.

Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
found this:

"Event triggers are automatically registered for all characters by the engine and should not be manually registered/unregistered."

from here: https://docs.larian.game/Osiris/API/TriggerUnregisterForCharacter
In the notes

Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
Yes, as it says there, in the case of event triggers, both TriggerUnregisterForPlayersm and ProcTriggerUnregisterForPlayers, as well as any other calls that register or unregister triggers, won't do anything, because an event trigger is meant to be a trigger that's registered for all characters at all times.

However, it is best practice, both for ease of debugging and for performance reasons, to use registered triggers rather than event triggers unless you actually need a trigger that throws events for every possible character (as is the case with e.g. weather - absolutely everyone who walks into rain, gets wet) or depend on the OnTriggerEnter event in behaviour script.

Last edited by LarIlya; 22/02/18 08:43 AM.
Joined: Jul 2015
D
Detect Offline OP
member
OP Offline
member
D
Joined: Jul 2015
In testing I find that even ProcTrigger would fire when a wandering Rat intersected. solution was to move the rat spawn... I cant verify any difference!

Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
1. Is the trigger which you're using an event trigger or a box/poly trigger?
If it's an event trigger, that's normal:

As I explained above, triggers throw enter and leave events for any character for which they are registered.
Event triggers are always registered for all characters.
Box and poly triggers need to be registered for those characters, whose entering that trigger is of interest to you.

If the characters of interest are players, it is better to use ProcTriggerRegisterForPlayers because simply using TriggerRegisterForPlayers will keep that trigger registered for characters which are currently players but later become NPCs and will not register it for characters who are currently NPCS but later become players.

2. If it's a box/poly trigger, can you post whatever code you're using to register these events here?


Moderated by  Larian_KVN 

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