Advertisement
Jousway

WHY WONT THIS WORK

Nov 6th, 2011
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.21 KB | None | 0 0
  1. --I am the bone of my noteskin
  2. --Arrows are my body, and explosions are my blood
  3. --I have created over a thousand noteskins
  4. --Unknown to death
  5. --Nor known to life
  6. --Have withstood pain to create many noteskins
  7. --Yet these hands will never hold anything
  8. --So as I pray, Unlimited Stepman Works
  9.  
  10. local ret = ... or {};
  11.  
  12. --Defining on which direction the other directions should be bassed on
  13. --This will let us use less files which is quite handy to keep the noteskin directory nice
  14. --Do remember this will Redirect all the files of that Direction to the Direction its pointed to
  15. --If you only want some files to be redirected take a look at the "custom hold/roll per direction"
  16. ret.RedirTable =
  17. {
  18.     Up = "Down",
  19.     Down = "Down",
  20.     Left = "Down",
  21.     Right = "Down",
  22.     UpLeft = "Down",
  23.     UpRight = "Down",
  24. };
  25.  
  26. -- <
  27. --Between here we usally put all the commands the noteskin.lua needs to do, some are extern in other files
  28. --If you need help with lua go to  http://kki.ajworld.net/lua/ssc/Lua.xml there are a bunch of codes there
  29. --Also check out commen it has a load of lua codes in files there
  30. --Just play a bit with lua its not that hard if you understand coding
  31. --But SM can be an ass in some cases, and some codes jut wont work if you dont have the noteskin on FallbackNoteSkin=common in the metric.ini
  32. local OldRedir = ret.Redir;
  33. ret.Redir = function(sButton, sElement)
  34.     sButton, sElement = OldRedir(sButton, sElement);
  35.    
  36.     --We want to use custom hold/roll per direction, but
  37.     --Keep global hold/roll heads and explosions.  
  38.     if not string.find(sElement, "Head") and
  39.     not string.find(sElement, "Explosion") then
  40.         if string.find(sElement, "Hold") or
  41.         string.find(sElement, "Roll") then
  42.        
  43.             if Var "Button" == "Right" and string.find(sElement, "Body")
  44.             then sButton = "Left";
  45.             end
  46.    
  47.             if Var "Button" == "Up" and string.find(sElement, "Body")
  48.             then sButton = "Down";
  49.             end
  50.  
  51.             if Var "Button" == "Right" and string.find(sElement, "Bottom")
  52.             then sButton = "Left";
  53.             end
  54.        
  55.             if Var "Button" == "Up" and string.find(sElement, "Bottom")
  56.             then sButton = "Down";
  57.             --   sElement = string.find(sElement, "Top");
  58.             end
  59.             return sButton, sElement;
  60.         end
  61.     end
  62.    
  63.     sButton = ret.RedirTable[sButton];
  64.    
  65.     --Making Roll Head/Explosion fallback on Hold
  66.     if  sElement == "Roll Head Inactive"
  67.     then
  68.         sElement = "Hold Head Inactive";
  69.     end
  70.    
  71.     if  sElement == "Roll Head Active"
  72.     then
  73.         sElement = "Hold Head Active";
  74.     end
  75.    
  76.     if  sElement == "Roll Explosion"
  77.     then
  78.         sElement = "Hold Explosion";
  79.     end
  80.  
  81.    
  82.     return sButton, sElement;
  83. end
  84.  
  85. local OldFunc = ret.Load;
  86. function ret.Load()
  87.     local t = OldFunc();
  88.  
  89.     --Explosion should not be rotated; it calls other actors.
  90.     if Var "Element" == "Explosion" then
  91.         t.BaseRotationZ = nil;
  92.     end
  93.    
  94.     local workyoupieceofshit = var "Element";
  95.     if Var "Button" == "Right" and string.find(workyoupieceofshit, "Body") then
  96.         t.InitCommand=cmd(zoomx,-1);
  97.         return workyoupieceofshit;
  98.     end
  99.    
  100. --[[    if Var "Button" == "Up" and string.find(var "Element", "Body")
  101.     then t.InitCommand=cmd(zoomy,-1);
  102.     end
  103.  
  104.     if Var "Button" == "Right" and string.find(var "Element", "Bottom")
  105.     then t.InitCommand=cmd(zoomx,-1);
  106.     end
  107.        
  108.     if Var "Button" == "Up" and string.find(var "Element", "Bottom")
  109.     then t.InitCommand=cmd(zoomy,-1);
  110.     end --]]
  111.        
  112.     return t;
  113. end
  114. -- >
  115.  
  116.  
  117. -- Parts of noteskins which we want to rotate
  118. ret.PartsToRotate =
  119. {
  120.     ["Receptor"] = true,
  121.     ["Tap Explosion Bright"] = true,
  122.     ["Tap Explosion Dim"] = true,
  123.     ["Tap Note"] = true,
  124.     ["Tap Fake"] = true,
  125.     ["Tap Lift"] = true,
  126.     ["Tap Addition"] = true,
  127.     ["Hold Explosion"] = true,
  128.     ["Hold Head Active"] = true,
  129.     ["Hold Head Inactive"] = true,
  130.     ["Roll Explosion"] = true,
  131.     ["Roll Head Active"] = true,
  132.     ["Roll Head Inactive"] = true,
  133. };
  134. -- Defined the parts to be rotated at which degree
  135. ret.Rotate =
  136. {
  137.     Up = 180,
  138.     Down = 0,
  139.     Left = 90,
  140.     Right = -90,
  141.     UpLeft = 135,
  142.     UpRight = 225,
  143. };
  144.  
  145. -- Parts that should be Redirected to _Blank.png
  146. -- you can add/remove stuff if you want
  147. ret.Blank =
  148. {
  149.     ["Hold Tail Active"] = true,
  150.     ["Hold Tail Inactive"] = true,
  151.     ["Roll Tail Active"] = true,
  152.     ["Roll Tail Inactive"] = true,
  153. };
  154.  
  155. -- dont forget to close the ret cuz else it wont work ;>
  156. return ret;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement