Senior Member
Join Date: Feb 2015
Posts: 676
|
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:
|
|
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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).
|
#2 |
Senior Member
Join Date: Feb 2015
Posts: 676
|
Okay, that makes sense.
|
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
LOL Nice!
Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#4 |
|
|