Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
TheIronGolem
Senior Member
 
Join Date: Feb 2015
Posts: 676

Old July 14th, 2017, 10:03 AM
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?
TheIronGolem is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old 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).
Mathias is offline   #2 Reply With Quote
TheIronGolem
Senior Member
 
Join Date: Feb 2015
Posts: 676

Old July 14th, 2017, 12:50 PM
Okay, that makes sense.
TheIronGolem is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old July 14th, 2017, 01:22 PM
Quote:
Originally Posted by TheIronGolem View Post
the sort of thing that makes ShadowChemosh appear in your bathroom mirror right before you're never heard from again.
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.
ShadowChemosh is offline   #4 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:53 AM.


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