• 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

Removing racial abilities

Sendric

Well-known member
I am working on a template that removes racial abilities (such as the Dwarf's Sturdy ability or an Elf's Immunity to Sleep), and I've hit a snag. This is what I have at the moment:

Code:
   var race as string
   var srchxpr as string
   perform hero.findchild[BaseRace].setfocus
   race = focus.idstring
   srchxpr = "SpecSource." & race
   debug srchxpr

   foreach pick in hero from BaseSpec where srchxpr
    perform eachpick.delete[Helper.ShowSpec]
   nexteach

The problem I'm running into is that the race variable is returning a value that doesn't really help. For example, if my character is an Elf, its returning Elf2. This results in none of the racial abilities being removed because all of them use the tag SpecSource.Elf not SpecSource.Elf2. Is there another way to find the race, perhaps using the Race.? tags?
 
srchexpr = focus.tagids[SpecSource.?,"|"]

Ah, yes. Thank you very much. That certainly helps with the above scenario of the Elf. However, it doesn't seem to resolve other issues, such as alternate races. For example, the Wavecrest Gnome was entered by a user. It counts as a Gnome, and gains most (if not all) of the usual Gnome abilities. This search only comes up with SpecSource.rGnomeWave, and does not include .rGnome. Is there a way to include the races checked in the "Counts as Race..." selection field?
 
Last edited:
Another thing you might want to consider, especially with racial abilities that actually add something to the hero. Deleting the Helper.ShowSpec only keeps it from appearing in the list of specials, but does not keep any scripts or bootstraps from being used. Just a heads up, as I've run into this myself (and thus, usually place a conditional to run a script or apply a bootstrap only if the Helper.ShowSpec is present).
 
Another thing you might want to consider, especially with racial abilities that actually add something to the hero. Deleting the Helper.ShowSpec only keeps it from appearing in the list of specials, but does not keep any scripts or bootstraps from being used. Just a heads up, as I've run into this myself (and thus, usually place a conditional to run a script or apply a bootstrap only if the Helper.ShowSpec is present).

Thanks for the reminder. That was something I figured I would tackle after I get the initial part working. It is definitely something to keep in mind, though.
 
Back
Top