Advertisement
Jousway

noteskin.lua Individual Parts

Jun 6th, 2011
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.60 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.     sButton = ret.RedirTable[sButton];
  37.    
  38.     if sElement == "Tap Fake"
  39.     then sElement = "Tap Note";
  40.     end
  41.  
  42.     if Var "Button" == "Left" and sElement == "Tap Explosion Dim"
  43.     or Var "Button" == "Left" and sElement == "Tap Explosion Bright"
  44.     then sButton = "Left";
  45.     end
  46.    
  47.     if Var "Button" == "Right" and sElement == "Tap Explosion Dim"
  48.     or Var "Button" == "Right" and sElement == "Tap Explosion Bright"
  49.     then sButton = "Right";
  50.     end
  51.    
  52.     if Var "Button" == "Up" and sElement == "Tap Explosion Dim"
  53.     or Var "Button" == "Up" and sElement == "Tap Explosion Bright"
  54.     then sButton = "Up";
  55.     end
  56.    
  57.     if Var "Button" == "UpLeft" and sElement == "Tap Explosion Dim"
  58.     or Var "Button" == "UpLeft" and sElement == "Tap Explosion Bright"
  59.     then sButton = "UpLeft";
  60.     end
  61.    
  62.     if Var "Button" == "UpRight" and sElement == "Tap Explosion Dim"
  63.     or Var "Button" == "UpRight" and sElement == "Tap Explosion Bright"
  64.     then sButton = "UpRight";
  65.     end
  66.    
  67.     return sButton, sElement;
  68. end
  69.  
  70.  
  71. local OldFunc = ret.Load;
  72. function ret.Load()
  73.     local t = OldFunc();
  74.  
  75.     --Explosion should not be rotated; it calls other actors.
  76.     if Var "Element" == "Explosion" then
  77.         t.BaseRotationZ = nil;
  78.     end
  79.     return t;
  80. end
  81. -- >
  82.  
  83.  
  84. -- Parts of noteskins which we want to rotate
  85. ret.PartsToRotate =
  86. {
  87.     ["Receptor"] = true,
  88.     ["Tap Explosion Bright"] = true,
  89.     ["Tap Explosion Dim"] = true,
  90.     ["Tap Note"] = true,
  91.     ["Tap Fake"] = true,
  92.     ["Tap Addition"] = true,
  93.     ["Hold Explosion"] = true,
  94.     ["Hold Head Active"] = true,
  95.     ["Hold Head Inactive"] = true,
  96.     ["Roll Explosion"] = true,
  97.     ["Roll Head Active"] = true,
  98.     ["Roll Head Inactive"] = true,
  99. };
  100. -- Defined the parts to be rotated at which degree
  101. ret.Rotate =
  102. {
  103.     Up = 0,
  104.     Down = 0,
  105.     Left = 0,
  106.     Right = 0,
  107.     UpLeft = 0,
  108.     UpRight = 0,
  109. };
  110.  
  111. -- Parts that should be Redirected to _Blank.png
  112. -- you can add/remove stuff if you want
  113. ret.Blank =
  114. {
  115.     ["Hold Topcap Active"] = true,
  116.     ["Hold Topcap Inactive"] = true,
  117.     ["Roll Topcap Active"] = true,
  118.     ["Roll Topcap Inactive"] = true,
  119.     ["Hold Tail Active"] = true,
  120.     ["Hold Tail Inactive"] = true,
  121.     ["Roll Tail Active"] = true,
  122.     ["Roll Tail Inactive"] = true,
  123. };
  124.  
  125. -- dont forget to close the ret cuz else it wont work ;>
  126. return ret;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement