Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Sep 2016
journeyman
OP Offline
journeyman
Joined: Sep 2016
Hey all! Been away from the D:OS 2 modding for a few months and I'm trying to jump back in with a project I've been wanting to make since release: a mod that spawns in voidwoken after players use source skills.

Given that my programming skills are pretty limited, I'd like to start off with a bit of community theorycrafting, so people can point out ways I might build this elegantly before I waste time building it hackily. If I had done the same thing with my first major project it might've saved me a lot of heartache.

A voidwoken spawner would be cool for a few reasons:

-Adding emergent challenges to otherwise static encounters.
-Adding a risk vs. reward dynamic to source usage, because powerful skills should come with powerful consequences: do I really want to cast Rain of Arrows if it could call a Harbinger of Doom down on me?
-Make good on a mechanic suggested by the plot (source drawing voidwoken) that's sadly only occurs in a few major plot encounters.

Off the top my head, here's how I would think to build it using the method I'm most comfortable with: applying and removing custom statuses via GameScript.

-Every time a party member's turn begins we run CharacterGetSourcePoints to return their current source level and apply an invisible status: Has1Source, Has2Source, or Has3Source.

-OnCharacterUsedSourcePoint(CHARACTER:character) triggers when they use a source skill, after which we run CharacterGetSourcePoints again, and subtract the new value from the last one to give them a new invisible status: Spent1Source, Spent2Source, Spent3Source, etc. Then we iterate all party members to add up the total number of source points spent so far (checking for SpentXSource on everyone) and make a roll based on it: let's say (PartySourceSpent x 10)/100.

-A successful IsRandom roll calls the voidwoken spawning function, which then populates a voidwoken pod that increases in number and difficulty based on PartySourceSpent. PartySourceSpent=1 might give you three voidlings, while PartySourceSpent=10 might give you a drillworm and two vampiric voidwoken. Said pod (hostile to all humans but ideally giving priority to targeting the party) is then spawned at a 10-20 meters from the party member that cast the triggering source skill.

(-It might be best to just have a visual indicator and sound cue play immediately, with some combat log text like 'a voidwoken roars in the distance,' and then wait till the start of the next combat round to actually spawn them, so they don't get immediate turns the player can't prepare for. Would be very cool to temporarily trigger the green lightning from the blackpits fight with more powerful pods, and the "voidwoken!" voice line from a random party member.)

-Reset spent source statuses on all party members and start all over.

Feeling pretty rusty after some months off but this is basically how I would start building it. If there's a way to just add to a counter tracking source spent that persists from turn to turn over the course of a battle rather than messily applying and adding up custom statuses, I'd be interested to see how that might work.

Looking for any and all feedback on my pseudo code. Contributors are also welcome if anyone wants to partner on this and share steam workshop authorship.

Last edited by smarmbot; 15/01/18 11:41 PM.
Joined: Sep 2016
journeyman
OP Offline
journeyman
Joined: Sep 2016
Номми from Discord recommends using a story code database to track source points spent:

Quote
IF
ObjectEnteredCombat(_charGUID)
AND
IsPartyMember(_charGUID, 1)
AND
getSuersePoint(_charGUID,_HasPoints) <--- need to check this API, just from head
AND
....
THEN
DB_SomePrefix_DatabaseName(_charGUID,_HasPoints,"") <---- leaving empty entry for points spent

Joined: Nov 2017
L
member
Offline
member
L
Joined: Nov 2017
I'm not really sure what the statuses add here that can't be obtained by querying the amount of Source Points a character currently has...

Joined: Oct 2017
journeyman
Offline
journeyman
Joined: Oct 2017
Querying the amount of Source a character has doesn't return how much they had before the last cast of a source skill. So, you need to keep track not only how much they have but how much they had so you can get how much was used.

Joined: Sep 2017
veteran
Offline
veteran
Joined: Sep 2017
Perhaps you could declare a Source Point counter used, using the already built in global counter system. Declare it upon combat start, use it to refer to how many points have been spent during that battle, and reset the counter at combat end?

Joined: Sep 2016
journeyman
OP Offline
journeyman
Joined: Sep 2016
Can you link me to any examples of the global counter system I might take a look at? Not familiar.


Moderated by  Larian_KVN 

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