• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Making a minion benefit from master's feats

TheIronGolem

Well-known member
I'm implementing a series of feats that a character can take to give bonuses to certain minions.

The way I did this at first was to use a foreach loop to look for qualifying minions and apply the effects. This works, but I don't like doing it. I've got several such feats and having them all iterate through every minion on a pet-heavy character is the sort of thing that makes ShadowChemosh appear in your bathroom mirror right before you're never heard from again.

So instead I created a Simple object to act as a helper, bootstrapped that to the minion, and moved the feats' logic to that helper (one script for each feat it implements). Here's an example what that looks like:

~ This script only runs for minions
doneif (hero.isminion <> 1)

~ Stop if the master doesn't have the feat we're looking for
perform master.findchild[BaseFeat, "IsFeat.myFeatID & !Helper.FtDisable & !Helper.SpcDisable"].setfocus
doneif (state.isfocus <> 1)

~ do stuff ~

The problem with this approach is that it keeps up with adding/removing the feat, but not with disabling/reenabling it (say, via the "Feat/Trait Disable" Adjustment) unless I reload the system or trigger a full evaluation. I'm not sure why. Doesn't seem like a matter of my script running too early or else it would never work. Is there some aspect of the master/minion loading order that I'm not accounting for?
 
Very little is recalculated on characters other than the currently active character when something changes on the active character, because otherwise, the 20-drone rigger characters in Shadowrun can take noticeable numbers of seconds to respond to every change. So if this is a script running on something on a character other than the currently active one, it will be skipped until that is the active character (or until there's a full evaluation, which happens either when triggered or when first loading the portfolio).
 
Back
Top