• 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

Conditional Portal

MagicSN

Well-known member
Hello!

For my D&D 5e Datafiles I need a "Conditional Portal", what I mean is this: A portal where the user can choose spells should only be visible if the character has a specific ClassFeat (a specific thing). If not visible should be put to 0.

I tried to implement the following way in the <layout>:

foreach pick in hero
if (eachpick.tagis[thingid.fWBkAn]<>0) then
portal[clBoS].visible = 1
endif
nexteach

But this seems to get ignored (as if the Feat would not be present!)

Interestingly even checking for thingid.clsWarl (the Warlock class) does not work, while

perform state.clearfocus
perform hero.findchild[Class].setfocus
if (state.isfocus=0) then
if (compare(focus.field[name].text,"Warlock")=0) then

actually works !!! Sadly for the checking of the Feat I cannot do something like this string comparision (which works in other cases).

Anybody got a hint for me how I can solve the problem ? (Currently in my datafiles the Book of Ancient Shadows Ritual list is ALWAYS displayed, and a text tells the user if he is allowed to use this list or not - this is of course not a good solution, making it visible/invisible based on if he has the feat would be better).

Thanks in advance!

Best regards,
MagicSN
 
Couldn't you set a prereq on the spells that requires the feat and just show them all? Then the ones they can't take will be grayed out.
 
Couldn't you set a prereq on the spells that requires the feat and just show them all? Then the ones they can't take will be grayed out.

I'd say it would be still confusing that this UI Element appears when there should be none there. It might be a solution, but it is not a nice-looking one.
 
On whatever causes this portal to show, assign a tag to the hero when you want the portal shown:

Code:
perform hero.assign[Hero.Some tag that means to show this portal]

Then, in the position script, look for that tag:
Code:
if (hero.tagis[Hero..Some tag that means to show this portal] = 0) then
  portal[whatever].visible = 0
  endif
 
On whatever causes this portal to show, assign a tag to the hero when you want the portal shown:

Code:
perform hero.assign[Hero.Some tag that means to show this portal]

Then, in the position script, look for that tag:
Code:
if (hero.tagis[Hero..Some tag that means to show this portal] = 0) then
  portal[whatever].visible = 0
  endif

Ah thanks, this did the trick ;-)

Best regards,
MagicSN
 
Back
Top