SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Just like Kirby and PointySonic, this lua determines the secondary colors.
  2. // Lua originally done by Tripel for kcl_kirby-v2.wad
  3. freeslot("MT_MOVERRALLS", "S_MOVERRALLS","SPR_FOT1","SPR_FOT5", "SPR_JKVT")
  4.  
  5. local function secondcolor(player, arg1)
  6.     if arg1 == "white"
  7.         player.extracolor = 1
  8.         player.manualcolor = true
  9. player.autooppositecolor = false
  10. player.autodefaultcolor = false
  11.     elseif arg1 == "silver"
  12.         player.extracolor = 2
  13.         player.manualcolor = true
  14. player.autooppositecolor = false
  15. player.autodefaultcolor = false
  16.     elseif arg1 == "grey" or "gray"
  17.         player.extracolor = 3
  18.         player.manualcolor = true
  19. player.autooppositecolor = false
  20. player.autodefaultcolor = false
  21.     elseif arg1 == "nickel"
  22.         player.extracolor = 4
  23.         player.manualcolor = true
  24. player.autooppositecolor = false
  25. player.autodefaultcolor = false
  26.     elseif arg1 == "black"
  27.         player.extracolor = 5
  28.         player.manualcolor = true
  29. player.autooppositecolor = false
  30. player.autodefaultcolor = false
  31.     elseif arg1 == "fairy"
  32.         player.extracolor = 6
  33.         player.manualcolor = true
  34. player.autooppositecolor = false
  35. player.autodefaultcolor = false
  36.     elseif arg1 == "popcorn"
  37.         player.extracolor = 7
  38.         player.manualcolor = true
  39. player.autooppositecolor = false
  40. player.autodefaultcolor = false
  41.     elseif arg1 == "sepia"
  42.         player.extracolor = 8
  43.         player.manualcolor = true
  44. player.autooppositecolor = false
  45. player.autodefaultcolor = false
  46.     elseif arg1 == "beige"
  47.         player.extracolor = 9
  48.         player.manualcolor = true
  49. player.autooppositecolor = false
  50. player.autodefaultcolor = false
  51.     elseif arg1 == "brown"
  52.         player.extracolor = 10 
  53.         player.manualcolor = true
  54. player.autooppositecolor = false
  55. player.autodefaultcolor = false
  56.     elseif arg1 == "leather"
  57.         player.extracolor = 11
  58.         player.manualcolor = true
  59. player.autooppositecolor = false
  60. player.autodefaultcolor = false
  61.     elseif arg1 == "salmon"
  62.         player.extracolor = 12
  63.         player.manualcolor = true
  64. player.autooppositecolor = false
  65. player.autodefaultcolor = false
  66.     elseif arg1 == "pink"
  67.         player.extracolor = 13
  68.         player.manualcolor = true
  69. player.autooppositecolor = false
  70. player.autodefaultcolor = false
  71.     elseif arg1 == "rose"
  72.         player.extracolor = 14 
  73.         player.manualcolor = true
  74. player.autooppositecolor = false
  75. player.autodefaultcolor = false
  76.     elseif arg1 == "brick"
  77.         player.extracolor = 15 
  78.         player.manualcolor = true
  79. player.autooppositecolor = false
  80. player.autodefaultcolor = false
  81.     elseif arg1 == "ruby"
  82.         player.extracolor = 16 
  83.         player.manualcolor = true
  84. player.autooppositecolor = false
  85. player.autodefaultcolor = false
  86.     elseif arg1 == "raspberry"
  87.         player.extracolor = 17     
  88.         player.manualcolor = true
  89. player.autooppositecolor = false
  90. player.autodefaultcolor = false
  91.     elseif arg1 == "cherry"
  92.         player.extracolor = 18     
  93.         player.manualcolor = true
  94. player.autooppositecolor = false
  95. player.autodefaultcolor = false
  96.     elseif arg1 == "red"
  97.         player.extracolor = 19     
  98.         player.manualcolor = true
  99. player.autooppositecolor = false
  100. player.autodefaultcolor = false
  101.     elseif arg1 == "crimson"
  102.         player.extracolor = 20     
  103.         player.manualcolor = true
  104. player.autooppositecolor = false
  105. player.autodefaultcolor = false
  106.     elseif arg1 == "maroon"
  107.         player.extracolor = 21 
  108.         player.manualcolor = true
  109. player.autooppositecolor = false
  110. player.autodefaultcolor = false
  111.     elseif arg1 == "flame"
  112.         player.extracolor = 22
  113.         player.manualcolor = true
  114. player.autooppositecolor = false
  115. player.autodefaultcolor = false
  116.     elseif arg1 == "scarlet"
  117.         player.extracolor = 23 
  118.         player.manualcolor = true
  119. player.autooppositecolor = false
  120. player.autodefaultcolor = false
  121.     elseif arg1 == "ketchup"
  122.         player.extracolor = 24     
  123.         player.manualcolor = true
  124. player.autooppositecolor = false
  125. player.autodefaultcolor = false
  126.     elseif arg1 == "dawn"
  127.         player.extracolor = 25
  128.         player.manualcolor = true
  129. player.autooppositecolor = false
  130. player.autodefaultcolor = false
  131.     elseif arg1 == "sunset"
  132.         player.extracolor = 26
  133.         player.manualcolor = true
  134. player.autooppositecolor = false
  135. player.autodefaultcolor = false
  136.     elseif arg1 == "creamsicle"
  137.         player.extracolor = 27     
  138.         player.manualcolor = true
  139. player.autooppositecolor = false
  140. player.autodefaultcolor = false
  141.     elseif arg1 == "orange"
  142.         player.extracolor = 28
  143.         player.manualcolor = true
  144. player.autooppositecolor = false
  145. player.autodefaultcolor = false
  146.     elseif arg1 == "pumpkin"
  147.         player.extracolor = 29
  148.         player.manualcolor = true
  149. player.autooppositecolor = false
  150. player.autodefaultcolor = false
  151.     elseif arg1 == "rosewood"
  152.         player.extracolor = 30
  153.         player.manualcolor = true
  154. player.autooppositecolor = false
  155. player.autodefaultcolor = false
  156.     elseif arg1 == "burgundy"
  157.         player.extracolor = 31
  158.         player.manualcolor = true
  159. player.autooppositecolor = false
  160. player.autodefaultcolor = false
  161.     elseif arg1 == "tangerine"
  162.         player.extracolor = 32
  163.         player.manualcolor = true
  164. player.autooppositecolor = false
  165. player.autodefaultcolor = false
  166.     elseif arg1 == "peach"
  167.         player.extracolor = 33
  168.         player.manualcolor = true
  169. player.autooppositecolor = false
  170. player.autodefaultcolor = false
  171.     elseif arg1 == "caramel"
  172.         player.extracolor = 34
  173.         player.manualcolor = true
  174. player.autooppositecolor = false
  175. player.autodefaultcolor = false
  176.     elseif arg1 == "cream"
  177.         player.extracolor = 35
  178.         player.manualcolor = true
  179. player.autooppositecolor = false
  180. player.autodefaultcolor = false
  181.     elseif arg1 == "gold"
  182.         player.extracolor = 36
  183.         player.manualcolor = true
  184. player.autooppositecolor = false
  185. player.autodefaultcolor = false
  186.     elseif arg1 == "royal"
  187.         player.extracolor = 37
  188.         player.manualcolor = true
  189. player.autooppositecolor = false
  190. player.autodefaultcolor = false
  191.     elseif arg1 == "bronze"
  192.         player.extracolor = 38
  193.         player.manualcolor = true
  194. player.autooppositecolor = false
  195. player.autodefaultcolor = false
  196.     elseif arg1 == "copper"
  197.         player.extracolor = 39
  198.         player.manualcolor = true
  199. player.autooppositecolor = false
  200. player.autodefaultcolor = false
  201.     elseif arg1 == "yellow"
  202.         player.extracolor = 40
  203.         player.manualcolor = true
  204. player.autooppositecolor = false
  205. player.autodefaultcolor = false
  206.     elseif arg1 == "mustard"
  207.         player.extracolor = 41
  208.         player.manualcolor = true
  209. player.autooppositecolor = false
  210. player.autodefaultcolor = false
  211.     elseif arg1 == "olive"
  212.         player.extracolor = 42
  213.         player.manualcolor = true
  214. player.autooppositecolor = false
  215. player.autodefaultcolor = false
  216.     elseif arg1 == "vomit"
  217.         player.extracolor = 43
  218.         player.manualcolor = true
  219. player.autooppositecolor = false
  220. player.autodefaultcolor = false
  221.     elseif arg1 == "garden"
  222.         player.extracolor = 44
  223.         player.manualcolor = true
  224. player.autooppositecolor = false
  225. player.autodefaultcolor = false
  226.     elseif arg1 == "lime"
  227.         player.extracolor = 45
  228.         player.manualcolor = true
  229. player.autooppositecolor = false
  230. player.autodefaultcolor = false
  231.     elseif arg1 == "handheld"
  232.         player.extracolor = 46
  233.         player.manualcolor = true
  234. player.autooppositecolor = false
  235. player.autodefaultcolor = false
  236.     elseif arg1 == "tea"
  237.         player.extracolor = 47
  238.         player.manualcolor = true
  239. player.autooppositecolor = false
  240. player.autodefaultcolor = false
  241.     elseif arg1 == "pistachio"
  242.         player.extracolor = 48
  243.         player.manualcolor = true
  244. player.autooppositecolor = false
  245. player.autodefaultcolor = false
  246.     elseif arg1 == "moss"
  247.         player.extracolor = 49
  248.         player.manualcolor = true
  249. player.autooppositecolor = false
  250. player.autodefaultcolor = false
  251.     elseif arg1 == "camouflauge"
  252.         player.extracolor = 50
  253.         player.manualcolor = true
  254. player.autooppositecolor = false
  255. player.autodefaultcolor = false
  256.     elseif arg1 == "robo-hood" or "robohood" or "robo_hood"
  257.         player.extracolor = 51
  258.         player.manualcolor = true
  259. player.autooppositecolor = false
  260. player.autodefaultcolor = false
  261.     elseif arg1 == "mint"
  262.         player.extracolor = 52
  263.         player.manualcolor = true
  264. player.autooppositecolor = false
  265. player.autodefaultcolor = false
  266.     elseif arg1 == "green"
  267.         player.extracolor = 53
  268.         player.manualcolor = true
  269. player.autooppositecolor = false
  270. player.autodefaultcolor = false
  271.     elseif arg1 == "pinetree"
  272.         player.extracolor = 54
  273.         player.manualcolor = true
  274. player.autooppositecolor = false
  275. player.autodefaultcolor = false
  276.     elseif arg1 == "emerald"
  277.         player.extracolor = 55
  278.         player.manualcolor = true
  279. player.autooppositecolor = false
  280. player.autodefaultcolor = false
  281.     elseif arg1 == "swamp"
  282.         player.extracolor = 56
  283.         player.manualcolor = true
  284. player.autooppositecolor = false
  285. player.autodefaultcolor = false
  286.     elseif arg1 == "dream"
  287.         player.extracolor = 57
  288.         player.manualcolor = true
  289. player.autooppositecolor = false
  290. player.autodefaultcolor = false
  291.     elseif arg1 == "plague"
  292.         player.extracolor = 58
  293.         player.manualcolor = true
  294. player.autooppositecolor = false
  295. player.autodefaultcolor = false
  296.     elseif arg1 == "algae"
  297.         player.extracolor = 59
  298.         player.manualcolor = true
  299. player.autooppositecolor = false
  300. player.autodefaultcolor = false
  301.     elseif arg1 == "caribbean"
  302.         player.extracolor = 60
  303.         player.manualcolor = true
  304. player.autooppositecolor = false
  305. player.autodefaultcolor = false
  306.     elseif arg1 == "aqua"
  307.         player.extracolor = 61
  308.         player.manualcolor = true
  309. player.autooppositecolor = false
  310. player.autodefaultcolor = false
  311.     elseif arg1 == "teal"
  312.         player.extracolor = 62
  313.         player.manualcolor = true
  314. player.autooppositecolor = false
  315. player.autodefaultcolor = false
  316.     elseif arg1 == "cyan"
  317.         player.extracolor = 63
  318.         player.manualcolor = true
  319. player.autooppositecolor = false
  320. player.autodefaultcolor = false
  321.     elseif arg1 == "jawz"
  322.         player.extracolor = 64
  323.         player.manualcolor = true
  324. player.autooppositecolor = false
  325. player.autodefaultcolor = false
  326.     elseif arg1 == "cerulean"
  327.         player.extracolor = 65
  328.         player.manualcolor = true
  329. player.autooppositecolor = false
  330. player.autodefaultcolor = false
  331.     elseif arg1 == "navy"
  332.         player.extracolor = 66
  333.         player.manualcolor = true
  334. player.autooppositecolor = false
  335. player.autodefaultcolor = false
  336.     elseif arg1 == "platinum"
  337.         player.extracolor = 67
  338.         player.manualcolor = true
  339. player.autooppositecolor = false
  340. player.autodefaultcolor = false
  341.     elseif arg1 == "slate"
  342.         player.extracolor = 68
  343.         player.manualcolor = true
  344. player.autooppositecolor = false
  345. player.autodefaultcolor = false
  346.     elseif arg1 == "steel"
  347.         player.extracolor = 69
  348.         player.manualcolor = true
  349. player.autooppositecolor = false
  350. player.autodefaultcolor = false
  351.     elseif arg1 == "rust"
  352.         player.extracolor = 70
  353.         player.manualcolor = true
  354. player.autooppositecolor = false
  355. player.autodefaultcolor = false
  356.     elseif arg1 == "jet"
  357.         player.extracolor = 71
  358.         player.manualcolor = true
  359. player.autooppositecolor = false
  360. player.autodefaultcolor = false
  361.     elseif arg1 == "sapphire"
  362.         player.extracolor = 72
  363.         player.manualcolor = true
  364. player.autooppositecolor = false
  365. player.autodefaultcolor = false
  366.     elseif arg1 == "periwinkle"
  367.         player.extracolor = 73
  368.         player.manualcolor = true
  369. player.autooppositecolor = false
  370. player.autodefaultcolor = false
  371.     elseif arg1 == "blue"
  372.         player.extracolor = 74
  373.         player.manualcolor = true
  374. player.autooppositecolor = false
  375. player.autodefaultcolor = false
  376.     elseif arg1 == "blueberry"
  377.         player.extracolor = 75
  378.         player.manualcolor = true
  379. player.autooppositecolor = false
  380. player.autodefaultcolor = false
  381.     elseif arg1 == "nova"
  382.         player.extracolor = 76
  383.         player.manualcolor = true
  384. player.autooppositecolor = false
  385. player.autodefaultcolor = false
  386.     elseif arg1 == "pastel"
  387.         player.extracolor = 77
  388.         player.manualcolor = true
  389. player.autooppositecolor = false
  390. player.autodefaultcolor = false
  391.     elseif arg1 == "moonslam"
  392.         player.extracolor = 78
  393.         player.manualcolor = true
  394. player.autooppositecolor = false
  395. player.autodefaultcolor = false
  396.     elseif arg1 == "ultraviolet"
  397.         player.extracolor = 79
  398.         player.manualcolor = true
  399. player.autooppositecolor = false
  400. player.autodefaultcolor = false
  401.     elseif arg1 == "dusk"
  402.         player.extracolor = 80
  403.         player.manualcolor = true
  404. player.autooppositecolor = false
  405. player.autodefaultcolor = false
  406.     elseif arg1 == "bubblegum"
  407.         player.extracolor = 81
  408.         player.manualcolor = true
  409. player.autooppositecolor = false
  410. player.autodefaultcolor = false
  411.     elseif arg1 == "purple"
  412.         player.extracolor = 82
  413.         player.manualcolor = true
  414. player.autooppositecolor = false
  415. player.autodefaultcolor = false
  416.     elseif arg1 == "fuchsia"
  417.         player.extracolor = 83
  418.         player.manualcolor = true
  419. player.autooppositecolor = false
  420. player.autodefaultcolor = false
  421.     elseif arg1 == "toxic"
  422.         player.extracolor = 84
  423.         player.manualcolor = true
  424. player.autooppositecolor = false
  425. player.autodefaultcolor = false
  426.     elseif arg1 == "mauve"
  427.         player.extracolor = 85
  428.         player.manualcolor = true
  429. player.autooppositecolor = false
  430. player.autodefaultcolor = false
  431.     elseif arg1 == "lavender"
  432.         player.extracolor = 86
  433.         player.manualcolor = true
  434. player.autooppositecolor = false
  435. player.autodefaultcolor = false
  436.     elseif arg1 == "byzantium"
  437.         player.extracolor = 87
  438.         player.manualcolor = true
  439. player.autooppositecolor = false
  440. player.autodefaultcolor = false
  441.     elseif arg1 == "pomegranate"
  442.         player.extracolor = 88
  443.         player.manualcolor = true
  444.         player.autooppositecolor = false
  445.         player.autodefaultcolor = false
  446.     elseif arg1 == "lilac"
  447.         player.extracolor = 89
  448.         player.manualcolor = true
  449.         player.autooppositecolor = false
  450.         player.autodefaultcolor = false
  451.     elseif arg1 == "opposite"
  452.         player.extracolor = ColorOpposite(player.mo.color) 
  453.         player.manualcolor = false
  454.         player.autooppositecolor = true
  455.         player.autodefaultcolor = false
  456.     elseif arg1 == "default"
  457.         player.extracolor = overlaydefaultcolor(player.mo)
  458.         player.manualcolor = false
  459.         player.autooppositecolor = false
  460.         player.autodefaultcolor = true
  461.     elseif arg1 == nil
  462.         CONS_Printf(player, "secondcolor/colorb [colorname or number]")
  463.         player.manualcolor = true
  464.         player.autooppositecolor = false
  465.         player.autodefaultcolor = false
  466.     elseif tonumber(arg1) != nil
  467.         arg1 = tonumber(arg1)
  468.         if arg1 > 0 and arg1 < 89
  469.             player.extracolor = arg1
  470.             player.manualcolor = true
  471.             player.autooppositecolor = false
  472.             player.autodefaultcolor = false
  473.         end
  474.     else CONS_Printf(player, "Invalid Color")
  475.     end
  476. end
  477.    
  478. local function overlayskin(player)
  479.    for player in players.iterate
  480.    local oversprite = SPR_NULL
  481.     if player.mo.skin == "sonic"
  482.         oversprite = SPR_FOT1
  483.     // elseif player.mo.skin == "tails"
  484.     //  oversprite = SPR_FOT2
  485.     // elseif player.mo.skin == "knuckles"
  486.     //  oversprite = SPR_FOT3
  487.     // elseif player.mo.skin == "metalsonic"
  488.     //  oversprite = SPR_FOT4
  489.     elseif player.mo.skin == "eggman"
  490.     oversprite = SPR_FOT5      
  491.     elseif player.mo.skin == "joker"
  492.         oversprite = SPR_JKVT
  493.     else
  494.         oversprite = SPR_NULL  
  495.     end
  496.     return oversprite
  497.     end
  498. end
  499.  
  500. local function validoverlayskin(mo)
  501.     if mo.skin == "sonic"
  502.     // or mo.skin == "tails"
  503.     // or mo.skin == "knuckles"
  504.     // or mo.skin == "metalsonic"
  505.     or mo.skin == "eggman" 
  506.     or mo.skin == "joker"
  507.     return true
  508.     else
  509.     return false
  510.     end
  511. end
  512.  
  513. local function overlaydefaultcolor(mo)
  514.    local defcolor = 53
  515.     if mo.skin == "sonic"
  516.         defcolor = 53
  517.     // elseif mo.skin == "tails"
  518.     //  defcolor = 19
  519.     // elseif mo.skin == "knuckles"
  520.     //  defcolor = 19
  521.     // elseif mo.skin == "metalsonic"
  522.     //  defcolor = 19
  523.     elseif mo.skin == "eggman"
  524.         defcolor = 19
  525.     elseif mo.skin == "joker"
  526.         defcolor = 5
  527.     else
  528.         defcolor = 53
  529.     end
  530.     return defcolor
  531. end
  532.  
  533. function A_SignPlayer(actor, var1, var2)
  534.     super(actor, var1, var2)
  535.     if actor.target and actor.target.valid
  536.     if actor.target.player and actor.target.player.valid
  537.     actor.cusval = actor.target.player.extracolor
  538.     end
  539.     end
  540. end
  541.  
  542. COM_AddCommand("secondcolor", secondcolor)
  543. COM_AddCommand("colorb", secondcolor)
  544. COM_AddCommand("secondcolor2", secondcolor, 2)
  545. COM_AddCommand("colorb2", secondcolor, 2)
  546. COM_AddCommand("secondcolor3", secondcolor, 3)
  547. COM_AddCommand("colorb3", secondcolor, 3)
  548. COM_AddCommand("secondcolor4", secondcolor, 4)
  549. COM_AddCommand("colorb4", secondcolor, 4)
  550.        
  551. addHook("ThinkFrame", function()
  552.     for player in players.iterate
  553.         // **** Put your own character's name (not true name!) here! **** DFSASD
  554.         if(player.mo and player.mo.valid and validoverlayskin(player.mo))
  555.             // Create the second object
  556.             if not(player.moveralls and player.moveralls.valid)
  557.                 // **** Change the xxxx here! This is the same as the MT you put in earlier! **** DFSASD
  558.                 player.moveralls = P_SpawnMobj(player.mo.x, player.mo.y, player.mo.z, MT_MOVERRALLS)
  559.             end
  560.            
  561.             // Set the second object's frame to your character's frame! (and tics)
  562.             player.moveralls.state = player.mo.state
  563.             player.moveralls.frame = player.mo.frame
  564.             player.moveralls.tics = player.mo.tics
  565.            
  566.             // Match the colors!
  567.             if player.extracolor == nil
  568.                 player.extracolor = overlaydefaultcolor(player.mo)
  569.                 player.manualcolor = false
  570.                player.autooppositecolor = false
  571.                player.autodefaultcolor = true
  572.             else
  573.                 player.moveralls.color = player.extracolor
  574.             end
  575.            
  576.             if player.lastcolor == nil
  577.               player.lastcolor = player.mo.color
  578.             end
  579.                        
  580.             if player.lastskin == nil
  581.               player.lastskin = player.mo.skin
  582.             end
  583.                
  584.             //print(player.extracolor)
  585.             print(player.manualcolor)
  586.             print(player.autooppositecolor)
  587.             print(player.autodefaultcolor)
  588.             print(player.moveralls.color)
  589.             //print(player.lastskin)
  590.             //print(player.lastcolor)
  591.             //print(player.moveralls.sprite)
  592.             //print(overlayskin(player))
  593.            
  594.             if player.autooppositecolor == true
  595.                if player.lastcolor != player.mo.color
  596.                player.lastcolor = player.mo.color
  597.                player.extracolor = ColorOpposite(player.mo.color)
  598.                player.moveralls.color = player.extracolor
  599.                print(player.extracolor)
  600.                end
  601.             end
  602.  
  603.             if player.autodefaultcolor == true
  604.                if player.lastskin != player.mo.skin
  605.                player.lastskin = player.mo.skin            
  606.                player.extracolor = overlaydefaultcolor(player.mo)
  607.                player.moveralls.color = player.extracolor              
  608.                print(player.extracolor)
  609.                end
  610.             end                                
  611.            
  612.             // Move the second object and face to your character!
  613.             P_TeleportMove(player.moveralls, player.mo.x, player.mo.y, player.mo.z)
  614.            
  615.             // Make the second object and face's angles the same as the player's!
  616.             player.moveralls.angle = player.frameangle
  617.            
  618.             // Scale them the same too!
  619.             player.moveralls.scale = player.mo.scale
  620.            
  621.             // Also height
  622.             player.moveralls.height = player.mo.height
  623.            
  624.             // Set the second object's sprite to the second object's... sprite... yeah could've put that better but whatever
  625.             // **** Change this to your SPR you put earlier! **** DFSASD
  626.             player.moveralls.sprite = overlayskin(player)
  627.            
  628.             // REVERSE GRAVITY WOAAAAAH
  629.             if(player.mo.eflags & MFE_VERTICALFLIP)
  630.                 player.moveralls.eflags = $1|MFE_VERTICALFLIP
  631.             else
  632.                 player.moveralls.eflags = $1 & ~MFE_VERTICALFLIP
  633.             end
  634.            
  635.             // MF2_DONTDRAW WOAAAAAH
  636.             if(player.mo.flags2 & MF2_DONTDRAW)
  637.                 or not(player.mo.sprite == SPR_PLAY)
  638.                 player.moveralls.flags2 = $1|MF2_DONTDRAW
  639.             else
  640.                 player.moveralls.flags2 = $1 & ~MF2_DONTDRAW
  641.             end
  642.            
  643.             // Keep the sobj and face in the world!
  644.             player.moveralls.timer = 1
  645.         else
  646.             if(player.moveralls and player.moveralls.valid)
  647.                 P_RemoveMobj(player.moveralls)
  648.             end
  649.         end
  650.     end
  651. end)
  652.  
  653. addHook("MobjThinker", function(overlay)
  654.     // ***** Put your own character's name (not true name!) here! ***** DFSASD
  655.     if validoverlayskin(overlay)
  656.         and(overlay.target and overlay.target.valid)       
  657.         // Create the second object
  658.         // **** Change the xxxx here! This is the same as the MT you put in earlier! **** DFSASD
  659.         overlay.moveralls = P_SpawnMobj(overlay.target.x, overlay.target.y, overlay.target.z, MT_MOVERRALLS)
  660.        
  661.         // Set the second object's frame to your character's frame! (and tics)
  662.         local height = states[overlay.state].var2*FRACUNIT
  663.         // Wiki's down, so replace 117 and 922 with the proper object type and state constant when its back up
  664.         if not(overlay.target.type == MT_SIGN)
  665.             overlay.moveralls.state = overlay.state
  666.             overlay.moveralls.frame = overlay.frame
  667.             overlay.moveralls.tics = overlay.tics
  668.         elseif(overlay.target.type == MT_SIGN)
  669.             overlay.moveralls.color = overlay.target.cusval
  670.             overlay.moveralls.frame = S
  671.         end
  672.                
  673.            
  674.         // Move the second object and face to your character!
  675.         P_TeleportMove(overlay.moveralls, overlay.x, overlay.y, overlay.target.z+height)
  676.        
  677.         // Make the second object and face's angles the same as the player's!
  678.         overlay.moveralls.angle = overlay.angle
  679.        
  680.         // Scale them the same too!
  681.         overlay.moveralls.scale = overlay.scale
  682.        
  683.         // Also height
  684.         overlay.moveralls.height = overlay.height
  685.        
  686.         // Set the second object's sprite to the second object's... sprite... yeah could've put that better but whatever
  687.         // **** Change this to your SPR you put earlier! **** DFSASD
  688.         overlay.moveralls.sprite = overlayskin(overlay.target.player)
  689.        
  690.         // REVERSE GRAVITY WOAAAAAH
  691.         if(overlay.eflags & MFE_VERTICALFLIP)
  692.             overlay.moveralls.eflags = $1|MFE_VERTICALFLIP
  693.         else
  694.             overlay.moveralls.eflags = $1 & ~MFE_VERTICALFLIP
  695.         end
  696.        
  697.         // MF2_DONTDRAW WOAAAAAH
  698.         if(overlay.flags2 & MF2_DONTDRAW)
  699.             or(overlay.target.sprite == SPR_PINV)
  700.             overlay.moveralls.flags2 = $1|MF2_DONTDRAW
  701.         else
  702.             overlay.moveralls.flags2 = $1 & ~MF2_DONTDRAW
  703.         end
  704.        
  705.         overlay.moveralls.flags = $1|MF_NOGRAVITY
  706.        
  707.         overlay.momz = 0
  708.        
  709.         // **** Change this to your SPR you put earlier! **** DFSASD
  710.         overlay.moveralls.sprite = overlayskin(overlay.target.player)
  711.        
  712.         overlay.moveralls.timer = 1
  713.     end
  714. end, MT_OVERLAY)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top