Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[
- Important!!!!!!!!!
- Holograms are not magic, they are still entities and they still take server resources.
- You should consider them the same as you would any other prop.
- Ideally this tool is to be used for minor details, not entire contraptions.
- ]#
- @name Cre8ive Motorsport 2017 Plate
- @inputs BaseProp:entity
- @persist [ID SpawnStatus CoreStatus]:string [HT CT BG]:table [HN CN SpawnCounter ScaleFactor ToggleColMat ToggleShading] BaseParent:entity Rescale:vector
- if ( dupefinished() | first() ) {
- #Settings
- ScaleFactor = 0.2 #scales the contraption
- ToggleColMat = 1 #disables materials and color
- ToggleShading = 0 #disables shading
- #Holo data
- 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))
- 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))
- 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))
- 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))
- 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))
- 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))
- 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))
- 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))
- 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))
- #[
- HOLOGRAM LOADER - DO NOT EDIT BELOW THIS LINE
- IF YOU WISH TO EDIT HOLOGRAMS AFTER SPAWNING, PLACE CODE AFTER THE
- elseif ( CoreStatus == "InitPostSpawn" ) {
- CODEBLOCK AT THE BOTTOM
- ]#
- BaseParent = BaseProp ?: entity()
- Rescale = vec( ScaleFactor )
- function array:holo() {
- local Index = This[1, number]
- local Parent = Index != 1 ? holoEntity( 1 ) : BaseParent
- holoCreate( Index, Parent:toWorld( This[2, vector]*ScaleFactor ), Rescale, Parent:toWorld( This[3, angle] ), vec( 255 ), This[4, string] ?: "cube" )
- holoParent( Index, Parent )
- if ( ToggleColMat ) {
- holoMaterial( Index, This[5, string] )
- holoColor( Index, This[6, vector4] )
- }
- if ( ToggleShading ) { holoDisableShading( Index, 1 ) }
- if ( This[7, number] ) { holoSkin( Index, This[7, number] ) }
- if ( BG[Index, array] ) { foreach ( K, Group:vector2 = BG[Index, array] ) { holoBodygroup( Index, Group[1], Group[2] ) } }
- if ( CT[Index, table] ) {
- for ( I = 1, CT[Index, table]:count() ) {
- local Clip = CT[Index, table][I, array]
- holoClipEnabled( Index, Clip[1, number], 1 )
- holoClip( Index, Clip[1, number], Clip[2, vector]*ScaleFactor, Clip[3, vector], 0 )
- CN++
- }
- }
- }
- function loadContraption() {
- switch ( SpawnStatus ) {
- case "InitSpawn",
- if ( clk( "Start" ) ) {
- SpawnStatus = "LoadHolograms"
- }
- soundPlay( "Blip", 0, "", 0.212 )
- break
- case "LoadHolograms",
- while ( perf() & holoCanCreate() & SpawnCounter < HN ) {
- SpawnCounter++
- HT[SpawnCounter, array]:holo()
- if ( SpawnCounter >= HN ) {
- SpawnStatus = "PrintStatus"
- SpawnCounter = 0
- break
- }
- }
- break
- case "PrintStatus",
- printColor( vec( 125, 255, 125 ), "HoloCore: ", vec( 255, 255, 255 ), "Loaded " + HN + " holograms and " + CN + " clips." )
- CoreStatus = "InitPostSpawn"
- SpawnStatus = ""
- break
- }
- }
- runOnTick( 1 )
- timer( "Start", 500 )
- CoreStatus = "InitSpawn"
- SpawnStatus = "InitSpawn"
- }
- #----------------------
- #-- Load the hologram and clip data arrays.
- elseif ( CoreStatus == "InitSpawn" ) {
- loadContraption()
- }
- #----------------------
- #-- This is like if ( first() ) { }, code here is run only once.
- elseif ( CoreStatus == "InitPostSpawn" ) {
- CoreStatus = "RunThisCode"
- interval( 0 ) #start or stop clk
- runOnTick( 0 ) #start or stop tick
- }
- #----------------------
- #-- This is where executing code goes
- elseif ( CoreStatus == "RunThisCode" ) {
- if ( clk() ) {
- #interval( 15 )
- }
- if ( tickClk() ) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement