Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old March 13th, 2018, 06:06 PM
Mathias,

Can I please see the portal script for the action buttons in the World of Darkness code that swaps categories? I am referring to the buttons that switch the category dots.

I have done this as a chooser menu but I really would rather setup a couple of those buttons to do the switcheroo on the categories instead. I just can't figure out how the button does the swapping.

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #1 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old March 13th, 2018, 06:08 PM
This picture shows what I am asking to see, the button with the two arrows that swaps one category for another.
Attached Images
File Type: jpg Prioritization shifter.jpg (11.9 KB, 13 views)

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #2 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old March 14th, 2018, 07:51 PM
I think I may have finally found a way to get this working... after months of scratching my head at it.

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #3 Reply With Quote
Duggan
Senior Member
Volunteer Data File Contributor
 
Join Date: Nov 2009
Posts: 1,502

Old March 15th, 2018, 08:12 AM
^_^ When you do, can you share the code so that others looking in the future will know?
Duggan is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old March 15th, 2018, 08:36 AM
Sorry I didn't get a chance to respond before now. My recommendation would be to store a user field on the component that's used for the picks that are storing the number of points available to each option. Then, when building the three picks in the editor, set the value of this field to 0, 1, and 2 on diferent picks.

Then, your first button would run a script that looks at the current value of pick A, stores that value in a variable, then copies the current value on B to A, then sets the stored value in the variable to be B's order value. The other button would run a very similar script, but instead, would swap the values on B and C.

Then, the picks would have a component script that said "if my order value is 0, I'm worth X points to my category, if my order value is 1, I'm worth Y, etc."
Mathias is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old March 15th, 2018, 08:58 AM
Thinking about it, I would not recreate the button system from our WoD files if I were doing them from scratch today - I'd use a user-sortable table to define the priorities and allow the user to control their relative order, the way Shadowrun does.

That just needs a fixed table with allowuserorder="yes", and make sure the component="" of that table is set to a component that has a orderfield="priOrder". Then, a component script on that component will look up the orderfield and convert that into the number of points. And like my previous suggestion, in the editor, you'd set default order values for each of the three picks.

You'll also need a showsortset="" on the table, that uses the orderfield on that component:
Code:
  <!-- The priorities table is a user-ordered table -->
  <sortset
    id="PriorTable"
    name="User-Assigned Priority Order">
    <sortkey isfield="yes" id="priOrder" isascend="yes"/>
    </sortset>
Mathias is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old March 15th, 2018, 10:32 AM
With enough work, you might be able to set things up so that the user doesn't even need to set the priorities themselves. What you can do is to total up the number of points the user has spent in each category, put those in order, and put the number of points available in each category into the same order. There's some default ordering pre-set, so that if physical and mental currently have the same amount spent, then you've already worked out that physical will get sorted first, or whatever default you want. That will also be the case on a newly created character, where all the attributes are still at their default.
Mathias is offline   #7 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old March 15th, 2018, 01:36 PM
I haven't checked on all of the systems yet, I just finished up V20. The table idea is nice, I ended up adding prioritization field with persistence="full" to each category thing and then had the swap buttons modify those values when used, which causes the dot swap. It's a bit of a brute force method but it works exactly the same way you did the WoD file. I know with oWoD I needed the prioritizations because they are not always going to be the same number.

A Vampire gets 7/5/3 on attributes, a Ghoul gets 6/4/3 and though I haven't seen it there is a possibility that two categories could get an equal number of dots. I managed to make the data work though last night.

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #8 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old March 15th, 2018, 01:42 PM
Here is the field I added to the category helper component

Code:
    <field
      id="cpriority"
      name="Priority"
      type="derived"
      persistence="full">
      </field>
Here is one of the two buttons that swaps the primary/secondary attributes or skills. All it does is increase the priority index of the one being lowered, then it lowers both indexes based on which one is currently in the lower position. It doesn't rely on the dot values at all, just the priority field. It's nothing elaborate, just a brute force mathematical method that does the job.

Code:
    <portal
      id="swapPS"
      style="actSwap"
      tiptext="Click here to Swap Prioritization categories.">
      <action
        action="trigger">
        <trigger><![CDATA[
          ~We need to swap our Primary and Secondary category dots

          if (hero.child[cTalent].field[cpriority].value = 1) then
            hero.child[cTalent].field[cpriority].value += 3
            if (hero.child[cSkill].field[cpriority].value = 2) then
              hero.child[cSkill].field[cpriority].value -= 1
              hero.child[cTalent].field[cpriority].value -= 2
            elseif (hero.child[cKnowledge].field[cpriority].value = 2) then
              hero.child[cKnowledge].field[cpriority].value -= 1
              hero.child[cTalent].field[cpriority].value -= 2
              endif
    
           elseif (hero.child[cSkill].field[cpriority].value = 1) then
            hero.child[cSkill].field[cpriority].value += 3
            if (hero.child[cTalent].field[cpriority].value = 2) then
              hero.child[cTalent].field[cpriority].value -= 1
              hero.child[cSkill].field[cpriority].value -= 2
            elseif (hero.child[cKnowledge].field[cpriority].value = 2) then
              hero.child[cKnowledge].field[cpriority].value -= 1
              hero.child[cSkill].field[cpriority].value -= 2
              endif

           elseif (hero.child[cKnowledge].field[cpriority].value = 1) then
            hero.child[cKnowledge].field[cpriority].value += 3
            if (hero.child[cTalent].field[cpriority].value = 2) then
              hero.child[cTalent].field[cpriority].value -= 1
              hero.child[cKnowledge].field[cpriority].value -= 2
            elseif (hero.child[cSkill].field[cpriority].value = 2) then
              hero.child[cSkill].field[cpriority].value -= 1
              hero.child[cKnowledge].field[cpriority].value -= 2
              endif

            endif

          
          ]]></trigger>
        </action>
      </portal>

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #9 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old March 15th, 2018, 01:59 PM
To be honest, the way shadowrun 5 does it is cool, but I'd still need to see lines of code for the drag and drop table you rigged up. And that might be easier to do. It took me a long time to finally find a method that works like the old WoD code.

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #10 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 12:19 AM.


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