Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2017
veteran
OP Offline
veteran
Joined: Sep 2017
Hello! I am trying to add an extension to the HoE main campaign map with the spirit tree and the hanging gods. The problem is, once the player enters, the gods are at their place. But if he teleports someplace else (a new level) and then back, the gods will be misplaced.

I think I've figured out which scripts the game uses to send them to their place, using the script that's been added to their npc, which I can't remember from the top of my head... No access to my computer at the moment. Something like "Send message to Osiris" or something.

It's really hard to explain, since I'm relatively new to the engine and all. But basically, when the player loads the level, it triggers some events that only happens when the player initially loads in. I need to repeat those calls when the player returns to a different location within the same level.

I tried a couple of approaches, and the only error I got when trying to make my script in the story editor build was that it wouldn't recognize the "this" object, in this case _god as the target, which is the term those seven gods are unified under, I presume. It works in the main game files, but no matter what I do, however simple, the story editor will not recognize that tag.

Do any of you guys have any idea what I can try? Or have an explanation on how the "send something to osiris" option you can add under the "Scripts" menu when editing NPC characters spawned in the world work? I thought maybe I can just write a code, like the example below...

IF (This is the part I don't know because I don't know what the "send to osiris" option looks for)
OsirisEvent(_GUID_Of_Target_Manynumbersandstuff)
THEN
LineOfCode(_AtHome,"Dontrememberitrightnow",1);

I hope this makes any sense at all, haha.

Joined: Jun 2013
old hand
Offline
old hand
Joined: Jun 2013
I'm not heavily familiar with how the campaign scripts run since I'm still playing and trying to avoid spoiling myself.

But generally something like _God is undefined unless you define it. So you either need to pull that information from a database or from an event.

Example:
IF
GlobalFlagSet("Flag1")
THEN
CharacterDie(_Player,1);

The problem with the above is _Player is undefined. So it has no way to pick which character to kill. Therefore it does nothing and your build fails.


Correct Example:
IF
GlobalFlagSet("Flag1")
AND
DB_IsPlayer(_Player) //this DB contains all players (and companions)
THEN
CharacterDie(_Player,1);

^That will kill your entire party, where the first example will do nothing.

As an example to show you how I mean "_Player" being undefined. you could write the above script as:
Correct Example:
IF
GlobalFlagSet("Flag1")
AND
DB_IsPlayer(_NOTAPLAYERPlayer)
THEN
CharacterDie(_NOTAPLAYERPlayer,1);

Eventhough it's called "_NOTAPLAYER" it's still going to pull the players from the database. _Player or _Anything is entirely abstract and for your benefit.


For how the specifics of that homestead event work, I'd need more information like what file it's in, preferably with a flag/event name I could control+F for.


Last edited by SniperHF; 01/10/17 03:15 AM.
Joined: Sep 2017
veteran
OP Offline
veteran
Joined: Sep 2017
Right, so this point is right after you **SPOILERS***

... Leave Fort Joy and defeat the battle on the ship. You're sent to Hall of Echoes and there's a bunch of lines that prepares the map. The problem was that this is only run specifically after that movie (cinematic) is played, so if the player were to return a second time, the preparations wouldn't be made and objects around the zone wouldn't function properly.

The particular story script is under Story>LadyVengeance>LV_HoE_Main and I particularly suspect these lines to be responsible for making the gods hang in the right place and have the status effect "CURSED" on them, leaving them there for the player to Bless them and have their chat with their respective god.

-----
IF
DB_LV_HoE_DeadGods((CHARACTERGUID)_God)
THEN
CharacterSetForceSynch(_God,1);
CharacterUseItem(_God,ITEMGUID_S_LV_HoE_SpiritTree_02bda965-05ae-4be8-8400-2c58a68490a0,"LV_HoE_Gods_SitFinished");
ApplyStatus(_God,"CURSED",-1.0,1);
ProcCharacterDisableAllCrimes(_God);

IF
StoryEvent((CHARACTERGUID)_God,"LV_HoE_Gods_SitFinished")
THEN
CharacterSetAnimationOverride(_God,"Hung_04_Loop");
CharacterSetForceSynch(_God,0);
----


Joined: Sep 2017
veteran
OP Offline
veteran
Joined: Sep 2017
There's also another suspect just a few lines earlier,

IF
MovieFinished("CS_LV-Battle_to_HOE")
AND
GlobalGetFlag("FTJ_LV_StartHoELevel",1)
AND
QueryOnlyOnce("FTJ_LV_StartHoELevel_SetupAfterMovie")
THEN
TimerLaunch("FTJ_LV_SendPlayersToHoE",500);


That is run right after the movie, I'm curious if FTJ_LV_StartHoELevel_SetupAfterMovie is pointing to some other definition that is running the map setup.

Joined: Dec 2013
old hand
Offline
old hand
Joined: Dec 2013
Easiest thing to do if you want to re-engineer something from Origins is to create a placeholder mod that has a dependency on Origins. Open it up and go into the story editor. From the story editor window perform CTRL+SHIFT+F. This will bring up a search window and you can perform searches that will inspect every goal in the story looking for your search string. So type in 'FTJ_LV_StartHoELevel_SetupAfterMovie' and you'll find where that happens. It looks like you're on the right track.


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