Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2017
R
Rayner Offline OP
apprentice
OP Offline
apprentice
R
Joined: Sep 2017
I'm interested in making a mod that would allow civil abilities, particularly Bartering and Lucky Charm, to be "shared" between all characters in the party, such that the highest skill on any one character is used when selling/looting/etc. on any other character.

This is obviously to cut down on the tedium of having to use a dedicated "barter" character or a "loot" character. You would still need to invest the points somewhere in your party, but you wouldn't have to remember to switch over to them every single time you sold something or looted something.

I haven't done much game modding, but if this were (for instance) Skyrim, I'd expect to go looking for a function in a script somewhere that handled the looting and simply edit it a bit. For instance, I'd expect to find something like this:

do_loot(params){
extra_loot_chance = actor.stats.lucky_charm / 10
...
}

And simply edit it to loop through all characters in the party, find the highest Lucky Charm stat, and simply use that value in the function's calculation instead.

Am I on the right track with this line of thinking for this game, or should I be looking in another direction?

Where are the scripts for this game anyway? I'm in the script editor going through my game folder and I can't find any scripts in any folder to open and edit.

Thanks!

Joined: Sep 2017
R
Rayner Offline OP
apprentice
OP Offline
apprentice
R
Joined: Sep 2017
Any thoughts? I'm still unable to find the scripts for this game to even look through, unfortunately.

Joined: Jan 2011
old hand
Offline
old hand
Joined: Jan 2011
If you are wanting a script to automatically do that, currently over my pay grade, but that would be super cool.

Character.txt stores the base values.

EX:
new entry "CasualPlayer"
data "Loremaster" "2"
data "Repair" "2"
data "Barter" "2"
data "Persuasion" "2"
data "Luck" "2"

For example, lets say your highest player currently has 2 points in all of these. Go here put 2 points in and now all will match.

I totally get your point and I agree. I'd like the system to have an option where the top skill is used as a QoL feature.

I hear these values can now be changed in the editor, I haven't made my way there yet.

Last edited by Horrorscope; 21/09/17 12:25 AM.
Joined: Jul 2014
S
stranger
Offline
stranger
S
Joined: Jul 2014
Consider to make an aura (like Leadership) with + Barter/Persuation/etc.
Don't know if it's possible technically at all thought.
We were given only Data.txt to tweak Attributes/Skills in some hardcoded way.
The same situation as with D:OS, alas... hoping, only for now.

Joined: Sep 2017
R
Rayner Offline OP
apprentice
OP Offline
apprentice
R
Joined: Sep 2017
[quote=Horrorscope]For example, lets say your highest player currently has 2 points in all of these. Go here put 2 points in and now all will match.[/quote]I'm a little confused, is this describing the values of an individual character in a specific save game file that I'd be editing?

[quote=Samael187]Consider to make an aura (like Leadership) with + Barter/Persuation/etc.
Don't know if it's possible technically at all thought.
We were given only Data.txt to tweak Attributes/Skills in some hardcoded way.
The same situation as with D:OS, alas... hoping, only for now. [/quote]I wouldn't be against making it a skill if that is the only option. This page:

https://docs.larian.game/Skill_creation

Describes the functionality of a skill mostly by the Skill Properties field, which appears to be a limited list of existing capabilities. And "give all characters in the party a buff to Bartering and Lucky Charm based on the highest value of each stat any character in the party has" is probably not an existing Skill Property to pull from.

That page also mentions this:

[quote]While the skill creator is quite powerful, complex skills may require scripting.[/quote]

and

[quote]Entry, a unique name so that the skill can be referenced in scripts or other locations.[/quote]

Which insinuates that there is a way to add scripting logic to spells, though I can't find out any more information about that.

Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
A skill could indeed provide a civil ability aura. You'd have to apply the appropriate aura for the ability level, which would require some scripting. The kind of scripting you'd do would be something like:

EVENT
VARS
INT:_Barter
STATUS:_BarterStatus
ON
OnSkillCast(__Me,"Shout_BarterShare")
ACTIONS
IF "c1&c2"
CharacterGetStat(_Barter,__Me,Barter)
IsGreaterThen(_Barter,0) // Yes, then, not than :P
THEN
Add(_Barter,-1) // index of GetElement starts at 0
GetElement(_BarterStatus,_Barter,"Barter1Share","Barter2Share","Barter3Share","Barter4Share","Barter5Share")
CharacterApplyStatus(__Me,_BarterStatus,-1,1)
ENDIF

This script basically checks the caster's barter skill, and then if it's greater than 0, it gets the appropriate status through GetElement. GetElement picks the status, using _Barter as an index. GetElement starts the index at 0, meaning an index of 0 = Barter1Share, 1 = Bart2Share. Hence the need to subtract 1 from _Barter.

You'd place this event in the Player.charScript or Base.charScript and create a skill named BarterShare which wouldn't really do anything in itself. I'm probably using GetElement slightly wrong, so don't expect that to work perfectly as I posted it.

Then you'd create 10 different statuses, 5 Barter Auras, and 5 +Barter statuses that these barter auras provide.

It would all be a bit clunky, but could work. You'd have to cast the barter skill every time you get an additional barter point, but it'd be permanent otherwise.

There are probably other, better ways to go about this as well, but not positive.

I'm going to release a reworked lucky charm sometime in the future which makes lucky charm provide additional loot from combat, removing the aspect of +loot from objects, making the need for a designated looter moot.

You can see what's available for char scripts in this thread:

http://larian.com/forums/ubbthreads.php?ubb=showflat&Number=605357#Post605357

Last edited by Baardvark; 21/09/17 05:23 AM.
Joined: Sep 2017
R
Rayner Offline OP
apprentice
OP Offline
apprentice
R
Joined: Sep 2017
Thanks Baardvark, that really helped.

One thing I'm not sure about is how to make this apply to party members, but not the caster (because the caster doesn't need to buff their own stat, only share it).

It seems like I would need to do something like this:

CharacterApplyStatus(__Me,_BarterStatus,-1,1)

But instead of passing in __Me, pass in each party member. Do you know how I get/reference each party member?

Joined: Aug 2014
old hand
Offline
old hand
Joined: Aug 2014
Well I meant make an aura that gives your allies barter, but the aura itself doesn't give the character that already has barter more barter. But a more simple (and less restrictive) way to do it would be to just have a group buff skill that applies a "dummy" status that doesn't do anything in itself, but is used to check for Barter.

EVENT
VARS
INT:_Barter
CHARACTER:_Source
STATUS:_BarterStatus
ON
OnCharacterStatusApplied(__Me,BARTERCHECK)
ACTIONS
IF "c1&c2&c3"
CharacterGetStatusSourceCharacter(__Me,BARTERCHECK,_Source)
CharacterGetStat(_Barter,_Source,Barter)
IsGreaterThen(_Barter,0)
THEN
Add(_Barter,-1) // index of GetElement starts at 0
GetElement(_BarterStatus,_Barter,"Barter1","Barter2","Barter3","Barter4","Barter5")
CharacterApplyStatus(__Me,_BarterStatus,-1,1)
ENDIF


Moderated by  Larian_KVN 

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