Skip to content

Commit 2889d63

Browse files
committed
Create soundscape_finder.txt
1 parent 1ff5c3e commit 2889d63

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

soundscape_finder.txt

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

0 commit comments

Comments
 (0)