Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Aug 2014
old hand
OP Offline
old hand
Joined: Aug 2014
We can add new talents, attributes, and combat abilities through story scripting! Naturally, this is a workaround, so it does not use existing UI or anything. But the mere possibility is relieving. I had an inkling this was possible, and finally found the right story calls to make possible, thanks to Tinkerer and Norbyte.

The basic idea is a story script that on some kind of trigger, check if you have available talent, ability, or attribute points, and if you do, then cause some kind of effect and remove these points. For example:

Code
IF
CharacterUsedItemTemplate((CHARACTERGUID)_Player,"SKILLBOOK_MetaMagic_31ef33be-86dd-4584-90b7-9981bab237d9",_)
AND
CharacterGetTalentPoints(_Player,(INTEGER)_Int)
AND
_Int > 0
THEN
CharacterAddTalentPoint(_Player,-1);
CharacterAddSkill(_Player,"Target_MetaMagic");


As you can probably guess, I'm considering adding a "Meta Magic" talent/skill, which will let you cast spells in a way that does not affect allies, for example. This will require a lot of additional scripting, of course.

The standard trigger for this sort of thing will probably be "Talent Books." But you could also create special trainers, quest rewards, or what have you, to grant custom talents, abilities, or attributes.

Code
IF
CharacterUsedItemTemplate((CHARACTERGUID)_Player,"SKILLBOOK_NewAbility_31ef33be-86dd-4584-90b7-9981bab237d9",_)
AND
CharacterGetAbilityPoints(_Player,(INTEGER)_Int)
AND
_Int > 0
THEN
CharacterAddAbilityPoint(_Player,-1);
SetVarInteger(_Player,"NewAbilityAdd",1);


Then you'd trigger some kind of ability value check in your character script. Could easily be all done in story scripting too. You'd have to script some kind of effect that goes with this talent, and if you wanted to attach skills to it, you might have to make custom skillbooks with slightly different behavior. Unfortunately, we will still have to use existing ability trees for the actual skilldata entries to sort them in the skill UI and provide attribute scaling, but your custom ability could do all things to affect your new skills behind the scenes.

The same thing can be done with attributes with:

CharacterGetAttributePoints(_Player,(INTEGER)_Int)
AND
_Int > 0
THEN
CharacterAddAttributePoint(_Player,-1);


The one thing that doesn't appear possible is adding new civil abilities, because there doesn't appear to be civil ability checks or calls. But maybe I haven't found them, or is something we can expect to be added.

I'm pretty happy this is possible. It's not the most ideal solution, but it's a more than serviceable workaround. I haven't done ultra extensive testing, so hopefully there aren't any major bugs, but it appears to work fine so far.

Joined: Sep 2017
D
stranger
Offline
stranger
D
Joined: Sep 2017
I've always been a level designer, so scripting is a pretty new concept to me (I took a few c++ classes back in college though). Using this method would it be possible to add new skill schools that you could level? (such as Aerothurge, Warfare, etc.)

I'd like to add custom skill schools that you need to level to use new spells I am working on.

Joined: Jan 2010
Location: USA
F
enthusiast
Offline
enthusiast
F
Joined: Jan 2010
Location: USA
CharacterAddSkill() does not add the skill as an equippable skill? In the case of talents, I don't understand how the function knows the skill you're adding is meant to apply a passive effect.

And would I be correct that this workaround does not add the skill as a talent on the Talents screen?

Joined: Aug 2014
old hand
OP Offline
old hand
Joined: Aug 2014
Originally Posted by Danatoth
I've always been a level designer, so scripting is a pretty new concept to me (I took a few c++ classes back in college though). Using this method would it be possible to add new skill schools that you could level? (such as Aerothurge, Warfare, etc.)

I'd like to add custom skill schools that you need to level to use new spells I am working on.


Yes you could add a custom skill school, but you'd probably have to script the skillbooks to require your ability to learn. This would not be that hard. And again, you wouldn't be able to add a new ability UI element for the skills window ingame, so you'd have to piggyback off an existing skill tree for that. But functionality it would mostly be based off your own scripted effects.

Originally Posted by fireundubh
CharacterAddSkill() does not add the skill as an equippable skill? In the case of talents, I don't understand how the function knows the skill you're adding is meant to apply a passive effect.

And would I be correct that this workaround does not add the skill as a talent on the Talents screen?


That was just an example of using a talent point to add a special (extra powerful) skill. It would not be a passive effect like most talents, no, but I don't feel like talents necessarily have to be entirely passive.

Joined: Jan 2010
Location: USA
F
enthusiast
Offline
enthusiast
F
Joined: Jan 2010
Location: USA
Is there a way to give an item you're carrying a passive ability? Are there any items that do that now? Because there's a "Hidden" Inventory Tab, so if carrying an item can have a passive effect, you can just add that "hidden" item to the character's inventory to mimic a passive talent.


LSLib Contributor | My Mods: DOS2, DOS2DE | 560K Steam Workshop Subscribers
Joined: Aug 2014
old hand
OP Offline
old hand
Joined: Aug 2014
You could also just set a variable in a character or story script. It all depends on what you're trying to do with your talent. All my script does is basically give a way into using talent points to initiate some kind of effect, which you can catch in other scripts to do just about anything.

Last edited by Baardvark; 25/09/17 05:20 AM.
Joined: Sep 2017
Z
stranger
Offline
stranger
Z
Joined: Sep 2017
I'm glad my ideas were on the right track and that this is actually doable. I can't wait to see new custom classes all around the workshop!

Also, thank you for your recent update on the wiki. I'll wait on your next update to the Bard class so I can get started on my Martial Artist (using yours as a template if you don't mind).

Joined: May 2017
enthusiast
Offline
enthusiast
Joined: May 2017
Awesome stuff Baardvark! Thanks for sharing this.

Originally Posted by fireundubh
Is there a way to give an item you're carrying a passive ability? Are there any items that do that now?

Not sure what you mean by "passive", but you can add skills and talents to equipment purely with stats. As an example, adding "Target_FaceRipper" to the "Skills" field in a Weapon stat grants you that ability when equipped.

Joined: Jul 2017
W
enthusiast
Offline
enthusiast
W
Joined: Jul 2017
See. I knew not to doubt out awesome modders.

Joined: Aug 2014
old hand
OP Offline
old hand
Joined: Aug 2014
Added this to the wiki, with another example.

https://docs.larian.game/Scripting_in_New_Talents,_Attributes,_and_Combat_Abilities

Joined: May 2017
enthusiast
Offline
enthusiast
Joined: May 2017
Ooh. Tasty info. Now I'm wondering if I should have used CharacterUsedItemTemplate((CHARACTERGUID)_Player,"ITEM_GUID",_) for my elixirs instead of attaching a script to them, haha.

Joined: Jan 2010
Location: USA
F
enthusiast
Offline
enthusiast
F
Joined: Jan 2010
Location: USA
Originally Posted by LaughingLeader
Not sure what you mean by "passive", but you can add skills and talents to equipment purely with stats. As an example, adding "Target_FaceRipper" to the "Skills" field in a Weapon stat grants you that ability when equipped.

Active abilities are hotbar skills. You have to click a button or press a key to apply their effects.

Passive abilities are attributes, combat skills, civil skills, and talents. Once you have them, they apply their effects until you have them no longer.

Charms in Diablo II, for example, are passive abilities implemented as items. They are functionally the same as any other passive ability; you just use a different UI to manage them.

Joined: Sep 2017
D
stranger
Offline
stranger
D
Joined: Sep 2017
This has been such a hugely requested feature, probably more than anything else. If anyone could be as kind enough to possibly make a short youtube video on how exactly you go about this (for us people that are more into other aspects of modding and need help with scripts) it would be greatly appreciated by a ton of people!

Joined: Sep 2017
J
stranger
Offline
stranger
J
Joined: Sep 2017
Can you add or change properties to an entire class of weapon? Rather than edit individual weapons? For example, making all daggers do Piercing damage? Or make all shields do damage?

Likewise, change the amount of Armor on a type of armor by a %, rather on a case-by-case basis?

Last edited by John Doe; 26/09/17 11:13 AM.
Joined: Mar 2014
old hand
Offline
old hand
Joined: Mar 2014
Does this mean editing starting talents is possible?

So we can start with one talent and get to decide two in the character creation.
And could we get more talents and choose them more often at level up? So lets say we get a talent every three levels?

I mention this several times but i feel like only one talent should be predetermined at the start, only those which are race specific. Lizards could have something like regenerating health instead of dragon breath, btw. Regenerate 1-2 hp for three turns, maybe remove some softer CC effect too.
Or maybe a tail strike-swish - can hit multiple enemies at close range, sort of thing.

Dragon breath then could be made into a Pyro skill.





Moderated by  Larian_KVN 

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