Advertisement
Guest User

Plate for the Event

a guest
Aug 20th, 2017
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.42 KB | None | 0 0
  1. #[
  2. Important!!!!!!!!!
  3.  
  4. Holograms are not magic, they are still entities and they still take server resources.
  5. You should consider them the same as you would any other prop.
  6.  
  7. Ideally this tool is to be used for minor details, not entire contraptions.
  8. ]#
  9.  
  10. @name Cre8ive Motorsport 2017 Plate
  11. @inputs BaseProp:entity
  12. @persist [ID SpawnStatus CoreStatus]:string [HT CT BG]:table [HN CN SpawnCounter ScaleFactor ToggleColMat ToggleShading] BaseParent:entity Rescale:vector
  13.  
  14. if ( dupefinished() | first() ) {
  15.  
  16. #Settings
  17. ScaleFactor = 0.2 #scales the contraption
  18. ToggleColMat = 1 #disables materials and color
  19. ToggleShading = 0 #disables shading
  20.  
  21.  
  22. #Holo data
  23. HN++,HT[HN,array] = array(1,vec(0.000000,0.000000,-0.000000),ang(0.000000,90.000000,180.000000),"models/sprops/triangles/right/size_1_5/rtri_18x66.mdl","wtp/paint_4",vec4(255,255,255,255))
  24. HN++,HT[HN,array] = array(2,vec(-1.656250,0.500000,0.031250),ang(0.439453,-180.000000,-180.000000),"models/sprops/misc/alphanum/alphanum_s.mdl","wtp/paint_2",vec4(40,40,40,255))
  25. HN++,HT[HN,array] = array(3,vec(24.531250,0.500001,0.406250),ang(0.087891,-180.000000,-180.000000),"models/sprops/misc/alphanum/alphanum_7.mdl","wtp/paint_2",vec4(40,40,40,255))
  26. HN++,HT[HN,array] = array(4,vec(-13.468750,0.499999,-0.031250),ang(0.263672,-180.000000,-180.000000),"models/sprops/misc/alphanum/alphanum_m.mdl","wtp/paint_2",vec4(40,40,40,255))
  27. HN++,HT[HN,array] = array(5,vec(-0.312500,0.687499,-7.062500),ang(0.000000,0.043945,-179.604492),"models/sprops/geometry/t_hdisc_60.mdl","wtp/paint_4",vec4(255,255,255,255))
  28. HN++,HT[HN,array] = array(6,vec(8.062500,0.500000,0.281250),ang(-0.527344,-180.000000,179.956055),"models/sprops/misc/alphanum/alphanum_quote.mdl","wtp/paint_2",vec4(40,40,40,255))
  29. HN++,HT[HN,array] = array(7,vec(-24.718750,0.499999,-0.000000),ang(0.043945,-180.000000,179.956055),"models/sprops/misc/alphanum/alphanum_c.mdl","wtp/paint_2",vec4(40,40,40,255))
  30. HN++,HT[HN,array] = array(8,vec(-0.250000,-0.000000,0.031250),ang(-0.000000,-180.000000,-180.000000),"models/sprops/triangles/right/size_1_5/rtri_18x66.mdl","wtp/paint_4",vec4(200,56,56,255))
  31. HN++,HT[HN,array] = array(9,vec(16.312500,0.500001,0.062500),ang(0.615234,-180.000000,179.956055),"models/sprops/misc/alphanum/alphanum_1.mdl","wtp/paint_2",vec4(40,40,40,255))
  32.  
  33.  
  34. #[
  35. HOLOGRAM LOADER - DO NOT EDIT BELOW THIS LINE
  36.  
  37. IF YOU WISH TO EDIT HOLOGRAMS AFTER SPAWNING, PLACE CODE AFTER THE
  38.  
  39. elseif ( CoreStatus == "InitPostSpawn" ) {
  40.  
  41. CODEBLOCK AT THE BOTTOM
  42. ]#
  43.  
  44. BaseParent = BaseProp ?: entity()
  45. Rescale = vec( ScaleFactor )
  46.  
  47. function array:holo() {
  48. local Index = This[1, number]
  49. local Parent = Index != 1 ? holoEntity( 1 ) : BaseParent
  50.  
  51. holoCreate( Index, Parent:toWorld( This[2, vector]*ScaleFactor ), Rescale, Parent:toWorld( This[3, angle] ), vec( 255 ), This[4, string] ?: "cube" )
  52. holoParent( Index, Parent )
  53.  
  54. if ( ToggleColMat ) {
  55. holoMaterial( Index, This[5, string] )
  56. holoColor( Index, This[6, vector4] )
  57. }
  58.  
  59. if ( ToggleShading ) { holoDisableShading( Index, 1 ) }
  60. if ( This[7, number] ) { holoSkin( Index, This[7, number] ) }
  61. if ( BG[Index, array] ) { foreach ( K, Group:vector2 = BG[Index, array] ) { holoBodygroup( Index, Group[1], Group[2] ) } }
  62.  
  63. if ( CT[Index, table] ) {
  64. for ( I = 1, CT[Index, table]:count() ) {
  65. local Clip = CT[Index, table][I, array]
  66. holoClipEnabled( Index, Clip[1, number], 1 )
  67. holoClip( Index, Clip[1, number], Clip[2, vector]*ScaleFactor, Clip[3, vector], 0 )
  68. CN++
  69. }
  70. }
  71. }
  72.  
  73. function loadContraption() {
  74. switch ( SpawnStatus ) {
  75. case "InitSpawn",
  76. if ( clk( "Start" ) ) {
  77. SpawnStatus = "LoadHolograms"
  78. }
  79. soundPlay( "Blip", 0, "", 0.212 )
  80. break
  81.  
  82. case "LoadHolograms",
  83. while ( perf() & holoCanCreate() & SpawnCounter < HN ) {
  84. SpawnCounter++
  85. HT[SpawnCounter, array]:holo()
  86.  
  87. if ( SpawnCounter >= HN ) {
  88. SpawnStatus = "PrintStatus"
  89. SpawnCounter = 0
  90. break
  91. }
  92. }
  93. break
  94.  
  95. case "PrintStatus",
  96. printColor( vec( 125, 255, 125 ), "HoloCore: ", vec( 255, 255, 255 ), "Loaded " + HN + " holograms and " + CN + " clips." )
  97.  
  98. CoreStatus = "InitPostSpawn"
  99. SpawnStatus = ""
  100. break
  101. }
  102. }
  103.  
  104. runOnTick( 1 )
  105. timer( "Start", 500 )
  106.  
  107. CoreStatus = "InitSpawn"
  108. SpawnStatus = "InitSpawn"
  109.  
  110. }
  111.  
  112. #----------------------
  113. #-- Load the hologram and clip data arrays.
  114. elseif ( CoreStatus == "InitSpawn" ) {
  115. loadContraption()
  116. }
  117.  
  118.  
  119. #----------------------
  120. #-- This is like if ( first() ) { }, code here is run only once.
  121. elseif ( CoreStatus == "InitPostSpawn" ) {
  122. CoreStatus = "RunThisCode"
  123.  
  124. interval( 0 ) #start or stop clk
  125.  
  126. runOnTick( 0 ) #start or stop tick
  127. }
  128.  
  129.  
  130. #----------------------
  131. #-- This is where executing code goes
  132. elseif ( CoreStatus == "RunThisCode" ) {
  133. if ( clk() ) {
  134. #interval( 15 )
  135.  
  136. }
  137.  
  138. if ( tickClk() ) {
  139.  
  140. }
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement