![]() |
Junior Member
Join Date: Oct 2022
Posts: 1
|
I'm attempting to create a Class Special for a homebrew class that allows the user to select 2 out of 4 spells on a fighter-type class that they'll be able to use.
While attempting to create the Eval Rule script to check that the user hasn't selected the same spell twice, I kept coming up against a syntax error that seems to be in error itself. According to Mathias in another thread, I should legitimately be able to have multiple conditionals for my validif statement while using a tagexpr[] Quote:
Code:
validif (field[usrChosen1].ischosen + field[usrChosen2].ischosen < 2) ~ Check for duplicate selection validif (tagexpr[count:Kami.spAugury < 2 & count:Kami.spDeteEvil < 2 & count:Kami.spSpeaDead < 2 & count:Kami.spSpeaPlan < 2]) Which would produce the following error while testing/compiling: PHP Code:
When I tried this variation: Code:
validif (field[usrChosen1].ischosen + field[usrChosen2].ischosen < 2) ~ Check for duplicate selection validif (tagexpr[tagcount[Kami.spAugury] < 2 & tagcount[Kami.spDeteEvil] < 2 & tagcount[Kami.spSpeaDead] < 2 & tagcount[Kami.spSpeaPlan] < 2]) PHP Code:
Code:
validif (field[usrChosen1].ischosen + field[usrChosen2].ischosen < 2) ~ Check for duplicate spell selection if (tagcount[Kami.spAugury] >= 2) then @valid = 0 elseif (tagcount[Kami.spDeteEvil] >= 2) then @valid = 0 elseif (tagcount[Kami.spSpeaDead] >= 2) then @valid = 0 elseif (tagcount[Kami.spSpeaPlan] >= 2) then @valid = 0 else @valid = 1 endif ![]() As an additional (related) matter - am I correct in that there is no way to place a bootstrap conditional on the spells so only the 2 that the user has selected will show? From what I've been reading, the conditionals get checked way before my custom tags would be assigned from the user selections of the spells. If anyone can think of a magical answer to make this work, I'd appreciate being pointed in the right direction |
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|