• 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

Character Creation Tag?

zarlor

Well-known member
One thing I haven't implemented in the Pirates of the Spanish Main and 50 Fathoms files is that a starting character may ignore the Seasoned rank requirement on an Edge at character creation. Mainly because I wasn't sure how I would implement something like that. However, some folks here might have some ideas on that.

Is there a tag we can reference to denote if a character is in Character Creation mode as opposed to Advancement mode? And if so, how would I use that to get an Edge to ignore the Rank requirement? (A coding example would be preferable, if possible.)
 
This should do it...

validif (state.iscreate <> 0)

The tag you're looking for on the Rank requirement is:

Helper.IgnoreRank
 
Ok, you've kind of lost me. I'm assuming I could put validif (state.iscreate <> 0) as either a Pre-Req or Expr-Req, but how do I get it to override the Seasoned requirement? Would I modify the Tag for MinRank or am I adding a Tag for Group Helper TsagID IgnoreRank? I'm still floundering (I think we all are) when you give us generalization. We're having a hard time putting together how to implement a lot of the stuff you're telling us in general text when I think we all need more direct examples. :(
 
Forgive me, I was in an extreme hurry when I wrote that. Not your fault at all. Let me be actually helpful, now.

The "validif (state.iscreate <> 0)" clause can be used in an evalrule to check to see if the hero is in Creation mode. Like so:

Code:
<evalrule index="1" phase="Validate" priority="10000" message="?" issilent="yes"><![CDATA[
      validif (state.iscreate <> 0)
      ]]></evalrule>

But that's not helpful for what you're after. As I said, I was in too much of a hurry and didn't think it through.

The Helper.IgnoreRank can be assigned to an item in order to make Hero Lab skip the error message having that item would normally generate. If this is supposed to affect every character, how about this...

In a mechanic, create an eval script at Validation/100 do a foreach loop through the Edges with a Seasoned Rank requirement, and apply the IgnoreRank tag to the first one you find.

Code:
var counter as number
      foreach pick in hero from Edge where "MinRank.1"
        counter += 1
        if (counter = 1) then
          perform eachpick.assign[Helper.IgnoreRank]
          endif
        nexteach

If I knew a way to exit the foreach after assigning the tag so it never went for the second record it would be cleaner than the if statement, but this works. In fact, here's an sample of both the mechanic and a sample Hero what uses it.

I hope this is more helpful.
 

Attachments

A cleaner way of implementing the code from CapedCrusader is as follows:
Code:
foreach pick in hero from Edge where "MinRank.1"
    perform eachpick.assign[Helper.IgnoreRank]
    done
    nexteach

The above code will simply bail on the loop after reaching the first instance.

However, implementing the logic as above is likely prone to problems with other logic (e.g. edges) that negates the rank requirements for a specific edge, since those will perform the exact same operation. It's probably safer to check for both a MinRank tag *and* no existing IgnoreRank tag just to be safe you don't double-count the same edge. The foreach statement would change to the following:
Code:
foreach pick in hero from Edge where "MinRank.1 & !Helper.IgnoreRank"

The other detail that's not being taken into consideration yet is that the ability only applies to an edge *taken* during creation. So it's not a question of whether the character is in creation mode at the time of evaluation. If you key on the that, as in the original "validif" suggestion at the top, the edge will be fine during creation and then report an error the moment the character switches into advancement mode. That's not what you want. You need to check whether the edge was taken during creation mode, regardless of the current mode.

Every pick has a "creation" attribute that can be tested to determine whether it was added during creation or advancement. So you need to check the creation attribute to determine whether the pick can be safely ignored or not. Since the attribute is not a tag, it can't be filtered on via the tag expression used in the foreach, which means it has to be checked inside the loop.

Putting it all together yields the following logic:
Code:
foreach pick in hero from Edge where "MinRank.1 & !Helper.IgnoreRank"
    if (eachpick.creation = 1) then
        perform eachpick.assign[Helper.IgnoreRank]
        done
        endif
    nexteach

Hope this helps!
 
Mega-Thanks gentlemen! I should have some time to dig hard into this today and see how well I can implement it.

Happy Mardi Gras!
 
Ok, so Pirates, which allows up to (but not including) Legendary to be taken at Character Creation only I set an Eval Rule on a Mechanic running at Validation/100 as follows:

Code:
foreach pick in hero from Edge where "(MinRank.1 | MinRank.2 | MinRank.3 | MinRank.4) & !Helper.IgnoreRank"
    if (eachpick.creation = 1) then
        perform eachpick.assign[Helper.IgnoreRank]
    endif
nexteach

So that adds in checking for more than just Seasoned, but for the other ranks as well AND skips the "done" code, since Pirates also does not limit you to only a single above-Novice Edge. And that seems to work! Yay! NowI can go back and do the same on 50 Fathoms but using the base code looking only for Seasoned and including the "done" to drop out of the loop since only that first Seasoned Edge can be considered valid since it only lets you pick one.

I figured I would have needed to look for that on every Edge it was applicable to, but instead doing it as a Mechanic really works it out well.

I now run into one other issue, though, related to this. In Pirates there are certain Edges (mainly Fencing Academies) that allow you to take another Edge at lower than the normal Rank requirement. So, for example, the Royal Fencing Academy (edgPMFARFA) allows you to take Riposte Edge at Novice and the Improved Riposte Edge at Seasoned. With my previous thinking that I would need to check those Rank requirements on each of these Edges I had simply included the Edge check in the Pre-Reqs script where I was trying to check for Rank. Now I would need to change that up a little, but I can't quite figure out the code to do it.

I THINK I would need to set up an Eval-Script on the Riposte edge, presumably it would need to run at Validation/100 as well. And I would need to do something like:
Code:
if (hero.tagis[Edge.edgPMFARFA] <> 0) then
   perform hero.child[edgPMRipo].assign[Helper.IgnoreRank]
endif

Which works once the Edge has been added to make sure it still looks valid, but I think I need something set up in a pre-req to make it look valid as a pick to begin with, which I'm not exactly sure how to do.

EDIT: After testing I noticed that the main code is great for ensuring an already picked Edge shows as valid, but how do I get the pick to show as a valid selection to begin with? Something like the Block Edge still doesn't show up as a valid selection when trying to add that Edge, it still errors on the Rank requirement, but once selected and added to the portfolio it will then show itself as valid. I just can't figure out how to get the picks to be valid when a character wants to select it to begin with.
 
Last edited:
So, it's "done" to exit from that loop. Thanks, Rob!

I was actually concerned about that, too. My solution was clunky, though, so I didn't want to post it until I got it to work better. Yous is much better!

Lenny, as far as getting them to show up to being with, that's trickier. I've done something similar before, let me track down that code and see if it applies here.
 
Last edited:
Just wanted to follow-up on this for anyone who might find it in a search and wonder what happened. CapedCrusader graced us with a bit of extra code/functionality to help take care of it and I've posted some of the details in the stickied thread in this forum for common codes:

Some settings allow the character to pick certain higher ranked Edges at character creation. The Born A Hero setting works for this, but it allows for all ranks to be ignored. Here's an example that allows for everything but Legendary Edges to show as valid if they were picked at character creation. To select, say, only Seasoned edge just remove all the other MinRank values other than MinRank.1.

Eval Script: Initialization/200

Code:
foreach thing in Edge where "(MinRank.1 | MinRank.2 | MinRank.3)"
   if (hero.tagis[mode.creation] = 1) then
      var ignoretag as string
      ignoretag = "IgnoreRank." & eachthing.idstring
      perform hero.assignstr[ignoretag] 
   endif
nexteach

This accesses a new feature that CapedCrusader graciously put into place for us where this "IgnoreRank." mechanic will allow a specific Edge to show as valid even if the character does not otherwise meet the Rank Requirements.

Next we need to make sure the Edge remains valid once we go into Advancement mode.

Eval Script: Validation/100

Code:
foreach pick in hero from Edge where "(MinRank.1 | MinRank.2 | MinRank.3)"
   if (eachpick.creation = 1) then
      perform eachpick.assign[Helper.IgnoreRank]
   endif
nexteach
 
Back
Top