• 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

How do you add situational text to a Craft skill of the user's choosing?

Hello,

I'm having trouble adding some situational text to a Craft skill which the user get's to pick out.

I have a field set up like so:
usrChosen1: component.BaseSkill & Helper.SkCatCraft

Here is the situational code that I have so far:
Code:
      doneif (tagis[Helper.FtDisable] <> 0)

      #situational[hero.child[???], "You can make use of this craft without the proper tools and suffer no penalty.",field[name].text]

Normally, I'd put the skill in where the ??? is, however since the user gets to pick which skill it is, it's not so simple. I've tried a couple variations on "field[usrChosen1].chosen" but so far nothing has worked.

Any ideas?

Thank you in advance,
Sincerely,
Chimeforest
 
Last edited:
Sorry, I should have mentioned this. I am making a Trait. It has a drop-down box of craft skills the user has selected on the Skills tab.
 
First got to "Develop->Enable Data File Debugging". Now add a trait a to your character, any trait will do. Then RIGHT mouse click on the "?" next to the trait and select "Show Debug Fields". You will see that traits do have a field named usrChosen1. So you where correct in using field[usrChosen1].chosen.

You never listed the exact error you where getting or "when" you where getting issues. All of that matters in scripting.

My guess would be that the script compiled when you had this:
Code:
#situational[field[usrChosen1].chosen, "You can make use of this craft without the proper tools and suffer no penalty.",field[name].text]
But it threw an error when you selected the craft skill right? Again I am "guessing" here as you didn't provide enough details of the error you got. :(

If the above is true then the cause is that you set the "Restrict First List To.." to "- none -" or "All Things". Which means your trying to modify a Thing and not a Pick. Only Picks can have situational text added too it. If you don't know what I mean by Pick vs Thing please read the editor's glossary of terms.

Change the "Restrict First List To.." to be "All Picks on Hero". This will allow the script to work but remember this means only the "Craft" skills that have been selected/added on the Skills tab will display in the dropdown now.

Hope that helps. :)
 
Thank you very much =]
The code you provided worked perfectly! I completely misunderstood how the first parameter of "#situational" worked in this case. I kept trying variations of "hero.child[field[usrChosen1].chosen]" which produced a variety of errors.. and in hindsight seems rather silly. Next time I will post what errors I get (sorry about that >.<; )

If it's not too inconvenient, I would like to ask one more thing of you; Is it possible to remove the need for tools from the selected craft skill via scripts? And if so, how would you go about doing it?

Thank you again,
Chimeforest
 
Back
Top