Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2017
N
Navan Offline OP
stranger
OP Offline
stranger
N
Joined: Sep 2017
Is there a way to change/switch stats temporary.
I would like to implement a skill which switches Finesse and Intelligence for 2 turns.

Is that possible ?

Joined: Jul 2014
Location: East Coast
journeyman
Offline
journeyman
Joined: Jul 2014
Location: East Coast
The only way I can think of to do this currently is to create, say, 200 statuses. 100 for -Int/+Finesse and 100 for +Int/-Finesse. Make sure to delete the icons associated with these stats and potion effects.

Then lookup the characters Finesse and Int when the status is applied and determine which is greater and the difference and apply the appropriate status.

When the main status (the one the ability you are making applies) wears off, remove these as well. Make sure you store the name of the hidden status you applied so you don't need to figure it out again.

If this skill is ever used in a context where it's possible to get a differential of 100+ stats, you either need to make more statuses or put in the skill "This ability will only swap, at most, 100 points".

I'm not joking : (

Last edited by Sinistralis; 08/10/17 11:59 PM.
Joined: May 2017
enthusiast
Offline
enthusiast
Joined: May 2017
Sinistralis' way is good if you want to drive yourself mad, haha. That's what I did at first for my Civil Auras mod. Then I wised up and figured out a way to use the following functions in Osiris:
Code
CharacterGetAbility
CharacterAddAbility
CharacterRemoveAbility
CharacterGetAttribute
CharacterAddAttribute
CharacterRemoveAttribute

The key is to store the Player and Bonus amount in a database, so you can remove it later. I used a CharacterStatusApplied and CharacterStatusRemvoed to trigger when to apply/remove the bonuses.

Joined: Jul 2014
Location: East Coast
journeyman
Offline
journeyman
Joined: Jul 2014
Location: East Coast
This is news to me. I've never called these attributes or abilities, only stat points. Explains why I could never find a way to do this.

What is the difference between attribute and getStat?

Last edited by Sinistralis; 09/10/17 01:08 AM.
Joined: Mar 2016
Location: Belgium
T
addict
Offline
addict
T
Joined: Mar 2016
Location: Belgium
The calls mentioned by LaughingLeader, such as CharacterGetAttribute, are for Osiris scripting. GetStat is a behaviour script call, which can also request attribute values along with others. I'm not sure whether there's a behaviour script to change an attribute value, but you can do it from Osiris (using the Set calls mentioned above).

Last edited by Tinkerer; 11/10/17 07:01 PM.
Joined: Sep 2017
N
Navan Offline OP
stranger
OP Offline
stranger
N
Joined: Sep 2017
So my first try looks something like this:

Editor (Screenshot):
[Linked Image]


Activate Passive (Code):
Code
// USE (Finesse bigger than Intelligence)
IF
CharacterStatusApplied((CHARACTERGUID)_Player, "EA_STATSWITCH", _)
AND
DB_IsPlayer(_Player)
AND
CharacterGetAttribute(_Player, "Finesse", _PlayerFinesse)
AND
CharacterGetAttribute(_Player, "Intelligence", _PlayerIntelligence)
AND
_PlayerFinesse > _PlayerIntelligence
AND
IntegerSubtract(_PlayerFinesse, _PlayerIntelligence, _Bonus)
THEN
CharacterRemoveAttribute(_Player, "Finesse", _Bonus);
CharacterAddAttribute(_Player, "Intelligence", _Bonus);
EA_ClearStatSwitchBonus(_Player);
DB_EA_StatSwitchBonus(_Player, _Bonus);

//USE (Finesse smaller than Intelligence)
IF
CharacterStatusApplied((CHARACTERGUID)_Player, "EA_STATSWITCH", _)
AND
DB_IsPlayer(_Player)
AND
CharacterGetAttribute(_Player, "Finesse", _PlayerFinesse)
AND
CharacterGetAttribute(_Player, "Intelligence", _PlayerIntelligence)
AND
_PlayerFinesse < _PlayerIntelligence
AND
IntegerSubtract(_PlayerIntelligence, _PlayerFinesse, _Bonus)
THEN
CharacterRemoveAttribute(_Player, "Intelligence", _Bonus);
CharacterAddAttribute(_Player, "Finesse", _Bonus);
EA_ClearStatSwitchBonus(_Player);
DB_EA_StatSwitchBonus(_Player, _Bonus);


Deactivate Passive (Code):
Code
//REMOVE (Finesse bigger than Intelligence)
IF
CharacterStatusRemoved((CHARACTERGUID)_Player, "EA_STATSWITCH", _)
AND
DB_IsPlayer(_Player)
AND
CharacterGetAttribute(_Player, "Finesse", _PlayerFinesse)
AND
CharacterGetAttribute(_Player, "Intelligence", _PlayerIntelligence)
AND
_PlayerFinesse > _PlayerIntelligence
AND
DB_EA_StatSwitchBonus(_Player, _Bonus);
AND
_Bonus > 0
THEN
CharacterRemoveAttribute(_Player, "Finesse", _Bonus);
CharacterAddAttribute(_Player, "Intelligence", _Bonus);


//REMOVE (Finesse smaller than Intelligence)
IF
CharacterStatusRemoved((CHARACTERGUID)_Player, "EA_STATSWITCH", _)
AND
DB_IsPlayer(_Player)
AND
CharacterGetAttribute(_Player, "Finesse", _PlayerFinesse)
AND
CharacterGetAttribute(_Player, "Intelligence", _PlayerIntelligence)
AND
_PlayerFinesse < _PlayerIntelligence
AND
DB_EA_StatSwitchBonus(_Player, _Bonus);
AND
_Bonus > 0
THEN
CharacterRemoveAttribute(_Player, "Intelligence", _Bonus);
CharacterAddAttribute(_Player, "Finesse", _Bonus);




I looked up the scripts from your Civil Auras to understand how they are supposed to look.

Now is my next question do i need to build the whole story under File -> Build ? Because if i try i get some random error unrelated to my mod.

And if not, is it enough to just implement a passive skill (buff/debuff) named "EA_Statswitch" in my case or is it something beside the name of the passive skill i have to change ?

P.S: I can't get it to run, implemented the passive ability but nothing happens. Do i have to initiate the scripts somehow ?

Last edited by Navan; 13/10/17 11:07 AM.

Moderated by  Larian_KVN 

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