Advertisement
Jousway

USW Noteskin.lua Version 3 -All In One Support Edition-

Mar 5th, 2013
1,053
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 15.99 KB | None | 0 0
  1. --[[
  2. This file is created and is viewed best in Notepad++ or similar programs.
  3.  
  4. USW Noteskin.lua Version 3 -All In One Support Edition-
  5. Made for Stepmania 5
  6.  
  7. --------------------
  8. I am the bone of my noteskin
  9. Arrows are my body, and explosions are my blood
  10. I have created over a thousand noteskins
  11. Unknown to death
  12. Nor known to life
  13. Have withstood pain to create many noteskins
  14. Yet these hands will never hold anything
  15. So as I pray, Unlimited Stepman Works
  16. --------------------
  17.  
  18. Main XML page with lua Commands http://kki.ajworld.net/lua/sm5/Lua.xml
  19. --]]
  20.  
  21. local USWN = ... or {};
  22.  
  23. --cuz I can.
  24. local var = Var;
  25.  
  26. --Defining locals for later calling, DONT EDIT THIS!!!
  27. local nGamestate = GAMESTATE:GetCurrentGame():GetName();
  28. local nButton = Var "Button";
  29. local nElement = Var "Element";
  30. local nSprite = Var "SpriteOnly"; --We use this for holds because they are sprites because compatibility issues.
  31. local nPlayer = Var "Player";
  32. local nFolder = nGamestate.."/";
  33.  
  34. --[[
  35. Name    | Description
  36. --------|------------
  37. dance   | Dance Dance Revolution + Solo (3, 4, 6 and 8(Double) Panels)
  38. pump    | Pump It Up (5, 3(Double), 10(Double))
  39. kb7     | DJMax 7 Keys/O2Jam (6 Keys + 1 Center)
  40. ez2     | Ez2Dancer (3 Panels with 2 Hands, 3 Panels with 4 Hands and 6 Panels with 4 Hands(Double))
  41. para    | Para Para Paradise (5 Panels)
  42. ds3ddx  | Dance Station 3DDX (4 Panels with 4 Hands)
  43. beat    | Beatmania (5,7 and 14(double) Keys + Scratch, "10(double) Keys Gameplay Broken")
  44. maniax  | Dance Maniax (4 and 8(Double) Hand Receptors)
  45. techno  | TechnoMotion (4, 5, 8, 8(Double), 10(Double) and 16(Double) Panels)
  46. popn    | Pop'n Music (5 and 9 Keys)
  47. lights  | Lights (For Arcade Cab Lights, Unused)
  48. karaoke | Karaoke (Unimplemented)
  49. --]]
  50.  
  51. --Unimplemented Define Supported Gametypes for Noteskin
  52. --GameTypes = { dance,pump,kb7,ez2,para,ds3ddx,beat,maniax,techno,popn };
  53.  
  54. --Start Direction Redirect
  55.  
  56. --Direction Redirect and Rotation for Dance Dance Revolution/In The Groove Gameplay.
  57. if nGamestate == "dance" then
  58.     --Here you can define which direction you want the direction to fallback/use images from.
  59.     USWN.RedirDirection = {
  60.         Left = "Down",       --Define Left Pad Panel Fallback
  61.         UpLeft = "DownLeft",   --Define Up Left Pad Panel Fallback
  62.         Down = "Down",       --Define Down Pad Panel Fallback
  63.         Up = "Down",           --Define Up Pad Panel Fallback
  64.         UpRight = "DownLeft", --Define Up Right Pad Panel Fallback
  65.         Right = "Down",     --Define Right Pad Panel Fallback
  66.     };
  67.     USWN.RotateDirection = {
  68.         Left = 90,
  69.         UpLeft = 90,
  70.         Down = 0,
  71.         Up = 180,
  72.         UpRight = 180,
  73.         Right = -90,
  74.     };
  75.     USWN.StyleCode = function(nButton, nElement, nFolder)
  76.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  77.        
  78.         if Var "Button" == "UpLeft" or Var "Button" == "UpRight" then
  79.             nFolder = "pump/";
  80.            
  81.             if string.find(Var "Element", "Body") or string.find(Var "Element", "Bottomcap") or string.find(Var "Element", "Topcap") then
  82.                 nButton = "Center";
  83.             end;
  84.            
  85.             if Var "Element" == "Tap Note" or string.find(Var "Element", "Head") then
  86.                 nButton = "UpLeft";
  87.             end;
  88.         end;
  89.    
  90.         return nButton, nElement, nFolder;
  91.     end;
  92.    
  93. --Direction Redirect and Rotation for Pump It Up.
  94. elseif nGamestate == "pump" then
  95.     USWN.RedirDirection = {
  96.         DownLeft = "DownLeft",   --Define Down Left Pad Panel Fallback
  97.         UpLeft = "DownLeft",       --Define Up Left Pad Panel Fallback
  98.         Center = "Center",       --Define Center Pad Panel Fallback
  99.         UpRight = "DownLeft",     --Define Up Right Pad Panel Fallback
  100.         DownRight = "DownLeft", --Define Down Right Pad Panel Fallback
  101.     };
  102.     USWN.RotateDirection = {
  103.         DownLeft = 0,
  104.         UpLeft = 90,
  105.         Center = 0,
  106.         UpRight = 180,
  107.         DownRight = -90,
  108.     };
  109.     USWN.StyleCode = function(nButton, nElement, nFolder)
  110.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  111.    
  112.         if string.find(Var "Element", "Body") or string.find(Var "Element", "Bottomcap") or string.find(Var "Element", "Topcap") then
  113.             nButton = "Center";
  114.         end;
  115.        
  116.         if Var "Button" == "UpLeft" or Var "Button" == "UpRight" then
  117.             if Var "Element" == "Tap Note" or string.find(Var "Element", "Head") then
  118.                 nButton = "UpLeft";
  119.             end;
  120.         end;
  121.    
  122.         return nButton, nElement, nFolder;
  123.     end;
  124.    
  125. --Direction Redirect and Rotation for DJMax 7 Keys/O2Jam.
  126. elseif nGamestate == "kb7" then
  127.     USWN.RedirDirection = {
  128.         Key1 = "Key1", --Define Key 1 Fallback (Most Left)
  129.         Key2 = "Key2", --Define Key 2 Fallback
  130.         Key3 = "Key1", --Define Key 3 Fallback
  131.         Key4 = "Key3", --Define Key 4 Fallback (Center)
  132.         Key5 = "Key1", --Define Key 5 Fallback
  133.         Key6 = "Key2", --Define Key 6 Fallback
  134.         Key7 = "Key1", --Define Key 7 Fallback (Most Right)
  135.     };
  136.     USWN.RotateDirection = {
  137.         Key1 = 0,
  138.         Key2 = 0,
  139.         Key3 = 0,
  140.         Key4 = 0,
  141.         Key5 = 0,
  142.         Key6 = 0,
  143.         Key7 = 0,
  144.     };
  145.     USWN.StyleCode = function(nButton, nElement, nFolder)
  146.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  147.        
  148.         if Var "Element" ~= "Tap Note" and nButton == "Key2" then
  149.             if string.find(Var "Element", "Hold") or string.find(Var "Element", "Roll") then
  150.                 if string.find(Var "Element", "Explosion") then
  151.                     nButton = "Key1";
  152.                 end;
  153.                 if string.find(Var "Element", "Head") or string.find(Var "Element", "Roll") then
  154.                 else
  155.                     nButton = "Key1";
  156.                 end;
  157.             elseif Var "Element" ~= "Receptor" then
  158.                 nButton = "Key1";
  159.             end;
  160.         end;
  161.    
  162.         return nButton, nElement, nFolder;
  163.     end;
  164.    
  165. --Direction Redirect and Rotation for Ez2Dancer.
  166. elseif nGamestate == "ez2" then
  167.     USWN.RedirDirection = {
  168.         FootUpLeft = "DownLeft",   --Define Up Left Pad Panel Fallback
  169.         HandLrLeft = "Real",   --Define Lower Left Hand Sensor Fallback
  170.         HandUpLeft = "Normal",   --Define Up Left Hand Sensor Fallback
  171.         FootDown = "Down",       --Define Down Pad Panel Fallback
  172.         HandUpRight = "Normal", --Define Up Right Hand Sensor Fallback
  173.         HandLrRight = "Real", --Define Lower Right Hand Sensor Fallback
  174.         FootUpRight = "DownLeft", --Define Up Right Pad Panel Fallback
  175.     };
  176.     USWN.RotateDirection = {
  177.         FootUpLeft = 90,
  178.         HandLrLeft = 0,
  179.         HandUpLeft = 0,
  180.         FootDown = 0,
  181.         HandUpRight = 0,
  182.         HandLrRight = 0,
  183.         FootUpRight = 180,
  184.     };
  185.     USWN.StyleCode = function(nButton, nElement, nFolder)
  186.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  187.        
  188.         if Var "Button" == "FootUpLeft" or Var "Button" == "FootUpRight" then
  189.             nFolder = "pump/";
  190.            
  191.             if string.find(Var "Element", "Body") or string.find(Var "Element", "Bottomcap") or string.find(Var "Element", "Topcap") then
  192.                 nButton = "Center";
  193.             end;
  194.                        
  195.             if Var "Element" == "Receptor" then
  196.                 nFolder = "ez2/";
  197.             end;
  198.         end;
  199.        
  200.         if Var "Button" == "FootDown" then
  201.             if Var "Element" == "Tap Note" or string.find(Var "Element", "Head") or Var "Element" == "Receptor" then
  202.             else
  203.                 nFolder = "dance/";
  204.             end;
  205.         end;
  206.        
  207.         if nButton == "Real" then
  208.             if Var "Element" == "Tap Note" or string.find(Var "Element", "Head") then
  209.             else
  210.                 nButton = "Normal";
  211.             end;
  212.         end;
  213.    
  214.         return nButton, nElement, nFolder;
  215.     end;
  216.    
  217. --Direction Redirect and Rotation for Para Para Paradise.
  218. elseif nGamestate == "para" then
  219.     USWN.RedirDirection = {
  220.         Left = "Up",       --Define Left Fallback
  221.         UpLeft = "Up",   --Define Up Left Fallback
  222.         Up = "Up",           --Define Up Fallback
  223.         UpRight = "Up", --Define Up Right Fallback
  224.         Right = "Up",     --Define Right Fallback
  225.     };
  226.     USWN.RotateDirection = {
  227.         Left = -90,
  228.         UpLeft = -45,
  229.         Up = 0,
  230.         UpRight = 45,
  231.         Right = 90,
  232.     };
  233.     USWN.StyleCode = function(nButton, nElement, nFolder)
  234.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  235.        
  236.         --Really nothing needed here for para para paradise???
  237.         --I know it even amazes myself!
  238.        
  239.         --Also if you wonder why I didnt do the bottomcap's to be like para para paradise
  240.         --I hate a load of files, And people dont pay me enough!
  241.    
  242.         return nButton, nElement, nFolder;
  243.     end;
  244.    
  245. --Direction Redirect and Rotation for Dance Station 3DDX.
  246. elseif nGamestate == "ds3ddx" then
  247.     USWN.RedirDirection = {
  248.         HandLeft = "HandLeft",           --Define Left Hand Sensor Fallback
  249.         FootDownLeft = "DownLeft",   --Define Down Left Pad Panel Fallback
  250.         FootUpLeft = "DownLeft",       --Define Up Left Pad Panel Fallback
  251.         HandUp = "HandDown",               --Define Front Hand Sensor Fallback
  252.         HandDown = "HandDown",           --Define Back Hand Sensor Fallback
  253.         FootUpRight = "DownLeft",     --Define Up Right Pad Panel Fallback
  254.         FootDownRight = "DownLeft", --Define Down Right Pad Panel Fallback
  255.         HandRight = "HandLeft",         --Define Right Hand Sensor Fallback
  256.     };
  257.     USWN.RotateDirection = {
  258.         HandLeft = 0,
  259.         FootDownLeft = 0,
  260.         FootUpLeft = 90,
  261.         HandUp = 180,
  262.         HandDown = 0,
  263.         FootUpRight = 180,
  264.         FootDownRight = -90,
  265.         HandRight = 180,
  266.     };
  267.     USWN.StyleCode = function(nButton, nElement, nFolder)
  268.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  269.        
  270.         if Var "Button" == "FootUpLeft" or Var "Button" == "FootUpRight" or Var "Button" == "FootDownLeft" or Var "Button" == "FootDownRight" then
  271.             nFolder = "pump/";
  272.            
  273.             if Var "Button" == "FootDownLeft" or Var "Button" == "FootDownRight" then
  274.                 if Var "Element" == "Tap Note" or string.find(Var "Element", "Head") then
  275.                     nButton = "UpLeft";
  276.                 end;
  277.             end;
  278.            
  279.             if string.find(Var "Element", "Body") or string.find(Var "Element", "Bottomcap") or string.find(Var "Element", "Topcap") then
  280.                 nButton = "Center";
  281.             end;
  282.                        
  283.             if Var "Element" == "Receptor" then
  284.                 nFolder = "ds3ddx/";
  285.             end;
  286.         end;
  287.        
  288.         if string.find(Var "Button", "Hand") then
  289.             if string.find(Var "Element", "Body") or string.find(Var "Element", "Bottomcap") or string.find(Var "Element", "Topcap") then
  290.                 nFolder = "";
  291.                 nButton = "";
  292.                 nElement = "_Blank"; --There are no holds for hands silly
  293.             end;
  294.         end;
  295.    
  296.         return nButton, nElement, nFolder;
  297.     end;
  298.    
  299. --Direction Redirect and Rotation for Beatmania.
  300. elseif nGamestate == "beat" then
  301.     USWN.RedirDirection = {
  302.         Key1 = "Key1",                --Define Key 1 Gray Fallback (Most Left)
  303.         Key2 = "Key2",                --Define Key 2 Blue Fallback
  304.         Key3 = "Key1",                --Define Key 3 Gray Fallback
  305.         Key4 = "Key2",                --Define Key 4 Blue Fallback (Center)
  306.         Key5 = "Key1",                --Define Key 5 Gray Fallback
  307.         Key6 = "Key2",                --Define Key 6 Blue Fallback
  308.         Key7 = "Key1",                --Define Key 7 Gray Fallback (Most Right)
  309.         --Scratch = "Scratch",        --Use if you want to define up and down globaly
  310.         ["Scratch up"] = "Scratch",   --Define Scratch Up Fallback
  311.         ["Scratch down"] = "Scratch", --Define Scratch Down Fallback
  312.     };
  313.     USWN.RotateDirection = {
  314.         Key1 = 0,
  315.         Key2 = 0,
  316.         Key3 = 0,
  317.         Key4 = 0,
  318.         Key5 = 0,
  319.         Key6 = 0,
  320.         Key7 = 0,
  321.         --Scratch = 0,                --Use if you want to define up and down globaly
  322.         ["Scratch up"] = 0,
  323.         ["Scratch down"] = 0,
  324.     };
  325.     USWN.StyleCode = function(nButton, nElement, nFolder)
  326.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  327.    
  328.         return nButton, nElement, nFolder;
  329.     end;
  330.    
  331. --Direction Redirect and Rotation for Dance Maniax.
  332. elseif nGamestate == "maniax" then
  333.     USWN.RedirDirection = {
  334.         HandLrLeft = "HandLrLeft",  --Define Bottom Left Hand Sensor Fallback
  335.         HandUpLeft = "HandLrLeft",  --Define Top Left Hand Sensor Fallback
  336.         HandUpRight = "HandLrLeft", --Define Top Right Hand Sensor Fallback
  337.         HandLrLeft = "HandLrLeft",  --Define Bottom Right Hand Sensor Fallback
  338.     };
  339.     USWN.RotateDirection = {
  340.         HandLrLeft = 0,
  341.         HandUpLeft = 0,
  342.         HandUpRight = 0,
  343.         HandLrLeft = 0,
  344.     };
  345.     USWN.StyleCode = function(nButton, nElement, nFolder)
  346.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  347.    
  348.         return nButton, nElement, nFolder;
  349.     end;
  350.    
  351. --Direction Redirect and Rotation for TechnoMotion.
  352. elseif nGamestate == "techno" then
  353.     USWN.RedirDirection = {
  354.         DownLeft = "DownLeft",   --Define Down Left Pad Panel Fallback
  355.         Left = "Left",           --Define Left Pad Panel Fallback
  356.         UpLeft = "UpLeft",       --Define Up Left Pad Panel Fallback
  357.         Down = "Down",           --Define Down Pad Panel Fallback
  358.         Up = "Up",               --Define Up Pad Panel Fallback
  359.         UpRight = "UpRight",     --Define Up Right Pad Panel Fallback
  360.         Right = "Right",         --Define Right Pad Panel Fallback
  361.         DownRight = "DownRight", --Define Down Right Pad Panel Fallback
  362.     };
  363.     USWN.RotateDirection = {
  364.         DownLeft = 0,
  365.         Left = 0,
  366.         UpLeft = 0,
  367.         Down = 0,
  368.         Up = 0,
  369.         UpRight = 0,
  370.         Right = 0,
  371.         DownRight = 0,
  372.     };
  373.     USWN.StyleCode = function(nButton, nElement, nFolder)
  374.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  375.    
  376.         return nButton, nElement, nFolder;
  377.     end;
  378.    
  379. --Direction Redirect and Rotation for Pop'n Music.
  380. elseif nGamestate == "popn" then
  381.     USWN.RedirDirection = {
  382.         ["Left White"] = "White",    --Left White Button Fallback
  383.         ["Left Yellow"] = "Yellow",  --Left Yellow Button Fallback
  384.         ["Left Green"] = "Green",    --Left Green Button Fallback
  385.         ["Left Blue"] = "Blue",      --Left Blue Button Fallback
  386.         Red = "Red",                 --Center Red Button Fallback
  387.         ["Right Blue"] = "Blue",     --Right Blue Button Fallback
  388.         ["Right Green"] = "Green",   --Right Green Button Fallback
  389.         ["Right Yellow"] = "Yellow", --Right Yellow Button Fallback
  390.         ["Right White"] = "White",   --Right White Button Fallback
  391.     };
  392.     USWN.RotateDirection = {
  393.         ["Left White"] = 0,
  394.         ["Left Yellow"] = 0,
  395.         ["Left Green"] = 0,
  396.         ["Left Blue"] = 0,
  397.         Red = 0,
  398.         ["Right Blue"] = 0,
  399.         ["Right Green"] = 0,
  400.         ["Right Yellow"] = 0,
  401.         ["Right White"] = 0,
  402.     };
  403.     USWN.StyleCode = function(nButton, nElement, nFolder)
  404.         nButton = USWN.RedirDirection[nButton]; -- loading redirect directions
  405.    
  406.         return nButton, nElement, nFolder;
  407.     end;
  408.    
  409. --Global fallback incase of non known gametype.
  410. else  
  411.     USWN.RedirDirection = {};
  412.     USWN.RotateDirection = {};
  413.     USWN.StyleCode = function(nButton, nElement, nFolder)  
  414.         return nButton, nElement, nFolder;
  415.     end;
  416. end;
  417.  
  418. --/!\Lights is not a valid Gamemode./!\
  419.  
  420. --End Direction Redirect
  421.  
  422. USWN.ElementToRotate = {
  423.     ["Receptor"] = true,
  424.     ["Tap Explosion Bright"] = true,
  425.     ["Tap Explosion Dim"] = true,
  426.     ["Tap Note"] = true,
  427.     ["Tap Fake"] = true,
  428.     ["Tap Addition"] = true,
  429.     ["Hold Explosion"] = true,
  430.     ["Hold Head Active"] = true,
  431.     ["Hold Head Inactive"] = true,
  432.     ["Roll Explosion"] = true,
  433.     ["Roll Head Active"] = true,
  434.     ["Roll Head Inactive"] = true,
  435. };
  436.  
  437. --Use in case we want a part to have a blank image.
  438. USWN.Blank = {
  439.     ["Hold Tail Active"] = true,
  440.     ["Hold Tail Inactive"] = true,
  441.     ["Roll Tail Active"] = true,
  442.     ["Roll Tail Inactive"] = true,
  443. };
  444.  
  445.  
  446. --here we define extra code and the main stuff
  447. USWN.MainCode = function(nButton, nElement, nFolder)   
  448.     nButton, nElement, nFolder = USWN.StyleCode(nButton,nElement,nFolder);
  449.  
  450.     if Var "Element" == "Explosion" then
  451.         USWN.BaseRotationZ = nil;
  452.     end;
  453.                
  454.     if Var "Element" == "Tap Explosion Dim" or
  455.        Var "Element" == "Hold Explosion" or
  456.        Var "Element" == "Roll Explosion" then
  457.         nElement = "Tap Explosion Bright";
  458.     end;
  459.        
  460.     if nGamestate ~= "para" then
  461.         if string.find(Var "Element", "Head") then
  462.             nElement = "Tap Note";
  463.         end;
  464.     end;
  465.    
  466.     --We put mines at end because we dont want it to be overwriten by other stuff.
  467.     if Var "Element" == "Tap Mine" then
  468.         nButton = "Down";
  469.         nFolder = "";
  470.     end;
  471.    
  472.     return nButton, nElement, nFolder;
  473. end;
  474.  
  475. --Closing, /!\Dont edit/!\.
  476. local function Call()
  477.     local nButton = Var "Button";
  478.     local nElement = Var "Element";
  479.     if USWN.Blank[nElement] then
  480.         local blk;
  481.         if nSprite then
  482.             blk = LoadActor( "_blank" );
  483.         else
  484.             blk = Def.Actor {};
  485.         end;
  486.         return blk .. {
  487.             cmd(visible,false);
  488.         };
  489.     end;
  490.  
  491.     local nButtonToLoad, nElementToLoad, nFolderToLoad = USWN.MainCode(nButton,nElement,nFolder);
  492.  
  493.     local nPath = NOTESKIN:GetPath(nFolderToLoad..nButtonToLoad,nElementToLoad);
  494.    
  495.     local n = LoadActor( nPath );
  496.    
  497.     if USWN.ElementToRotate[nElement] then
  498.         n.BaseRotationZ = USWN.RotateDirection[nButton];
  499.     end;
  500.        
  501.     return n;
  502. end;
  503.  
  504. USWN.Load = Call;
  505. USWN.CommonLoad = Call;
  506.  
  507. return USWN;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement