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.