Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Custom expressions (http://forums.wolflair.com/showthread.php?t=61928)

Bob G January 6th, 2019 07:41 AM

Custom expressions
 
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?

ShadowChemosh January 6th, 2019 12:04 PM

Quote:

Originally Posted by Bob G (Post 274713)
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

Bob G January 8th, 2019 12:58 PM

Quote:

Originally Posted by ShadowChemosh (Post 274720)
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?

ShadowChemosh January 8th, 2019 01:32 PM

Quote:

Originally Posted by Bob G (Post 274754)
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

Quote:

Originally Posted by Bob G (Post 274754)
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". :)

Bob G January 8th, 2019 03:21 PM

Quote:

Originally Posted by ShadowChemosh (Post 274755)
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?

ShadowChemosh January 8th, 2019 03:33 PM

Quote:

Originally Posted by Bob G (Post 274760)
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.

Bob G January 8th, 2019 03:39 PM

Thanks man, I'll send you an email.

Bob G January 8th, 2019 08:17 PM

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!

Bob G January 8th, 2019 08:22 PM

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?

ShadowChemosh January 9th, 2019 12:43 AM

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.


All times are GMT -8. The time now is 02:28 AM.

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