Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Aug 2017
D
D00med Offline OP
member
OP Offline
member
D
Joined: Aug 2017
So I tried to create a new gamescript for statuses because adding to the existing one will cause mod-conflicts. But anything I put in this file is ignored (it's been added to resources) and overridden by the code in main statuses.gamescript

Is there anyway around this?

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
To activate a gamescript, you also have to activate it in your mod: Project -> Settings -> General and then under "Gameplay" click on the "..." button next to "Game Scripts".

I don't think this is documented yet though :| If you have a suggestion about on which wiki page this should best be mentioned, please tell me. I don't immediately see a good spot.

Joined: Aug 2017
D
D00med Offline OP
member
OP Offline
member
D
Joined: Aug 2017
Maybe as some kind of important notes on the "https://docs.larian.game/Script_editor" page? Either at the beginning or end - as technically it's another step for once you do something in the editor.

Also probably best something is added about having to manually add new scripts via the resource manager too - then link that page too.

As nothing on that page mentions that these steps aren't automatic(or exist) and need to be manually done.

Joined: Aug 2017
D
D00med Offline OP
member
OP Offline
member
D
Joined: Aug 2017
I've added my new gamescript file to my mod via the way you said. But it's still being overwrote by the main status.gamescript file.

Update: Once I save and restart editor. Script editor now reads the file, but gives me error (https://imgur.com/a/0hgHe) and that tells me to fix it by renaming, remove duplicate or using shared.

What is using shared?

Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
Regarding "using shared": that's a wrong and confusing hint in this case. If you have a multiple item/characterScripts that depend on the same scripting via e.g. "USING Base" and then assign these scripts to the same item/character, you will get errors about the fact that all global variables of Base are now created twice for that one item/character. By changing the "USING Base" to "USING SHARED Base", you can tell the behaviour script system to instead share the copies of those global variables with other scripts. The script compiler gives a hint about this when it detects duplicate global variables.

In case of a game script, you don't assign them to characters or items, but to mods. Since they don't belong to an individual object, all of their variables are global (including the ones locally defined in events). So if you have multiple mods with gamescripts that define the same events with the same variables, the hint kicks in like before. However, in this case it does not make sense and you cannot fix anything this way.

Back to your original question, I made a mistake. You can override Osiris/Story scripts by including a script with the same name in your mod. However, you cannot do this with item/character/game scripts. The reason is that these are not looked for based on their name, but based on the UUID of their resource. So you are now including both the original game script and your own, which is causing the conflicts (and which is not what you want).

UUIDs are how most objects in the game are resolved, such as characters and items. The way to override these, is to include an object of the same type with the same UUID as the original one. That's what the editor does when you modify e.g. a character from the DivinityOrigins mod in your own mod: it creates a copy of the original character with the same UUID in your mod, and then stores your changes in this copy.

In theory, you should be able to do the same with the resource of the game script: go to the resource manager, find the resource for the game script you want to override, edit it, and set your own game script as the script it should use. However, I've heard this is currently not working. They are looking into why that is the case. Sorry I don't have better news.


Moderated by  Larian_KVN 

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