• 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

Template with abilities dependent of base creature

frumple

Well-known member
I am trying to code a template which grants different abilities depending on what the base creature is.

For instance if the base creature is a Cloud Giant, the template grants sonic 10 resistance.

In the template I have the following code to assign a custom tag:

First/100
if (hero.tagcount[IsRace.rClouGiant] <> 0) then
perform hero.assign[Custom.CloudGiant]
endif

and the sonic resistance has the condition

First/450
Custom.CloudGiant

However, for some reason the script is not assigning the Custom.CloudGiant tag to the hero when I try to apply it to a cloud giant. Ideas?
 
All energy resistances (and all DRs, and SR) are on all characters. Why bootstrap what's already there?

How about this script:
(before Final/something - Pre-Levels/10000 is a good default for this sort of thing)

Code:
if (hero.tagis[IsRace.rClouGiant] <> 0) then
  #applyresist[xDamRdSoni,10]
  endif

That way, you can skip creating all those Custom tags.
 
If that was all I was trying to do that would be great. Indeed for some of the races this template affects that is perfect. However I just found out things are a bit more complex.

Some of the things I want to bootstrap with a condition are racial specials (such as breath weapons, and some custom racial abilities). So I assign my tags on First/600, and my put my conditions at First/601. However, with racial specials I get the errors saying that a racial special cannot have a bootstrap condition later than First/100. This of course puts me in a catch-22 since I cannot assign the tag until after First/590 when the IsRace tags are copied over.
 
hero.findchild[BaseRace].tagis[IsRace.rClouGiant] <> 0

Like I said - the IsRace tags aren't copied from the race to the hero until First/590. Before then, you'll have to look them up on the race itself (they are present on the race before the phase & priority sequence starts).
 
If you've got lots of races to test:

Code:
perform hero.findchild[BaseRace].setfocus
doneif (state.isfocus <> 0)
 
if (focus.tagis[IsRace.rClouGiant] <> 0) then
  ~do something
elseif (focus.tagis[isRace.something else] <> 0) then
  ~do something else
  endif
 
Back
Top