|
|
Thread Tools | Display Modes |
Senior Member
Join Date: Jul 2010
Posts: 149
|
I have a non-unique custom ability (cEnsCoSpe), where the user has to pick a different creature type each time they select it. They choose from appropriate creature types, which are worked out and displayed in an array at First/500. That part's working. I've come up with the following evalrule at First/600:
Code:
if (hero.tagcount[HasAbility.cEnsCoSpe] > 1) then perform setfocus foreach pick in hero where "thingid.cEnsCoSpe & !state.isfocus" if (compare(eachpick.field[usrSelect].text, focus.field[usrSelect].text) <> 0) then @valid = 1 else @valid = 0 endif nexteach else @valid = 1 endif |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
Quote:
RavenX Pronouns: She/Her Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. |
|
#2 |
Senior Member
Join Date: Jul 2010
Posts: 149
|
Thanks! That's definitely useful to know. I've made that change, and am still playing around with other little tweaks, but the code still doesn't seem to be working. Is the "thingid.cEnsCoSpe & !state.isfocus" expression sound? Is setting a focus in order to exclude the live copy of the ability from the foreach statement a problem? I assume that foreach statements cycle through each search result one at a time, more or less independently, but I don't really know.
|
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
If this is a custom ability where the user has to select a creature type why aren't you just creating a configurable for it that uses creature types? Is this ability something that works like a ranger's favored enemy?
RavenX Pronouns: She/Her Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you. I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all. |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
As a note, state.isfocus is a line of code, not a tag, so you can't use it in a tag expression.
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
If this is referring to Creature Type, with a capital T, like Undead, Humanoid, Outsider, etc. I recommend just making a single user-once selection for each type.
Think about how many options you're offering - if it's less than around a dozen, I recommend letting the user just choose from among several pre-defined selections, instead of adding a selection, and then filling something in. |
#6 |
Senior Member
Join Date: Jul 2010
Posts: 149
|
That's definitely my fallback plan if I can't make this work, but I always hate those on the player end, so I'm trying to avoid it if possible. That's good to know about the focus issue. Maybe instead of using setfocus I should try assigning a custom tag.
|
#7 |
|
|