Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: May 2017
G
gogots Offline OP
apprentice
OP Offline
apprentice
G
Joined: May 2017
Hi
I try to create hiding objects like dirtpiles and also use teleportation to get my characters from one terrain to another.
I understood that I should use triggers, but I do not know how ...
In particular how to link them to an object.
Can someone help me?

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
I wrote a tutorial on the wiki about how to do secret dirt piles:

Secret Dirt Piles


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: May 2017
G
gogots Offline OP
apprentice
OP Offline
apprentice
G
Joined: May 2017
Windemere, you are great!

Joined: May 2017
G
gogots Offline OP
apprentice
OP Offline
apprentice
G
Joined: May 2017
Mmmm, not so easy....

I wrote this in the story _GLO_Shovel ('init' part):

DB_ShovelArea (TRIGGERGUID_BoxTrigger_000_1263fd7f-b35b-48cc-b072-9e5eadf6fc24, "GameMaster_Chest_Used", ITEMGUID_Dirtpile_45562603-508c-46e2-a7db-d1fb825f7a5f);
DB_ShovelRewardItemAppear ("GameMaster_Chest_Used", ITEMGUID_Chest_1e31de6a-ebfa-4f62-9511-dc64815114a4, TRIGGERGUID_BoxTrigger_000_1263fd7f-b35b-48cc-b072-9e5eadf6fc24);

But nothing appen when I try to use the dirtpile.
But the console say that:

"Constant in script for unknown object is invalid, item with handle 'e63f9ee3-59dd-40db-9118-973924ab2bad' doesn't exist"

... I don't understand why...


Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Hmm ...

Had you generated definitions in order to add your GUIDs to the script or did you type them in by hand? Where did you get the GUIDs from?

Last edited by Windemere; 18/09/17 03:49 PM.

DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods
Joined: May 2017
G
gogots Offline OP
apprentice
OP Offline
apprentice
G
Joined: May 2017
I select my item/trigger on the outliner ----> Right click-------> Copy data to clipboard-------> Typeguid_Name_<GUID>
and Ctrl+V in the script...

Last edited by gogots; 18/09/17 04:05 PM.
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
Did you create a new __GLO_Shovel goal? Because if so, that will hide the __GLO_Shovel goal from Shared, and hence the dirt pile functionality will be deactivated. Or did you indeed create a goal called _GLO_Shovel (with one _ at the start)?

If you create _GLO_Shovel, then the issue is probably that your goal initialises before the shared module's __GLO_Shovel. In that case it won't work. The reason is that the event handlers from __GLO_Shovel that normally trigger when you add a DB_ShovelArea() fact won't be active yet, so your declaration will be ignored.

__GLO_Shovel is a subgoal Shared's __Start goal. Shared's __Start goal completes after "GAMEEVENT_GameStarted" GameEvent. So until that point, no DB_ShovelArea() declarations will have any effect.

In practice, a dirt pile will always be part of a level. Just like we do for the main game, it's best to create top level goals that initialise the first time a level is loaded (that happens much later than the above GameEvent). Then create subgoals for those top level goals that contain level-specific logic, like dirt piles.

I.e., create a top level goal that only contains something like this in the KB:

Code
IF
RegionStarted("MyLevel")
THEN
GoalCompleted;


And then subgoals that contain story code specific to MyLevel

Joined: May 2017
G
gogots Offline OP
apprentice
OP Offline
apprentice
G
Joined: May 2017
Indeed, I create a new _GLO_shovel...
I'm not sure I understand what you've explained, but I'll try. This is the first I do script :b

Joined: May 2017
G
gogots Offline OP
apprentice
OP Offline
apprentice
G
Joined: May 2017
Hi,
I tried something that does not work, but I want to know if I'm in the right direction.

In the story windows, I create an Script named "Level" with this code in the KB:
Code
IF
RegionStarted("TEST_mAP")
THEN
GoalCompleted;


"TEST_MAP"is the name of my Level.

Then, I create a sub-Item in my "Level"Item, with this code in INIT:

Code
DB_ShovelArea (TRIGGERGUID_BoxTrigger_000_1263fd7f-b35b-48cc-b072-9e5eadf6fc24, "GameMaster_Chest_Used", ITEMGUID_Dirtpile_45562603-508c-46e2-a7db-d1fb825f7a5f); 
DB_ShovelRewardItemAppear ("GameMaster_Chest_Used", ITEMGUID_Chest_1e31de6a-ebfa-4f62-9511-dc64815114a4, TRIGGERGUID_BoxTrigger_000_1263fd7f-b35b-48cc-b072-9e5eadf6fc24);

I have checked several times the name of the GUIDs.

But I allways have this Error message in the console:

Code
Constant in script for unknown object is invalid, item with handle 'e63f9ee3-59dd-40db-9118-973924ab2bad' doesn't exist


Am I on the right track?

Last edited by gogots; 20/09/17 09:56 AM.
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
Yes, that should be fine. Just to make sure: you compiled and reloaded your story before testing, right? (ctrl-F7 in the story editor)

The error is probably unrelated. If you depend on the Origins mod, it's likely coming from a character script there and should be harmless.

Joined: May 2017
G
gogots Offline OP
apprentice
OP Offline
apprentice
G
Joined: May 2017
I retry in a new poject, and all is ok.
Thank you very much guys!!!!

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Glad to hear it!

Also, thank you both gogots and Tinkerer for the feedback. I edited the wiki article today to be more clear about the story dependencies.


DOS2 Mods: Happily Emmie After and The Noisy Crypt

Steam Workshop
Nexus Mods

Moderated by  Larian_KVN 

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