• 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

Assigning a field to a Knowledge skill outside of the Bootstrap?

zarlor

Well-known member
Hopefully this will be the last one I need for Weird War Rome (it should be). I'm trying to set-up a conditional bootstrap on a Character Creation Edge where I set up the Thing: as "skKnow" for my knowledge skill; FieldId: domDomain, Value: Occult, Assign; Condition, Setup, 1100, Tag Expression: !hero#Edge.edgWRLegK1 | !hero#Edge.edgWRLegA1 | !hero#Edge.edgWRLeJK1 | !hero#Edge.edgWRLeJR1 | !hero#Edge.edgWRLeJT1

That expression is because if the character has any of those Edges then I don't want to assign this skill to them. (The reason is because those Edges will have already assigned the Knowledge (Occult) skill to the character so I don't want to assign it again. Since this is character creation we don't really need to worry about it already existing (unless the player did it on their own, but they shouldn't have if they have this particular Edge anyway so I'm not going to bother trying to trap for it.)

So far so good, except that when I try to compile I get the following error:

Thing 'edgWRLeJF1' - Conditional bootstrap is not allowed with value assignment on 'user' field 'domDomain'

So it looks like it won't allow me to assign a domain to the skill, at least not with the Bootstrap. So how can I set the domDomain on that Knowledge skill? Of note, I also have an Eval script that run at Pre-Traits/5000 to search for an occult domain in the Knowledge fields to bump it up a die, so presumably I'd need to be able to make the assignment before then.

So my thought would be an Eval script at Pr-Traits/4500 set up something like:

Code:
foreach pick in hero where "thingid.skKnow"
   if (compare(lowercase(eachpick.field[domDomain].text),"") = 0) then
         trustme
         ~This will assign Occult
         var occult as string
         occult = "Occult"
         eachpick.field[domDomain].string = occult
    endif
nexteach

Although that doesn't exactly work (I get a reference to undeclared variable "eachpick"). I've tried several variations but I'm not sure what syntax I should be using here.
 
If you were looking up field[domDomain], what would you put after that? (Hint: look 5 lines earlier in your code)

The answer to that question is the same as the answer to this question.

Also, your if statement can be made simpler:

if (eachpick.field[domDomain].isempty <> 0) then

There's also no need to declare a variable, set the variable's text, and then set the field = the variable. Simply use one line that sets the field = the text you want.
 
Yeah, I set the variable because I couldn't get the syntax quite right, but even getting to the point where I put that .string, instead of .text (duh!) was a lot of trial and error with other methods that didn't really work. Thanks a ton for all the help!
 
Well, that works great but I apparently wasn't thinking that all the way through. When I do it that way then if the user adds a Knowledge skill it will automatically fill it in with the work "Occult", which could be a bit confusing. Drat!
 
Can you assign some tag as part of the bootstrap that uniquely identifies this particular copy, so that the foreach can search for that tag?
 
Ah, OK. Since I've already assigned a Tag for eacy of the Legacy edges (EdgeType.Legacy) I just used that as an assigned tag to the bootstrapped skKnow skill and that seems to do the trick (when looking for that tag in the code as well, of course.) So now it adds it without adding it to any other skKnow skills. Thanks again! Some of these solutions seem so simple but realizing what's available, even after having done this for quite a few data files so far, I still miss a lot of stuff like that.
 
Back
Top