You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Macro made on FoundryVTT version 9 build 269. No module or system dependencies.
2
+
3
+
/*
4
+
Instructions:
5
+
Set the light in its central point before running the macro. Running this macro a second time will stop the motion and return the lights to the center. Lights will always be turned on when moving and turned off when stopped.
6
+
Don't use too many of these as it is constantly updating light position and will definitely affect performance.
7
+
*/
8
+
9
+
/**
10
+
Control Section
11
+
*/
12
+
/* The below array allows you to target specific lights. Enter the ids into the array, obtained by opening up the individual properties of the light.*/
13
+
lettargetlightid=[
14
+
"lightid_1",
15
+
"lightid_2"
16
+
]
17
+
letmeasuretype="grid"//acceptable values are "pixels" or "grid". If grid is used, measurements are based on grid size.
18
+
letradius=1;//radius of the circle in pixels or grid spaces, depending on the selection above.
19
+
letdirection="clockwise";//accepted values are "clockwise" or "widdershins".
20
+
letspeed=100;//interval time in milliseconds. Lower values will move the light faster, but also hits performance harder.
21
+
/**
22
+
End Control Section
23
+
*/
24
+
/**
25
+
The below is pure code controlled by the above settings. There is no need to change it.
26
+
*/
27
+
letgridsize=canvas.scene.data.grid;
28
+
if(measuretype==="grid"){radius=radius*gridsize}
29
+
letscene=game.scenes.active;
30
+
letscenelights=canvas.lighting.placeables;
31
+
letmovesize=360/(radius*4);//this keeps the movement smooth, regardless of the size of the circle.
//Macro made on FoundryVTT version 9 build 269. No module or system dependencies.
2
+
//this Macro allows you to specify light sources to flash at random intervals with a random flash count. You generally won't want to have more than one instance of this running at a time. The macro will automatically terminate when it tries to run while another scene is active.
3
+
//EPILEPSY WARNING: This macro may potentially trigger seizures for people with photosensitive epilepsy. User discretion is advised.
4
+
5
+
/**
6
+
Control Section
7
+
*/
8
+
/*This control will limit the scene to have only one instance. Set to false if you want to deploy the macro separately on different lights, but be mindful that this will substantially increase the flashing effect.*/
9
+
letscenelimit=true;
10
+
11
+
/* Enter the IDs of light sources in the below array. You can get these by opening the properties of the light and looking in the window's title bar. If scenelimit is false, avoid adding more than one lightning effect to the same light as flashing increases a lot.*/
12
+
lettargetlightid=[
13
+
"lightid_1",
14
+
"lightid_2",
15
+
"lightid_3"
16
+
]
17
+
/* flashspeed sets the base length of time a light stays on, and the time between flashes in the same event. A value between 50 and 75 gives the most realistic results. */
18
+
letflashspeed=50;
19
+
20
+
/* max_flash_count can have values between 1 and 4, however is set to 3 as a default due to epilepsy concerns. This limit falls in line with guidance from epilepsy.com. */
21
+
letmax_flash_count=3;
22
+
23
+
/* It is possible to add thunder effects. Set this to false to disable them. */
24
+
letadd_thunder=true;
25
+
26
+
/*Setting the thunder_distance sets a delay on the thunder and modifies the thunder_volume value if it is set to "auto"*/
/*The thunder_volume value accepts values between 0.1 and 1, or "auto". When "auto" is supplied, it has a base value of 0.5 and will decrease based on the thunder_distance value.*/
30
+
letthunder_volume="auto";
31
+
32
+
/*The thunder_sound_array is a list of thunder sound effects you want to use. It needs at least one, but there's no upper limit.*/
33
+
letthunder_sound_array=[
34
+
"/path/soundfile1.wav",
35
+
"/path/soundfile2.wav",
36
+
"/path/soundfile3.wav"
37
+
]
38
+
39
+
letthunder_delay;//this is here to declare the variable. Don't change it.
40
+
41
+
/*The below settings can be reconfigured if you want to change the volume based on thunder_distance, provided thunder_volume is set to "auto"*/
42
+
if(thunder_volume==="auto"){
43
+
switch(thunder_distance){
44
+
case"close":
45
+
thunder_volume=0.5;
46
+
break;
47
+
case"near":
48
+
thunder_volume=0.4;
49
+
break;
50
+
case"far":
51
+
thunder_volume=0.3;
52
+
break;
53
+
case"distant":
54
+
thunder_volume=0.2;
55
+
break;
56
+
default:
57
+
thunder_volume=0.5
58
+
break;
59
+
}
60
+
}
61
+
62
+
/*The below settings can be reconfigured if you want to change the delay based on thunder_distance.*/
63
+
switch(thunder_distance){
64
+
case"close":
65
+
break;
66
+
case"near":
67
+
thunder_delay=1;
68
+
break;
69
+
case"far":
70
+
thunder_delay=3;
71
+
break;
72
+
case"distant":
73
+
thunder_delay=5;
74
+
break;
75
+
default:
76
+
thunder_delay=0;
77
+
break;
78
+
}
79
+
80
+
81
+
/**
82
+
End Control Section
83
+
*/
84
+
/**
85
+
The below is pure code controlled by the above settings. There is no need to change it.
0 commit comments