Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
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. |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
This picture shows what I am asking to see, the button with the two arrows that swaps one category for another.
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. |
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
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. |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Nov 2009
Posts: 1,502
|
^_^ When you do, can you share the code so that others looking in the future will know?
|
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
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." |
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
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> |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
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.
|
#7 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
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. |
#8 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
Here is the field I added to the category helper component
Code:
<field id="cpriority" name="Priority" type="derived" persistence="full"> </field> 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. |
#9 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633
|
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. |
#10 |
Thread Tools | |
Display Modes | |
|
|