Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Making a minion benefit from master's feats (http://forums.wolflair.com/showthread.php?t=58771)

TheIronGolem July 14th, 2017 10:03 AM

Making a minion benefit from master's feats
 
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:

Quote:

~ 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?

Mathias July 14th, 2017 12:10 PM

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).

TheIronGolem July 14th, 2017 12:50 PM

Okay, that makes sense.

ShadowChemosh July 14th, 2017 01:22 PM

Quote:

Originally Posted by TheIronGolem (Post 252699)
the sort of thing that makes ShadowChemosh appear in your bathroom mirror right before you're never heard from again.

LOL Nice! :p :p :eek: :D


All times are GMT -8. The time now is 03:57 PM.

Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.