• 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

Custom expressions

Bob G

Well-known member
Happy new year to everyone! So I'm trying out this 'custom expression' thingy that all the kids are raving about.

I've got an ability that allows the user to select a knowledge skill that is not currently a class skill, and make it a class skill. I need to find some filters, and so I found "Helper.SkCatKnow" as a tag that will select only skills that have been assigned the Knowledge category, and the field 'fieldval:skClsSkBon = 0' that will only choose skills where the class skill bonus is 0 (i.e., it's not a class skill).

So my custom expression looked like this: "Helper.SkCatKnow" & fieldval:skClsSkBon = 0

I then told the editor to select from Skills, and to restrict the first list to All Things. The resulting dropdown menu in the class tab looks like it's selecting all skills, and not filtering the way I want. Did I not create the custom expression correctly, or is my error in what I restricted the list to?
 
I then told the editor to select from Skills
This is why it lists all skills because it overwrote your custom expression with "component.BaseSkills" as the whole expression. When you select from the editor dropdown you are "setting" the WHOLE expression. It does not append to the expression field. So first step is to set this back to "none".

Next its best to start an expression with a component "Type". In this case it would be component.BaseSkill. Then instead of a field class skills are known by the Helper.ClassSkill tag. Combine all this together and you get:

Code:
component.BaseSkill & Helper.SkCatKnow & Helper.ClassSkill
 
This is why it lists all skills because it overwrote your custom expression with "component.BaseSkills" as the whole expression. When you select from the editor dropdown you are "setting" the WHOLE expression. It does not append to the expression field. So first step is to set this back to "none".

Next its best to start an expression with a component "Type". In this case it would be component.BaseSkill. Then instead of a field class skills are known by the Helper.ClassSkill tag. Combine all this together and you get:

Code:
component.BaseSkill & Helper.SkCatKnow & Helper.ClassSkill
Thanks for the assist SC. A few follow-up questions:
1. By adding the 'Helper.ClassSkill' tag to the expression, would that not choose skills that ARE class skills? I want the expression to select knowledge skills that are NOT class skills.
2. The dropdown window in the class tab now says "Nothing to select." Do I need to restrict the 1st list in any way?
 
Thanks for the assist SC. A few follow-up questions:
1. By adding the 'Helper.ClassSkill' tag to the expression, would that not choose skills that ARE class skills? I want the expression to select knowledge skills that are NOT class skills.
Missed you wanted not-class skills. To get "NOT" you use a ! in front of the tag to say NOT having this tag.

Code:
component.BaseSkill & Helper.SkCatKnow & !Helper.ClassSkill


2. The dropdown window in the class tab now says "Nothing to select." Do I need to restrict the 1st list in any way?
Well yeah you do always need to correctly set the restrict list or it defaults to Things I think. Anyways you want to select skills that are live on the hero or the "All Picks on Hero". :)
 
Missed you wanted not-class skills. To get "NOT" you use a ! in front of the tag to say NOT having this tag.

Code:
component.BaseSkill & Helper.SkCatKnow & !Helper.ClassSkill

That's really cool! Nice little piece of knowledge to have. Thanks!

Well yeah you do always need to correctly set the restrict list or it defaults to Things I think. Anyways you want to select skills that are live on the hero or the "All Picks on Hero". :)

Set it to All Picks on Hero, but still getting 'Nothing to Select' in the dropdown box. Any other thoughts on what might be wrong?
 
Set it to All Picks on Hero, but still getting 'Nothing to Select' in the dropdown box. Any other thoughts on what might be wrong?
Its time share the .user file then so I can take a look at it as that does not make sense... You can attach it to a post here in this thread... Of if you want you can email it to me at my forum user id at yahoo dot com.
 
The solution to this issue was simply adding one of the non-class knowledge skills to the hero. This changes its status from a Thing to a Pick, and since we've told the editor to Restrict 1st List to "All Picks on Hero", the non-class skills added to the hero now become selectable. Thanks to ShadowChemosh for all of his help!
 
The last piece of this ability is how to make the user's choice a class skill. I think that my transitioning isn't correct in the script below:
Code:
~Take the user's picks and make them class skills
     if (field[usrChosen1].ischosen <> 0) then
     field[usrChosen1].chosen.perform assign[Helper.ClassSkill]
     endif
This produces a syntax error. I also tried
Code:
~Take the user's picks and make them class skills
     if (field[usrChosen1].ischosen <> 0) then
     perform assign[Helper.ClassSkill].field[usrChosen1].chosen
     endif
Also a syntax error. How do I properly code this?
 
Your really close! :)

Code:
     ~Take the user's picks and make them class skills
     if (field[usrChosen1].ischosen <> 0) then
        perform field[usrChosen1].chosen.assign[Helper.ClassSkill]
     endif

To break this up think of this way. You PERFORM against the PICK a specific ACTION (assign).

The pick in this case is field[usrChosen1].chosen and then your action is "assign[]" a tag. Perform is usually used when dealing with tag actions like (delete, assign, pulltags, pushtags). Normally its not used with fields when doing normal arithmetic like addition, subtraction etc.
 
Last edited:
Your really close! :)

Code:
     ~Take the user's picks and make them class skills
     if (field[usrChosen1].ischosen <> 0) then
        perform field[usrChosen1].chosen.assign[Helper.ClassSkill]
     endif

To break this up think of this way. You PERFORM against the PICK a specific ACTION (assign).

The pick in this case is field[usrChosen1].chosen and then your action is "assign[]" a tag. Perform is usually used when dealing with tag actions like (delete, assign, pulltags, pushtags). Normally its not used with fields when doing normal arithmetic like addition, subtraction etc.
Thanks again SC, that worked. There's one last thing to fix. The ability asks the user to select three non-class skills. The dropdown window for the first two appear normally, but I think that the panel width is cutting off the third selection window. How to I tell the editor to 'wrap' the text so that the third selection appears below the first two?
 
Thanks again SC, that worked. There's one last thing to fix. The ability asks the user to select three non-class skills. The dropdown window for the first two appear normally, but I think that the panel width is cutting off the third selection window. How to I tell the editor to 'wrap' the text so that the third selection appears below the first two?
Simple answer is you don't. The UI is locked to only two dropdowns.

The solution to this is build a helper ability with one skill choice and bootstrap it to the main ability. This way both abilities come along when chosen and give three dropdowns.
 
Simple answer is you don't. The UI is locked to only two dropdowns.

The solution to this is build a helper ability with one skill choice and bootstrap it to the main ability. This way both abilities come along when chosen and give three dropdowns.

Okay, good to know. Is a helper ability a special thing, or just another ability that gets bootstrapped by the primary ability?
 
Okay, good to know. Is a helper ability a special thing, or just another ability that gets bootstrapped by the primary ability?

One thing that uses this to gain a third dropdown, IIRC, is the Headband of Int +6. Having a look at it might help you!
 
Okay, good to know. Is a helper ability a special thing, or just another ability that gets bootstrapped by the primary ability?
Just another ability that in this case is NOT setup to be selected by your Rogue class. One way to make sure this ability can not be selected by a gamer is to add the tag "Helper.Helper" to the Thing.

If you look at the example Lord Magus you will find Helper.Helper on the second magic item that is bootstrapped.
 
Just another ability that in this case is NOT setup to be selected by your Rogue class. One way to make sure this ability can not be selected by a gamer is to add the tag "Helper.Helper" to the Thing.

If you look at the example Lord Magus you will find Helper.Helper on the second magic item that is bootstrapped.

I just can't get this to work. I think I did everything correctly, even checked the bootstrap timing to ensure it came before everything else, but no luck.
 
Back
Top