Enthusiast
Posts: 26
Karma: 84276
Join Date: Aug 2011
Location: Tuscaloosa, AL
Device: Samsung Tablet
|
Pairing up multiple ships: More than 2 people in ship
Quote:
Originally Posted by JimmXinu
One way is to use replace_metadata. See the wiki pages and other posts in this thread if you need help understanding how replace_metadata works:
Code:
add_to_replace_metadata:
ships=>^([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\2/\3\,\1/\3
|
The issue isn't just limited to 3 people in the ship though. I want to handle 3+, or anything over 2 people in the ship. I think I have figured it out with the above code, along with getting certain people in the front of the ship pairings. See what you think, if you don't mind.
Spoiler:
Code:
add_to_replace_metadata:
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\1/\12\,\1/\13\,\1/\14\,\1/\15\,\1/\16\,\1/\17\,\1/\18\,\1/\19\,\1/\20\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11/\12/\13/\14/\15/\16/\17/\18/\19/\20
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\1/\12\,\1/\13\,\1/\14\,\1/\15\,\1/\16\,\1/\17\,\1/\18\,\1/\19\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11/\12/\13/\14/\15/\16/\17/\18/\19
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\1/\12\,\1/\13\,\1/\14\,\1/\15\,\1/\16\,\1/\17\,\1/\18\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11/\12/\13/\14/\15/\16/\17/\18
ships=>^([^/]+)/([^/]+)//([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\1/\12\,\1/\13\,\1/\14\,\1/\15\,\1/\16\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11/\12/\13/\14/\15/\16/\17
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\1/\12\,\1/\13\,\1/\14\,\1/\15\,\1/\16\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11/\12/\13/\14/\15/\16
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\1/\12\,\1/\13\,\1/\14\,\1/\15\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11/\12/\13/\14/\15
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\1/\12\,\1/\13\,\1/\14\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11/\12/\13/\14
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\1/\12\,\1/\13\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11/\12/\13
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\1/\12\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11/\12
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\1/\11\,\2/\3/\4/\5/\6/\7/\8/\9/\10/\11
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\1/\10\,\2/\3/\4/\5/\6/\7/\8/\9/\10
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\1/\9\,\2/\3/\4/\5/\6/\7/\8/\9
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\1/\8\,\2/\3/\4/\5/\6/\7/\8
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\1/\7\,\2/\3/\4/\5/\6/\7
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\1/\6\,\2/\3/\4/\5/\6
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\1/\5\,\2/\3/\4/\5
ships=>^([^/]+)/([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\1/\3\,\1/\4\,\2/\3/\4
ships=>^([^/]+)/([^/]+)/([^/]+)$=>\1/\2\,\2/\3\,\1/\3
ships=>^([^/]+)/Ronald W.=>Ronald W./\1
ships=>^([^/]+)/Harry P.=>Harry P./\1
I have put in the sort_ships:true above the add_to_replace_metadata, so that all ships will be alphabetical. Then I added the following code, expanding it to 20 person ships (not that I think I'd get that far, but I'd rather try too many people than too few). After reading the replace_metadata page, it looks like the metadata is replaced going down the script. If so, then if there's 20 people, it will pair up the first person with each of the 19 others, before pairing up the 19 others between themselves. Then it will go to the 19 split where it will pair up the 1st person with the 18 others, pair up the 18 others, etc.
At the end of the script, it will put Ronald W. in front of any pairing he is in unless he is in a pairing with Harry P., who will be first in all of his pairings.
I do think it'll work, but would like your opinion on it.
(I did think about using the "split ships into characters" and doing something with that, but I didn't want to combine two ships with each other.)
Thanks for your help! I love your plugin!
|