• 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

Templates removing subtypes

frumple

Well-known member
I am having trouble with templates removing subtypes, specifically all things that are bootstrapped by a subtype.

I was trying the following script

Code:
foreach thing in BaseRace where "Race.stSwarm"
  foreach bootstrap in eachthing
   perform eachthing.assign[Helper.SpcDisable]
  nexteach
nexteach

but I cannot get it to work. Advice?
 
Hmm, we have template tags that remove/replace the old types, but no mechanism to futz with subtypes.

Subtypes don't have the BaseRace component, and races don't normally have the race tags for their subtypes/types so I think your first foreach is going to the wrong place.

I'd do a foreach through picks and then if their root is the swarm subtype, disable them. That way you don't have to nest foreaches, which is not ideal.

Something like this. Not tested, no quality assurances made.

Code:
foreach pick in RaceAbil
  if (eachpick.root.tagis[Race.stSwarm] <> 0) then
    perform eachpick.assign[Helper.SpcDisable]
    perform eachpick.assign[Hide.Special]
    endif
  nexteach
 
Got it sort of working with the following modification

Code:
foreach pick in hero from RaceAbil
  if (eachpick.root.tagis[Race.stSwarm] <> 0) then
    perform eachpick.assign[Helper.SpcDisable]
    perform eachpick.assign[Hide.Special]
  endif
nexteach

However, I get a bunch of "Cannot reliably access bootstrap source" errors.
 
Hmm. Try adding another layer to the ifs, checking if there is a root beforehand

Code:
foreach pick in hero from RaceAbil
  if (eachpick.isroot <> 0) then
    if (eachpick.root.tagis[Race.stSwarm] <> 0) then
      perform eachpick.assign[Helper.SpcDisable]
      perform eachpick.assign[Hide.Special]
      endif
    endif
  nexteach
 
... nope doesn't work at all.

looks like it picks everything but things from the subtype. The funny thing is that if I set eachpick.isroot = 0 it does select the right picks, but then I get the errors from before.

Looks like I am going to have to do it the hard way (disabling each thing separately).

Maybe a future enhancement in HL for a tag that disables a thing (or prevents it from being bootstraped) and everything it bootstraps? It would make it simpler for templates and adjustments if there was such a thing.
 
Looks like I figured out part of it. The following goes through all things bootstrapped by a subtype and items bootstrapped by those, but the perform statements return a syntax error.

Code:
perform hero.child[stSwarm].setfocus

foreach bootstrap in focus
  foreach bootstrap in eachthing
    perform eachthing.assign[Helper.SpcDisable]
    perform eachthing.assign[Hide.Special]
  nexteach
 perform eachthing.assign[Helper.SpcDisable]
 perform eachthing.assign[Hide.Special]
nexteach  

perform state.clearfocus
 
eachthing.assign is not allowed - "foreach bootstrap" is looking at the database entry for that item, not the real version that's been added to your character, and the database of potential things can't be modified.
 
Back
Top