Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Nov 23, 2014 9:32 am

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Sound patch
PostPosted: Fri Feb 03, 2012 1:31 pm 
Offline
Engineer
Engineer

Joined: Sat Feb 06, 2010 10:12 pm
Posts: 24
Hi,

I would like to start working on a sound patch that will let the user choose a specific sound for each kind of information message received in the game. For example, a user will be able to choose a horn's sound for a "X's income las year wan negative" and the sound of coins for a new subsidy offer.

What should be my next steps towards achieving this goal?
where, in the code, should i start? (I've already downloaded the entire code and it compiles and runs successfully)
What kind of skill does this task require, apart, of course, of knowing c++?

Many thanks,
SummerBulb


Top
 Profile  
 
 Post subject: Re: Sound patch
PostPosted: Fri Feb 03, 2012 2:09 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 8437
Location: Sol d
Less of a skill than rather part of the task:

you'll need to identify those sounds which are part of the UI rather than related to game objects. The latter sounds should not become user-configurable other than by NewGRFs - otherwise that will clash quite badly.

Wrt implementation you might want to orient yourself on the implementation of hotkeys as a similar approach (with an ini file which relates sound to event) could be a good idea.

At least initially I'd not bother in *adding* new sounds. Extending the definition of sound sets might then be an entirely separate issue.

And I hope you didn't obtain the source as a tar bundle but rather used mercurial, svn or git :-). Write your patch for trunk, don't work on the source of release versions, if you aim for inclusion into the official repo.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
 Profile  
 
 Post subject: Re: Sound patch
PostPosted: Sun Feb 05, 2012 6:01 pm 
Offline
Engineer
Engineer

Joined: Sat Feb 06, 2010 10:12 pm
Posts: 24
Hotkeys? Sound interesting.

I imagine having a configuration window where the user could set a hotkey for the listed actions.
That might be easier.

But you mentioned an ini file. Are talking only ini, or will the ini reflect in a UI window?

I've never before touch a project so big. Having to implement changes in this project makes my hands tremble at click of a key.

Any further thoughts regarding the kotkeys?

btw, no need to worry, i'm using SVN (yes, i should have used "checked out" instead of "downloaded :) )


Top
 Profile  
 
 Post subject: Re: Sound patch
PostPosted: Sun Feb 05, 2012 6:04 pm 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 5995
SummerBulb wrote:
But you mentioned an ini file. Are talking only ini, or will the ini reflect in a UI window?

no, this will not automatically make an UI window. this is a planned feature for hotkeys, but nobody bothered to implement that yet.

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
 Profile  
 
 Post subject: Re: Sound patch
PostPosted: Sun Feb 05, 2012 9:27 pm 
Offline
Engineer
Engineer

Joined: Sat Feb 06, 2010 10:12 pm
Posts: 24
Eddi wrote:
no, this will not automatically make an UI window.


well, of course we're not talking about automatic windows. such thinks will need to be designed and implemented. My question was merely if planetmaker see this patch as something you configure in an ini file only or also in a UI window (which will need to be created).

Where can i find more information regarding the hotkeys?


Top
 Profile  
 
 Post subject: Re: Sound patch
PostPosted: Sun Feb 05, 2012 9:56 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 3151
Location: home
Well, you need to store your settings at some point, and an ini file is the most obvious way for that. By doing that you automatically allow users to edit that file for configuring it :)

As a next step you could make a window for configuring it in-game. That has the added advantage that you don't have to worry about windows now.
At that time, it is also more clear which sounds you can actually change. That makes it easier to judge whether making a window for it is beneficial.

A good way to find things is either by reading the generated documentation (which is not complete), or to search through the source files for some keyword (for example a case-insensitive search on 'hot' gives me 52 source files). By reading the matched lines, you can get a good idea of which file is interesting. Otherwise just browse/read them all :) In time, you will understand which files are used for what.
Oh, and a third way is to read the filenames, "hotkeys.h" and "hotkeys.cpp" seems like what you may need :p


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000-2013 phpBB Group

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2013.
Hosted by Zernebok Hosting.