Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Redcap's Corner
Senior Member
 
Join Date: Jul 2010
Posts: 149

Old December 1st, 2014, 09:15 PM
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
So far no results have been yielded. Any thoughts on what I'm doing wrong?
Redcap's Corner is offline   #1 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old December 1st, 2014, 10:34 PM
Quote:
Originally Posted by Redcap's Corner View Post
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
So far no results have been yielded. Any thoughts on what I'm doing wrong?
The HasAbility tags are forwarded far too late to be useful in anything outside of validation elements such as expression requirements. You should be looking for Ability. tags instead, as those are forwarded early enough to work with.

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.
RavenX is offline   #2 Reply With Quote
Redcap's Corner
Senior Member
 
Join Date: Jul 2010
Posts: 149

Old December 2nd, 2014, 01:14 PM
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.
Redcap's Corner is offline   #3 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old December 2nd, 2014, 01:21 PM
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.
RavenX is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 2nd, 2014, 01:40 PM
As a note, state.isfocus is a line of code, not a tag, so you can't use it in a tag expression.
Mathias is online now   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old December 2nd, 2014, 02:08 PM
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.
Mathias is online now   #6 Reply With Quote
Redcap's Corner
Senior Member
 
Join Date: Jul 2010
Posts: 149

Old December 2nd, 2014, 02:31 PM
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.
Redcap's Corner is offline   #7 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:27 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.