Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old February 9th, 2018, 10:34 AM
Thank you. I think that does... although the last time I tried, it didn't work for me. Admittedly, that might have been because I was putting things in the wrong place.
Duggan is offline   #11 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old February 9th, 2018, 11:59 AM
Hmm... and my problem might be one of indirection. My Fireteam thing has an eval function that takes the chosen menu values and pulls tags off of them like so:
Code:
<eval index="2" phase="PreTraits" priority="4900">
      <before name="Calc trtFinal"/><![CDATA[
      field[skillCh1].chosen.pushtags[FTSkill.ftPhysical]
      
      field[ftPhysical].value = field[skillCh1].chosen.tagcount[FTSkill.ftPhysical] + field[skillCh2].chosen.tagcount[FTSkill.ftPhysical]
      
      field[ftSocial].value = field[skillCh1].chosen.tagcount[FTSkill.ftSocial] + field[skillCh2].chosen.tagcount[FTSkill.ftSocial]
        
      field[ftMental].value = field[skillCh1].chosen.tagcount[FTSkill.ftMental] + field[skillCh2].chosen.tagcount[FTSkill.ftMental]
        
      field[ftCombat].value = field[skillCh1].chosen.tagcount[FTSkill.ftCombat] + field[skillCh2].chosen.tagcount[FTSkill.ftCombat]
        
      field[ftDamage].value = field[skillCh1].chosen.tagcount[FTSkill.ftDamage] + field[skillCh2].chosen.tagcount[FTSkill.ftDamage]
      
      ]]>
      </eval>
How would I go about pulling or pushing the FTSkill tags onto the hero to allow me to just total up the tags? Or am I going to be better off just cycling through the Fireteam members and summing them up?
Duggan is offline   #12 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old February 9th, 2018, 12:24 PM
Is this what you're looking for?
Code:
perform field[skillCh1].pulltags[FtSkill.?]
perform field[skillCh2].pulltags[FtSkill?]

field[ftPhysical].value = tagcount[FtSkill.ftPhysical]
etc.
Mathias is online now   #13 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old February 9th, 2018, 08:22 PM
Hmm... that would be a more elegant solution than what I'm doing now, although that wasn't what I was intending to ask. ^_^ But that will work.
Duggan is offline   #14 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old February 20th, 2018, 04:29 PM
Back to the effects of one menu dictating the others, currently I have the Role MenuThing setting what the valid choices are for the other two MenuThings with the following bit of code:

Code:
<eval index="1" phase="PreTraits" priority="4500">
  <before name="Calc trtFinal"/><![CDATA[
    var skChoices1 as string
    var skChoices2 as string

    skChoices1 = field[FTRole].chosen.tagids[FTSkChc1.?, " | "]
    skChoices2 = field[FTRole].chosen.tagids[FTSkChc2.?, " | "]
    
    field[availSk1].text = skChoices1
    field[availSk2].text = skChoices2      
  ]]>
  </eval>
However, if a given Role only allows one choice (which most of them do for at least one of the skill choices), I'd like to automatically set the "chosen" to the correct value and if the user changes the Role, and a given setting is no longer valid, I'd like to be able to blank it or set it to the first valid option.

It feels like I should be able to code it kind of like this:
Code:
if (field[FTRole].chosen.tagcount[FTSkChc1.?] = 1) then
  foreach thing in FTSkill where field[FTRole].chosen.tagids[FTSkChc1.?, " & "]
    ~ Should only be the one
    field[skillCh1].chosen = eachthing
    nexteach
  endif
at least for the "only one choice" scenario, but I get an "invalid use of the reserved word 'field' in script" error. I am able to do a debug statement showing that "eachthing.idstring" holds the right values, so I think I'm close to on the right track.
Duggan is offline   #15 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old February 21st, 2018, 08:01 AM
Why not set up your scripts so that they can detect that circumstance, and generate the correct results without bothering to look at the menu field if that's the case, and then hide the selectors from the user's view - instead, show a label field displaying that one allowed option? (and cancel any error messages about needing to select something if you can figure out that there's only one selection).
Mathias is online now   #16 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old February 21st, 2018, 08:20 AM
That is indeed a possible option. Extending it out to the case of where a given role allows a range of skills that does not encompass the entire set, is there a way to set the menu options? To use two slightly artificial example:
Infantry - Skill 1: [Combat or Physical] Skill 2: [Combat or Damage]
Specialist - Skill 1: [Social or Mental] Skill 2: [Combat]

If I have someone who's chosen Infantry, Combat, Combat and then changes their role to Specialist, it would be nice to change Skill 1 to be undecided (or the first valid option) and leave Skill 2 as it is. Alternately, is there a good way to clear choices just so that I avoid having an invalid setting?

And I know that the answer might be "No, you can't do that", but I figure it's worth asking.
Duggan is offline   #17 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 03:17 PM.


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