[Mod Help] Sound & Death Counter

Discussion about Mods for Prison Architect

Moderator: NBJeff

User avatar
Seth2697
level1
level1
Posts: 35
Joined: Thu Oct 16, 2014 10:01 am

[Mod Help] Sound & Death Counter

Postby Seth2697 » Mon Jul 20, 2015 9:07 am

I originally created the land mine mod some time ago now and ive been afk for a bit and was wondering if there was any updates with the modding where I could get my script to add deaths to the death counter as I was unable to figure out how to do so before. Also was curious about adding sound to the mod and what exact steps I need to take for that as of right now all you hear is fire crackle when they go off ha.
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Mod Help] Sound & Death Counter

Postby aubergine18 » Mon Jul 20, 2015 3:11 pm

Adding custom sounds is still bugged (can't play it from Lua scripts) but you can play the sounds that come with the game and there are a few explosion sound effects.

I've been documenting what I've found so far here: https://steamcommunity.com/sharedfiles/ ... =480978426

You can use Object.Sound() or this.Sound() to play any of the sounds that come with the game.

Game sounds are defined in main.data/sounds.txt and the sounds from vague memory are stored either in main.dat or sounds.dat something like that. They are all .ogg format so you'll need a media player that can handle .ogg files to listen to them (or drag .ogg files on to a modern web browser like Google Chrome and it will play them).

As for death counters, there's still nothing in the API for interacting with those although it's possible that they automatically increment in recent versions (I've not checked). One of the problems is that the API doesn't have any events for things like OnDestroy() or OnDismantle() so there's no way to run script when objects are deleted.
User avatar
Seth2697
level1
level1
Posts: 35
Joined: Thu Oct 16, 2014 10:01 am

Re: [Mod Help] Sound & Death Counter

Postby Seth2697 » Tue Jul 21, 2015 12:07 am

Well thats a bit dissapointing. Awesome thanks aubergine you were very informative!
User avatar
aubergine18
level2
level2
Posts: 231
Joined: Sun Jul 05, 2015 3:24 pm

Re: [Mod Help] Sound & Death Counter

Postby aubergine18 » Thu Jul 23, 2015 11:50 pm

Just been experimenting with sounds again, still can't get custom sounds to play.

Playing sounds supplied with game works though. There are several explosion sound effects in there.

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 2 guests