• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

tAPI Dust and Sound Catalogue

Flashkirby99

Skeletron
Dust & Sound


But while you're here why not visit the tModLoader one as well?


Some of you may remember the super useful Dust and Sound Catalog Mod by Romulan Paladin as well as this and that, back in the tConfig days, and if you're anything like me, the only dust type you can remember is the ever useful number 6 (which is a generic fire particle, by the way). So this is a similar mod for tAPI which has quite a few more interesting dust types, such as fireworks! Additionally there are a whole bunch of new sounds that took some code digging to find their usage, and they are also available in catalogue form. See book tooltips for details.

Download Here.
Reminder: You don't need this mod to use any of the dusts and sounds, it only shows you what's already in the game.

For dusts, once you have the type, you need to spawn the particles in code using:
Code:
Dust.NewDust(Vector2 Position, int Width, int Height, int Type, float SpeedX = 0f, float SpeedY = 0f, int Alpha = 0, Color newColor = default(Color), float Scale = 1f)

//or one of the various alternatives, whichever is more appropriate, found in Dust.cs
Dust.NewDust(Vector2 Position, Vector2 Size, int Type, Vector2 Velocity = default(Vector2), int Alpha = 0, Color newColor = default(Color), float Scale = 1f)
Dust.NewDust(Rectangle rect, int Type, Vector2 Velocity = default(Vector2), int Alpha = 0, Color newColor = default(Color), float Scale = 1f)
The NewDust method returns the index value of the dust you just created, which you can reference using Main.dust[indexNumber]. In code it would look something like this:
Code:
//say you wanted to add particles that stay mostly still to leave a trail behind a projectile
int num1 = Dust.NewDust(
         projectile.position,
         projectile.width,
         projectile.height,
         6, //lazy number 6 for fire particles
         projectile.velocity.X,
         projectile.velocity.Y,
         100f, //alpha goes from 0 to 255
         default(Color),
         1f
         );

Main.dust[num1].noGravity = true;
Main.dust[num1].velocity *= 0.1f;
For sounds, once you have the type, you can put it in the .json under "useSound": insertItemSoundidHere, which only uses sounds from sound effect 2 (and its styles). Alternatively, if you want it in code you use:
Code:
PlaySound(int type, int x = -1, int y = -1, int Style = 1)

//but if you really need to, there are other method signatures that do various things, found in Main.cs
PlaySound(SoundEffect effect, float X = -1f, float Y = -1f, bool useInstance = false, Main.ShouldPlayDelegate shouldPlayDel = null, float panMod = float.NaN, float volumeMod = float.NaN, float pitchMod = float.NaN)
PlaySound(SoundEffect effect, float X, float Y, bool useInstance, float panMod, float volumeMod, float pitchMod)
PlaySound(SoundEffect effect, float X, float Y, bool useInstance, Main.ShouldPlayDelegate shouldPlayDel)
PlaySound(string name, float X = -1f, float Y = -1f, bool useInstance = false, Main.ShouldPlayDelegate shouldPlayDel = null, float panMod = float.NaN, float volumeMod = float.NaN, float pitchMod = float.NaN)
PlaySound(string name, float X, float Y, bool useInstance, float panMod, float volumeMod, float pitchMod)
PlaySound(string name, float X, float Y, bool useInstance, Main.ShouldPlayDelegate shouldPlayDel)
Note: The method PlaySound returns a SoundEffectInstance, but as of yet I haven't had to use it so most likely neither do you :D
So in practice the the code for playing a sound looks something like this:
Code:
Main.PlaySound(effectNumber, (int)p.position.X, (int)p.position.Y, styleNumber);

(!) and (.) indicate dusts that emit light and dusts that just glow, respectively

0: brown dirt
1: grey stone
2: thick green grass
3: thin green grass
4: grey pebbles
5: red blood
6: (!)orange fire, emits orange light !WARNING: Ignores Y velocity
7: brown wood
8: purple gems
9: orange gems
10: yellow gems
11: white gems
12: red gems
13: cyan gems
14: purple corruption particle with no gravity
15: (!)white amd blue magic fx, emits pale blue light
16: bluish white clouds like hermes boots
17: thin grey material
18: thin sickly green material
19: thin yellow material
20: (!)white lingering, emits cyan light
21: (!)purple lingering, emits purple light
22: brown material
23: orange material
24: thin brown material
25: copper
26: iron
27: (!)purple fx, emits bright purple light
28: dull copper
29: (!)dark blue, emits pale pink light !WARNING: Ignores Y velocity
30: silver material
31: yellowish white cloud material
32: yellow sand
33: water, highly transparent
34:
35: (!)red fx, emits red light !WARNING: Ignores Y velocity, behaves unexpectedly with gravity enabled
36: muddy pale material
37: dark grey material
38: muddy brown material
39: bright green jungle grass
40: bright green thin grass
41: (!)dark blue wandering circles, emits bright cyan light !WARNING: Ignores all velocity
42: thin teal material
43:
44: (!)bright green spores that lingers for a while, emits light green light
45: (!)light blue circles, emits purple light
46: green material with no gravity
47: thin cyan grass
48: cobalt
49: mithril
50: adamantite
51: snow
52: pink water, highly transparent
53: grey material
54: black material
55: (!)bright orange thick fx, emits yellow light
56: (!)cyan fx, emits pale blue light
57: (!)small yellow hallowed fx, emis yellow light
58: (!)hot and pale pink magic fx, emits pink light
59: (!)blue torch, emits pure blue light !WARNING: Ignores Y velocity
60: (!)red torch, emits pure red light !WARNING: Ignores Y velocity
61: (!)green torch, emits pure green light !WARNING: Ignores Y velocity
62: (!)purple torch, emits purple light !WARNING: Ignores Y velocity
63: (!)white torch, emits bright white light !WARNING: Ignores Y velocity
64: (!)yellow torch, emits deep yellow light !WARNING: Ignores Y velocity
65: (!)demon torch, emits pulsating pink/purple light !WARNING: Ignores Y velocity
66: (!)White transparent !WARNING: Possibly undesirable behaviour when gravity is enabled
67: (!)cyan ice crystals, emits cyan light
68: (.)dark cyan ice crystals, emits very faint blue light, glows in disabled gravity
69: thin pink material
70: (.)thin transparent purple material, emits faint purple light, glows in disabled gravity
71: (!)transparent pink fx, emits faint pink light
72: (!)solid pink fx, emits faint pink light
73: (!)solid bright pink fx, emits pink light
74: (!)solid bright green fx, emits green light
75: (!)green cursed torch !WARNING: Ignores Y velocity
76: snowfall, lasts a long time
77: thin grey material
78: thin copper material
79: thin yellow material
80: ice block material
81: iron material
82: silty material
83: sickly green material
84: bluish grey material
85: thin sandy materiial
86: (!)transparent pink material, emits pink light
87: (!)transparent yellow material, emits yellow light
88: (!)transparent blue material, emits blue light
89: (!)transparent green material, emits green light
90: (!)transparent red material, emits red light
91: (!)transparent white material, emits white light
92: (!)transparent cyan material, emits cyan light
93: thin dark green grass
94: thin pale dark green grass
95: thin dark red grass
96: thin blackish green grass
97: thin dark red grass
98: purple water, highly transparent
99: cyan water, highly transparent
100: pink water, highly transparent
101: cyan water, highly transparent
102: orange water, highly transparent
103: dark blue water, highly transparent
104: hot pink water, highly transparent
105: red water, highly transparent
106: (.)transparent red/green/blue material, glows in the dark
107: (!)short green powder, emits green light
108: light pale purple round material
109: black material
110: (.)bright green bubbles, emits very faint green light
111: (.)bright cyan bubbles, emits very faint cyan light
112: (.)bright pink bubbles, emits very faint pink light
113: (.)blue ice crystals, glows in the dark
114: (.)bright pink/yellow bubbles, emits very faint pink light
115: red grass
116: blueish green grass
117: red grass
118: purple gems
119: pink gems
120: pale pink gems
121: thin grey material
122: thin iron material
123: hot pink bubble material
124: yellowish white bubbles
125: thin red material
126: thin grey material
127: (!)reddish orange fire, emits orange light
128: green gems
129: thin brown material
130: (!)trailing red falling fireworks, emits red light
131: (!)trailing green rising fireworks, emits green light
132: (!)trailing cyan falling fireworks, emits cyan light
133: (!)trailing yellow falling fireworks, emits cyan light
134: trailing pink falling fireworks
135: (!)cyan ice torch, emits cyan light !WARNING: Ignores Y velocity
136: red material
137: bright blue/cyan material
138: bright orange/brown material
139: cyan confetti
140: green confetti
141: pink confetti
142: yellow confetti
143: light grey stone
144: vivid copper stone
145: pink stone
146: green/brown material mix
147: orange material
148: desaturated red material
149: white material
150: black/yellow/bluishwhite material
151: thin white material
152: (!)bright orange bubbles !WARNING: Doesn't appear in gravity
153: bright orange bubble material
154: pale blue thin material
155: thin dark brown material
156: (!)bright blue/white bubble material, emits pale blue light
157: (.)thin green fx, glows in the dark
158: (!)orange fire, emits orange light !WARNING: Ignores Y velocity
159: (!)flickering yellow fx, emits yellow light !WARNING: Possibly undesirable behaviour when gravity is disabled
160: (!)shortlived cyan fx, emits bright cyan light
161: cyan material
162: (!)shortlived orange fx, emits bright orange light
163: (.)bright green thin material, glows in the dark
164: (!)flickering pink fx, emits hot pink light !WARNING: Possibly undesirable behaviour when gravity is disabled
165: white/blue bubble material
166: thin bright pink material
167: thin green material
168: !bright pink bubbles !WARNING: Possibly undesirable behaviour when gravity is enabled
169: (!)yellow fx, emits deep yellow light !WARNING: Ignores Y velocity
170: (.)thin orange fx, emits faint white light
171: bright purple bubble material
172: (.)light blue particles, emits faint blue light
173: (!)shortlived purple fx, emits bright purple light
174: (!)bright orange bubble material, emits reddish orange light
175: (.)shortlived white fx, glows in the dark
176: light blue particles
177: light pink particles
178: light green particles
179: light purple particles
180: (!)light cyan particles, glows in the dark
181: (.)light cyan/pink bubble material, glows in the dark
182: (.)light red bubble material, barely emits red light
183: (.)transparent red bubble material, glows in the dark
184: sickly pale greenish grey particles that stay in place
185: (!)light cyan crystal material, emits cyan light
186: pale dark blue smoke
187: (!)light cyan particles, emits cyan light
188: bright green bubbles
189: thin orange material
190: thin gold material
191: black flakes
192: snow material
193: green material
194: thin brown material
195: thin black material
196: thin green material
197: (.)thin bright cyan material, glows in the dark
198: black/white particles
199: pale purple/black/grey particles
200: pink particles
201: light pink particles
202: light cyan particles
203: grey particles
204: (.)white particles, glows in the dark
205: (.)thin pink material, barely emits pink light
206: (!)shortlived cyan fx, emits bright blue light
207: thin brown material
208: orange stone
209: pale green stone
210: off white material
211: bright blue particles
212: white particles
213: (.)shortlived tiny white fx, barely emits white light
214: thin pale brown material
215: thin khaki material
216: pale pink material
217: cyan particles
218: hot pink particles
219: (!)trailing red flying fireworks, emits orange light
220: (!)trailing green flying fireworks, emits green light
221: (!)trailing blue flying fireworks, emits pale blue light
222: (!)trailing yellow flying fireworks, emits yellow light
223: (.)trailing red flying fireworks, glows in the dark
224: thin blue material
225: orange material

Sounds in Terraria have a sound effect number and sometimes also a style type, such as sounds in SE number 2.

0: tile hit
1: male hit
2:
2:1: generic swing
2:2: crunchy eating
2:3: swallow drink
2:4: life crystal ping
2:5: bow shot
2:6: magic mirror whizz
2:7: low, quiet swing
2:8: magic cast
2:9: astral magic noise
2:10: bullet impact/harpoon
2:11: basic gun shot
2:12: laser beam
2:13: magic spray
2:14: explosion
2:15: phaseblade
2:16: whoopie cushion
2:17: dart shot
2:18: generic swing
2:19: throwing swing
2:20: fire cast
2:21: water cast
2:22: motor tool loop
2:23: motor tool activation
2:24: spectre boots
2:25: fairy bell
2:26: harp note
2:27: crystal smash
2:28: rising magic cast
2:29: mana crystal
2:30: ice materialise
2:31: clockwork burst shot
2:32: wing flap
2:33: boss laser beam
2:34: flamethrower
2:35: bell ding
2:36: pump shotgun
2:37: anvil clang
2:38: heavy shot
2:39: multi throw swing
2:40: sniper shot
2:41: revolver shot
2:42: flaming wood
2:43: staff magic cast
2:44: summon minion
2:45: inferno fork
2:46: summon hydra
2:47: the axe
2:48: mine snow
2:49: mine snow2
2:50: mine ice
2:51: mine ice2
2:52: minecart track place
2:53: minecart land on track
2:54: bubble pop
2:55: minecart brake
2:56: minecart track bumper
3:
3:1: organic
3:2: bone
3:3: magic intercept
3:4: metal
3:5: hallow creature
3:6: beast
3:7: wyvern
3:8: wall of flesh
3:9: leech
3:10: old unicorn
3:11: snow
3:12: unicorn
3:13: crimson
3:14: fishron squeal
4:
4:1: slime
4:2: undead
4:3: magic destroy
4:4: bat/mouse
4:5: large foe
4:6: etheral gasp
4:7: hallow creature
4:8: beast grunt
4:9: spit
4:10: wall of flesh scream
4:11: horror flesh split
4:12: horror flesh destroy
4:13: belch
4:14: mechanical explosion
4:15: snow
4:16: insect
4:17: pigron
4:18: unicorn
4:19: crimson
4:20: fishron scream
5: player death
6: grass/web cut
7: pickup noise
8: open door
9: close door
10: open menu
11: close menu
12: scroll/chat tick noise
13: pot breaking
14: zombie growl
15:
15:0 boss summon laughter
15:1 worm dig noise
16: double jump
17: running
18: pay money
19:
15:0 large splash for npcs
15:1 small splash for items
20: female hit
21: stone tile hit
22: hotbar lock/unlock
23: drown
24: open npc chat window
25: mana full charge
26: low monster groan
27: pixie shimmer
28: wire mechanisms toggle noise
29:
29/31/32:1: undead moan
29/31/32:2: undead rawr
29/31/32:3: undead gurgle
29/31/32:4: beast low gurgle
29/31/32:5: beast low gurgle2
29/31/32:6: beasy medium noise
29/31/32:7: high gasp
29/31/32:8: low gasp
29/31/32:9: beast belch
29/31/32:10: duck quak
29/31/32:11: duck quack
29/31/32:12: 'quack'
29/31/32:13: frog ribbit
29/31/32:14: bird tweet
29/31/32:15: mouse squeak
29/31/32:16: bluejay tweet
29/31/32:17: cardinal tweet long
29/31/32:18: bird tweet slow
29/31/32:19: cardinal tweet
29/31/32:20: fishron bubbles belch
30: duck
31: npc idle nearby med noises - same as 29
32: npc idle far high noises - same as 29
33: mouse squeaks
34: null onwards of this point
 
Last edited:

W1K

Witch
O boy finally someone who's not lazy and made something of the sort, and even good looking. No more using number 6 out of laziness.
 

Flashkirby99

Skeletron
how to use numbers like 3:4 ?
First number is sound group (see v2 for which variable this is used with), in this case the soundHit property, and the second number is that particular sound effect (which is a metallic clink).
For sounds, once you have the type, you can put it in the .json under "useSound": insertItemSoundidHere, which only uses sounds from sound effect 2 (and its styles). Alternatively, if you want it in code you use:
Code:
PlaySound(int type, int x = -1, int y = -1, int Style = 1)

//but if you really need to, there are other method signatures that do various things, found in Main.cs
PlaySound(SoundEffect effect, float X = -1f, float Y = -1f, bool useInstance = false, Main.ShouldPlayDelegate shouldPlayDel = null, float panMod = float.NaN, float volumeMod = float.NaN, float pitchMod = float.NaN)
PlaySound(SoundEffect effect, float X, float Y, bool useInstance, float panMod, float volumeMod, float pitchMod)
PlaySound(SoundEffect effect, float X, float Y, bool useInstance, Main.ShouldPlayDelegate shouldPlayDel)
PlaySound(string name, float X = -1f, float Y = -1f, bool useInstance = false, Main.ShouldPlayDelegate shouldPlayDel = null, float panMod = float.NaN, float volumeMod = float.NaN, float pitchMod = float.NaN)
PlaySound(string name, float X, float Y, bool useInstance, float panMod, float volumeMod, float pitchMod)
PlaySound(string name, float X, float Y, bool useInstance, Main.ShouldPlayDelegate shouldPlayDel)
Note: The method PlaySound returns a SoundEffectInstance, but as of yet I still haven't had to use it so most likely neither do you :D
So in practice the the code for playing a sound looks something like this:
Code:
Main.PlaySound(effectNumber, (int)p.position.X, (int)p.position.Y, styleNumber);

So for example, you would use:
PlaySound(3, (int)position.X, (int)position.Y, 4)
 
Top Bottom