SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05-04-13, 07:55 PM   #11
SkyBaron
Lieutenant
 
Join Date: Mar 2010
Location: South Atlantic
Posts: 261
Downloads: 673
Uploads: 2
Default

Quote:
Originally Posted by TheDarkWraith View Post
You can use the intrinsic function Menu.PlaySound() but you need to register the sound file with the sdl file of the game (\data\Sound). Making independent py files for the game isn't that complicated but it does take some work. Look over how I did it with the file TheDarkWraithUserOptions.py (and .ini). You'll need to add new entries to the main menu file also which will break compatibility with most UI mods
Thanks for the tips! I'll take a look on those.
I hope someday you'll have time to do a small "Hello World" tutorial on SH5 scripting(I don't mean just Python, but how scripting/menu/etc fit together) it would help a lot of people, well at least me!


EDIT: I finally figured out how to do it. Never thought of looking at the .ini files, that was the problem. Now when I try to use Menu.PlaySound("sh.sdl sound name") I get this error:



If I use GetTDWSound().PlaySound everything works fine. Since I will probably make this compatible with the NewUI only, I'd rather use your sound library to avoid compatibility issues with some other mod's sh.sdl.
__________________



Last edited by SkyBaron; 05-04-13 at 09:53 PM.
SkyBaron is offline   Reply With Quote
 

Tags
dbrn, favorite, new ui

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.