Barotrauma

Barotrauma

Barotrauma Workshop
You can build your own submarines and monsters with in-game editors and share your creations with other players. Imagine and experiment.
Mod question 5: the return
Good day to you all guys and girls, i got a question about the weapon codes:

Assuming you modded weapons for this game and know your way around xml, is there any way to add a line that, when a weapon or object consumes all the chargues in his containable item slot, it could play a sound?

for example, a pistol, feed with a magazine. magazine gets empty, then weapon reproduces a sound when its empty.
< >
Showing 1-4 of 4 comments
Buggy Boy 10 30 Jan, 2024 @ 12:12pm 
Hmm. I wouldn't get too hung up on the weapon making the sound, more the ammo item. Might be worth looking into that; if the ammo item makes a sound when used (it's 'health' is reduced) and that sound suddenly stops, you know it's run out. I have no idea if that's possible though.
REBECCAFANCLUB 5 30 Jan, 2024 @ 1:35pm 
Originally posted by Buggy Boy:
Hmm. I wouldn't get too hung up on the weapon making the sound, more the ammo item. Might be worth looking into that; if the ammo item makes a sound when used (it's 'health' is reduced) and that sound suddenly stops, you know it's run out. I have no idea if that's possible though.

Funny thing, i alredy skulled the way to exactly do the thing you mentioned. When magazine, or item that spawns the bullets hits zero, it produces a sound. Super easy to do, the thing is: the "weapons" looks like it behaves different. The magazines or ammo spawner item has the durability, that, when hits BROKEN status, it reproduces sound, but the weapons doesnt look like they have the CONDITION status, they are either empty or full, so i cant do the trick that i mentioned first on the weapons. thats why im seeking help, there MUST be a clever way to do it (im losing my head)
Buggy Boy 10 31 Jan, 2024 @ 12:08pm 
Originally posted by REBECCA FAN CLUB:
Funny thing, i alredy skulled the way to exactly do the thing you mentioned. When magazine, or item that spawns the bullets hits zero, it produces a sound.

So if you already have a sound event happen when you run out of ammo in a gun, I don't understand the problem. Why would you insist that it's the weapon item that makes the sound?
REBECCAFANCLUB 5 1 Feb, 2024 @ 12:17am 
Originally posted by Buggy Boy:
Originally posted by REBECCA FAN CLUB:
Funny thing, i alredy skulled the way to exactly do the thing you mentioned. When magazine, or item that spawns the bullets hits zero, it produces a sound.

So if you already have a sound event happen when you run out of ammo in a gun, I don't understand the problem. Why would you insist that it's the weapon item that makes the sound?

actually, you re right, im just dumb, just figured it out a while ago, thanks for answering!
< >
Showing 1-4 of 4 comments
Per page: 1530 50