Prioritization of Attributes and Skills
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. |
1 Attachment(s)
This picture shows what I am asking to see, the button with the two arrows that swaps one category for another.
|
I think I may have finally found a way to get this working... after months of scratching my head at it.
|
^_^ When you do, can you share the code so that others looking in the future will know?
|
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." |
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 --> |
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.
|
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. |
Here is the field I added to the category helper component
Code:
<field Code:
<portal |
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.
|
All times are GMT -8. The time now is 01:36 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.