-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathsoundscape_finder.txt
More file actions
60 lines (49 loc) · 1.66 KB
/
soundscape_finder.txt
File metadata and controls
60 lines (49 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@name soundscape finder
@inputs EGP:wirelink
@outputs
@persist Sounds:array Queue:array
@trigger
#include "hologramanticringelib"
if( first() ){
findByClass("trigger_soundscape")
Sounds = findToArray()
Queue = array()
EGP_IND = 0
foreach(N, Entity:entity = Sounds){
EGP_IND++
holoCreate(EGP_IND, Entity:pos())
holoAng(EGP_IND,ang())
holoMaterial(EGP_IND,"models/wireframe")
holoModel(EGP_IND,"models/sprops/cuboids/height96/size_1/cube_96x96x96.mdl")
#EGP_IND:antiCringeExtend()
holoScaleUnits(EGP_IND,-Entity:boxSize()+vec(1))
holoColor(EGP_IND,hsv2rgb((N*40)%360,randint(1,4)/4,1),255)
holoParent(EGP_IND, Entity)
EGP:egp3DTracker( EGP_IND, Entity:pos() )
EGP:egpParent( EGP_IND, holoEntity(EGP_IND) )
EGP_IND++
EGP:egpText(EGP_IND, "Entity ["+Entity:id()+"]["+Entity:type()+"] ("+N+")", vec2(0,0))
EGP:egpParent(EGP_IND, EGP_IND-1)
}
function say(Str:string){
concmd("say \""+Str:replace("\"","")+"\"")
}
}
event chat(Player:entity, Message:string, _:number) {
if( Message == "!soundscape" ){
Queue:pushEntity( Player )
timer("output",750)
}
}
if( clk("output") ){
Player = Queue:popEntity()
local TestPos = Player:pos()
foreach(_,Scape:entity = Sounds){
if(Scape:nearestPoint(TestPos):distance2(TestPos) < 1){
local Mode = Player==owner() ? "print" : "say"
Mode(Player:name()+", you are standing in Entity ["+Scape:id()+"]["+Scape:type()+"]!")
break
}
}
if( Queue:count() ){ timer("output",750) }
}