TheHirou

Why doesn't this script exist? @ Pastebin

Jul 22nd, 2022 (edited)
364
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* between
  2.  
  3. This value checks if valcheck is between val1 and val2, if so it returns true.
  4.  
  5. */
  6.  
  7.  
  8. function between(valcheck,val1,val2)
  9. {
  10.     if valcheck>val1 and valcheck<val2
  11.     {
  12.     return true;   
  13.     }else{return false}
  14. }
  15.  
  16. function equalBetween(valcheck,val1,val2)
  17. {
  18.     if valcheck>=val1 and valcheck<=val2
  19.     {
  20.     return true;   
  21.     }else{return false}
  22. }
  23.  
  24. /* bool_to_string
  25.  
  26. 0??, 1?? Just tell me if it is true or false!
  27. Converts real number 1 or 0 to string true or false
  28.  
  29. */
  30.  
  31. function bool_to_string(value){
  32.  
  33.  
  34.    
  35.     switch (real(value))
  36.     {
  37.         case 0:
  38.                 return "false"
  39.             break;
  40.            
  41.         case 1:
  42.                 return "true"
  43.             break;
  44.            
  45.         default:
  46.                 return "Not a boolean."
  47.             break;
  48.     }
  49.  
  50. }
  51.  
  52. /* draw_rectangle_thick
  53.  
  54. Draw a rectangle with outline borders that you can modify
  55.  
  56. */
  57.  
  58. function draw_rectangle_thick(x1,y1,x2,y2,color,width){ //This might need optimization
  59.  
  60. draw_set_color(color)
  61. draw_rectangle(x1,y1,x2,y2,true)
  62.  
  63. var i = 0
  64.  
  65. do
  66. {
  67.     i += 1
  68.     draw_rectangle(x1-i,y1-i,x2+i,y2+i,true)
  69. }
  70. until(i = width)
  71.  
  72. }
  73.  
  74. /* draw_text_outline
  75.  
  76. This is the quick solution to adding outlines to your text without using shaders, it takes the same arguments as a normal draw_text_color
  77. but adds the color_outline argument, for the color of the outline and the outline_big argument to check how big the outline is going to be.
  78.  
  79. That last argument kinda depends on how big your font is, if you use a value excesively higher it might look bad, as I said, this is the quick
  80. solution to adding outlines to your text, gotta play around with that value, usually, a value from 1 to 3 will look good in any font.
  81.  
  82. */
  83.  
  84. function draw_text_outline(x_,y_,string_,color1,color2,color3,color4,color_outline,outline_big,alpha_){
  85.  
  86. draw_text_color(x_+outline_big,y_,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+
  87. draw_text_color(x_,y_+outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
  88. draw_text_color(x_-outline_big,y_,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X-
  89. draw_text_color(x_,y_-outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
  90.  
  91. draw_text_color(x_+outline_big,y_+outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y+
  92. draw_text_color(x_-outline_big,y_-outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y-
  93. draw_text_color(x_+outline_big,y_-outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y-
  94. draw_text_color(x_-outline_big,y_+outline_big,string_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y+
  95.  
  96. draw_text_color(x_,y_,string_,color1,color2,color3,color4,alpha_)
  97.  
  98. }
  99.  
  100. function draw_text_ext_outline(x_,y_,string_,sep_,w_,color1,color2,color3,color4,color_outline,outline_big,alpha_){
  101.  
  102. draw_text_ext_color(x_+outline_big,y_,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+
  103. draw_text_ext_color(x_,y_+outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
  104. draw_text_ext_color(x_-outline_big,y_,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X-
  105. draw_text_ext_color(x_,y_-outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
  106.  
  107. draw_text_ext_color(x_+outline_big,y_+outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y+
  108. draw_text_ext_color(x_-outline_big,y_-outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y-
  109. draw_text_ext_color(x_+outline_big,y_-outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y-
  110. draw_text_ext_color(x_-outline_big,y_+outline_big,string_,sep_,w_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y+
  111.  
  112. draw_text_ext_color(x_,y_,string_,sep_,w_,color1,color2,color3,color4,alpha_)
  113.  
  114. }
  115.  
  116. function draw_text_transformed_outline(x_,y_,string_,xscale_,yscale_,angle_,color1,color2,color3,color4,color_outline,outline_big,alpha_){
  117.  
  118. draw_text_transformed_color(x_+outline_big,y_,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+
  119. draw_text_transformed_color(x_,y_+outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
  120. draw_text_transformed_color(x_-outline_big,y_,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X-
  121. draw_text_transformed_color(x_,y_-outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //Y+
  122.  
  123. draw_text_transformed_color(x_+outline_big,y_+outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y+
  124. draw_text_transformed_color(x_-outline_big,y_-outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y-
  125. draw_text_transformed_color(x_+outline_big,y_-outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X+ Y-
  126. draw_text_transformed_color(x_-outline_big,y_+outline_big,string_,xscale_,yscale_,angle_,color_outline,color_outline,color_outline,color_outline,alpha_) //X- Y+
  127.  
  128. draw_text_transformed_color(x_,y_,string_,xscale_,yscale_,angle_,color1,color2,color3,color4,alpha_)
  129.  
  130. }
  131.  
  132. /* draw_text_shadow
  133.  
  134. This takes the same arguments as a draw_text_color but also adds the color_shadow argument (The color for your shadow),
  135. pos_shadow_x, the X direction for the shadow (Can also be negative) and the
  136. pos_shadow_y, the Y direction for the shadow (Can also be negative)
  137.  
  138. */
  139.  
  140. function draw_text_shadow(x_,y_,string_,color1,color2,color3,color4,color_shadow,pos_shadow_x,pos_shadow_y,alpha_){
  141.  
  142. draw_text_color(x_+pos_shadow_x,y_+pos_shadow_y,string_,color_shadow,color_shadow,color_shadow,color_shadow,alpha_)
  143.  
  144. draw_text_color(x_,y_,string_,color1,color2,color3,color4,alpha_)
  145.  
  146. }
  147.  
  148. function draw_text_ext_shadow(x_,y_,string_,sep_,w_,color1,color2,color3,color4,color_shadow,pos_shadow_x,pos_shadow_y,alpha_){
  149.  
  150. draw_text_ext_color(x_+pos_shadow_x,y_+pos_shadow_y,string_,sep_,w_,color_shadow,color_shadow,color_shadow,color_shadow,alpha_)
  151.  
  152. draw_text_ext_color(x_,y_,string_,sep_,w_,color1,color2,color3,color4,alpha_)
  153.  
  154. }
  155.  
  156. function draw_text_transformed_shadow(x_,y_,string_,xscale_,yscale_,angle_,color1,color2,color3,color4,color_shadow,pos_shadow_x,pos_shadow_y,alpha_){
  157.  
  158. draw_text_transformed_color(x_+pos_shadow_x,y_+pos_shadow_y,string_,xscale_,yscale_,angle_,color_shadow,color_shadow,color_shadow,color_shadow,alpha_)
  159.  
  160. draw_text_transformed_color(x_,y_,string_,xscale_,yscale_,angle_,color1,color2,color3,color4,alpha_)
  161.  
  162. }
  163.  
  164. /* instance_create_once
  165.  
  166. Shortcut for creating an instance when that instance doesn't exist yet, basically it just creates it once.
  167.  
  168. */
  169.  
  170.  
  171. function instance_create_depth_once(x_,y_,depth_,obj_,struct_=false){
  172.  
  173. if !instance_exists(obj_)
  174.     {
  175.         var idToReturn=instance_create_depth(x_,y_,depth_,obj_,struct_)
  176.         return idToReturn.id
  177.     }
  178.  
  179. }
  180.  
  181. function instance_create_layer_once(x_,y_,layer_,obj_,struct_=false){
  182.  
  183. if !instance_exists(obj_)
  184.     {
  185.         var idToReturn=instance_create_depth(x_,y_,layer_,obj_,struct_)
  186.         return idToReturn.id
  187.     }
  188.  
  189. }
  190.  
  191. /* print
  192.  
  193. Who in YoYo Games thought that it was a good idea to make the print function "show_debug_message"?
  194. That word is too long and I'm too lazy to write all of that everytime I want to print something.
  195.  
  196. */
  197.  
  198. function print(string_){
  199.  
  200. show_debug_message(string_)
  201.  
  202. }
  203.  
  204. //And for the lazier ones:
  205. function p(string_){
  206.  
  207. show_debug_message(string_)
  208.  
  209. }
  210.  
  211. /* scr_speedhack
  212.  
  213. Script must be on step event or similar.
  214.  
  215. hile you're pressing the key assigned in the key argument your room speed
  216. will be whatever you put in the velocity argument, this will make your game go faster.
  217. This is useful for playtesting.
  218.  
  219. !HIGH VELOCITY VALUES MIGHT MESS UP WITH THE GAME WHEN SPEEDHACKING!
  220. A good value range is between 10 and 6000
  221.  
  222. Usually anything below 60 is slowmo.
  223.  
  224. The blue ball moving at the bottom is to check the room speed.
  225.  
  226. */
  227.  
  228.  
  229. function scr_speedhack(key,velocity){
  230.  
  231. if keyboard_check(key)
  232. {
  233. room_speed=velocity
  234. }else{room_speed=60} //CHANGE THIS TO WHATEVER YOUR NORMAL ROOM SPEED IS
  235.  
  236. }
Add Comment
Please, Sign In to add comment