Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   Scripting: Tag ID question (http://forums.wolflair.com/showthread.php?t=57830)

Mergon February 28th, 2017 11:35 AM

Scripting: Tag ID question
 
In the script below I am trying to add Proficiency, Expertise, and Advantage to all Artisan Tools the character is carrying. It is part of a set of 3 scripts on a major Ring artifact.

Everything works fine except I'm at a loss on how to add Expertise (double proficiency).

Since the changes to Tools, it looks like Double Proficiency is done by adding the ProfTooDbl.? (where ? is the tag of the Tool - i.e.: gTooTinker for Tinker's Tools) directly to the hero.

What I am trying to do is extract the tag from each set of Tools the hero is carrying and assign ProfTooDb.{Tool tag} to the hero from within a foreach loop.

I'm at a loss on who to get the appropriate tag, append it to ProfTooDbl. and then assign it. Any help would be greatly appreciated. :confused:

Quote:

doneif (field[gIsEquip].value = 0)
doneif (field[gIsAttuned].value = 0)

var sTag as string

~ Grant Proficient & Expertise to All Tools carried and Advantage to All
~ Tools the Bearer is Proficient with.
foreach pick in hero from BaseEquip where "ToolCat.Artisan"
perform eachpick.assign[Proficienc.Tool]
perform eachpick.assign[Hide.Tool]
~sTag = eachpick.tagids[ProfTooDbl.?]
~perform hero.assign[ProfTooDbl.sTag]
nexteach

ShadowChemosh February 28th, 2017 02:13 PM

Please note I did this off the top of my head so misspelled/mistype words could happen. :)

Code:

doneif (field[gIsEquip].value = 0)
doneif (field[gIsAttuned].value = 0)

~ Grant Proficient & Expertise to All Tools carried and Advantage to All
~ Tools the Bearer is Proficient with.
foreach pick in hero from BaseEquip where "ToolCat.Artisan"
  perform eachpick.assign[Proficienc.Tool]
  perform eachpick.assign[Hide.Tool]
  ~ Pull the tags from the tool to our self. This is an easy way to build a list
  ~ of tags that we want to assign to the hero.
  perform eachpick.pulltags[ProfTooDbl.?]
nexteach

~ Now push all the ProfTooDbl tags on our self to the hero
perform hero.pushtags[ProfTooDbl.?]


Mergon February 28th, 2017 10:49 PM

Many thanks Chemosh:

I'll give this s try tomorrow.

Thx again.

dungeonguru June 8th, 2017 08:08 AM

I was working on a similar artifact, granting advantage to gaming toolsets. My code is pretty much a copy of what is here, but is there a way to have the * show up to show the advantage?

I tried:

Code:

doneif (field[gIsAttuned].value = 0)

foreach pick in hero from BaseEquip where "ToolCat.Gaming"
  perform eachpick.assign[Proficienc.Tool]
  perform eachpick.assign[Hide.Tool]
  perform eachpick.assign[Helper.Advantage]
  eachpick.field[DescAppend].text &= "Advantage to all gaming related rolls."

  perform eachpick.pulltags[ProfTooDbl.?]
nexteach   

perform hero.pushtags[ProfTooDbl.?]]]>

I thought it was timing, but now I'm not so sure if the * is valid on tool picks.

ShadowChemosh June 8th, 2017 10:56 AM

Based on what I have seen the tag does not provide the *. That * represents that you have added "situational" text to be displayed on the Pick.

Try this:
Code:

doneif (field[gIsAttuned].value = 0)

foreach pick in hero from BaseEquip where "ToolCat.Gaming"
  perform eachpick.assign[Proficienc.Tool]
  perform eachpick.assign[Hide.Tool]
  perform eachpick.assign[Helper.Advantage]
  #situational[eachpick, "Advantage to all gaming related rolls.",field[name].text]
  perform eachpick.pulltags[ProfTooDbl.?]
nexteach   

perform hero.pushtags[ProfTooDbl.?]

Note I am not near HL so didn't test this but pretty sure it will work. :)

dungeonguru June 8th, 2017 02:34 PM

Hmm, I tried your situation code and it doesn't work - I get the error:

Quote:

Attempt to access field 'SitList' that does not exist for thing 'gCardSet'
When I look at debug fields for the Playing Cards tool proficiency I don't see SitList. I do see that in the debug fields for a "native" skill like History - it shows SitList as a matrix.

I'm not sure how to assign a matrix field and then add the text to it, although I'm reading the wiki and other threads now. I'm also not sure that assigning a SitList matrix to the tool would even work, since the proficiency gets derived from an equipment "thing" and the code from LW may not be there to see the SitList and generate an * during the output.

But, thanks for the clarification - I thought the Helper.Advantage tag generated the *. I'll keep picking away at it. If I can't get it to work, I might put in a feature request.

ShadowChemosh June 8th, 2017 02:47 PM

All those matrix/fields are part of the "Component" which we non-LW people do not have access too. I know Skills, Saves and ability scores get situational text but I guess not gear.

What you had before using the "DescAppend" is the best your going to get in this case. :(


All times are GMT -8. The time now is 07:57 AM.

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