View Full Version : [WIP] Radio Station Manager
Digital_Trucker
08-05-07, 04:15 PM
V1.0 released. See http://www.subsim.com/radioroom/showthread.php?p=623020#post623020
Beta version 0.9 (last Beta) now available. It has all of the editing functions enabled and you can now save your changes. It also now has data checking functions such as verifying that media files for events exist and checking event date/time order. About all that's left to do is the nag screens for saving changes before exiting the program and the documentation. Thanks to Misfit138's testing all the bugs should be worked out now.
It's available at http://files.filefront.com/RSM090Betarar/;8304137;;/fileinfo.html
Based on Misfit138's Workaround for radio repeating the broadcasts when loading a save and the discussions in his thread http://www.subsim.com/radioroom/showthread.php?t=119443 (http://www.subsim.com/radioroom/showthread.php?t=119443) , I have begun development of a "RadioStationManager" application.
This application would allow you to create and add radio stations in an automated fashion and solve the problems with the scripted radio broadcasts being repeated when you reload a saved game in the middle of a patrol.
This is the basic layout I have in mind for the app (with a description following the screeny). Any suggestions or comments would be greatly appreciated.
http://i19.photobucket.com/albums/b173/digital_trucker/RadioStationManagerBlank.jpg
In this area, all of the information for the radio stations defined in your radio.ini file would be displayed for editing.
In this area, all of the scripted events (if any) contained in the events.ini file would be displayed and available for edit.
This button would allow for the importation of new radio stations. Basically, you would create (or download) a radio station folder with the music and scripted events (if any), place it in the blah,blah,blah\Data\Sounds\Radio folder then press this button. You would be presented with a dialog to allow the selection of the folder containing the new radio station. Then you would fill in the required information (start and end dates and so on) and the station would be entered into your radio.ini file automatically.
This button would allow you to delete a radio station from the radio.ini file.
This button would save changes made to the currently selected station.
This button would perform the necessary operations to prepare all radio stations for the reloading of a game. It would first present you with a dialog allowing you to specify which saved game you were going to load. Then, if the game that you select was not saved while on patrol, all events in the events.ini files for all radio stations would be uncommented (many thanks to JScones for the idea on how to handle the replay problem) so that your radio will start on the correct date. If the saved game you select is one that was saved while on patrol, then the SaveData.crp file will be examined to find the last command issued while on that patrol and that date/time will be used to determine which events are commented out to prevent their replay. In order to insure that the correct date/time is used, you would only need to issue an order (of any kind) immediately before saving your game.
This button would allow you to choose a media file for the event that you are entering/editing. You would be presented with a dialog to select a media file from the events folder in your radio station. No more having to type (or even copy/paste) the name of the media file when creating/editing an event.
This button would allow you to add an event at the end of the events list for the current radio station you are working on.
This button would allow you to delete the currently selected event in area 2.
This button would allow you to insert an event in front of the currently selected event in area 2.Before I start actually coding this app, I'd like to get a little feedback on any operations y'all might like to see added to it, or any changes in the layout that you think would be an improvement.
THE_MASK
08-05-07, 04:58 PM
Keep the mods comin baby. Awesome stuff:rock:
Von Manteuffel
08-05-07, 05:29 PM
Lookin' Good!!!:up:
How difficult would it be to include ( I think as part of "8" and/or"10" ) a setting which would allow the user to specify the period between dates ( e.g. from "previous + 1 day", to "previous + x days") This would greatly speed-up the creation of events.ini files.
Keep up the good work.
Digital_Trucker
08-05-07, 07:11 PM
Thanks, sober.:D
VM, what I had in mind was what JScones suggested in the other thread, that is commenting out (putting a semicolon in front of) all the entries prior to the date/time of the saved game that is about to be loaded. That way, the entire events.ini file doesn't have to be recreated each time, just modified a little. That also leaves room for manual editing of the file without messing anything up.
If I'm not mistaken, when the game starts, it reads the events.ini file for each station until it reaches an entry that is at or past the date/time that it is looking for and it doesn't read the next entry in the file until the game time is past the time in the events.ini record. If this is the case, then there wouldn't be any advantage to leaving out any entries at the end of the file. I could be wrong about that. I'll make it a point to time how long it takes my dilapidated Socket A system to set up the events files. If mine can do it in a reasonable amount of time, then anyone's should be able to:D
ReallyDedPoet
08-05-07, 07:33 PM
Look forward to this one :yep:
RDP
Misfit138
08-05-07, 07:43 PM
This tool I've been working on looks so pitiful compared to yours :rotfl:
http://img126.imageshack.us/img126/6704/radiobuddyvq0.png (http://imageshack.us)
But are you gonna continue from this on? Just asking so that I know should I drop this project of mine. Been making slow but steady progress ever since I got that one problem solved
Digital_Trucker
08-05-07, 08:20 PM
I didn't mean to make it a one or the other proposition, Misfit. There's no reason for you to stop working on yours. Just like most mods, some people like one over the other and vice versa. I imagine that my app is going to appeal more to the folks that like to create radio stations than just the folks who use them. Mine is kind of overkill for just the one problem.
Keep on truckin', dude. You'll probably be done with yours before I get this one done anyway, 'cause you've got a head start. I'm just in the planning stages.
Misfit138
08-05-07, 08:36 PM
Keep on truckin', dude. You'll probably be done with yours before I get this one done anyway, 'cause you've got a head start. I'm just in the planning stages.
Isn't much of a head start if you're still learning to code... :p
Anyways, I'll probable continue on this. At least for learning purposes. Don't know am I going to release it. Probable not but just have to wait and see
Fearless
08-05-07, 08:59 PM
Well worth the wait:up:
JScones
08-05-07, 09:22 PM
Looks good. :up:
This won't be a .NET app will it? 'Cause if there ends up being choices, the non-.NET version will always win it for me.
Anyway, a suggestion on layout. Atm it's not overly clear to me what the save button refers to - just the stations? Or the events as well?
I'd apply some grouping to distinguish the different functionality, and to keep the buttons together and more structured. Here's a quick mockup using your model...
http://img355.imageshack.us/img355/7978/image1rp8.jpg (http://imageshack.us)
Having the "Prepare" button separated means that under normal operation, players can ignore the two groupings altogether and go straight for the Prepare button (which is unrelated to your editing functions anyway). Some tooltips would help with the buttons, but keep in mind this is just a quick mockup to demonstrate an alternate layout.
I have assumed that clicking on a station will automagically populate the events view. I have also assumed that you want to apply changes to each aspect separately.
Now, ordinarily, if you have a "Save" or "Apply" button, you should also have a "Discard" or "Cancel" button, otherwise how will users get back to what they started with without closing and reloading your app?
Sorry, but I just can't help but provide suggestions on programming when asked to do so, LOL! I won't be offended if you discard everything I've said. ;)
Digital_Trucker
08-05-07, 09:46 PM
:rock: JScones, thanks for all the great input. I'll definitely take your advice to heart when I'm working on this. You make excellent points regarding the grouping of buttons and the separation of functions. All of your assumptions were correct except that I really hadn't thought through the save function yet and probably would have saved everything instead of separating the two saves. I definitely wouldn't have thought of the "take me back to square one" button.
Unfortunately, for me (at the moment, anyway), the only thing I have that I'm comfortable working with is Visual Basic, so this would be a nasty .NET app. I spent 16 years (from '76 to '92) programming IBM mainframes and midranges in Fortran, COBOL and Assembler, but VB is the one "semi-current" language that I'm even close to being proficient in. I probably could learn just about any language I felt like using, but I'm also old enough that I don't want to waste too much time finding a new way to "skin the cat" so to speak.
Thanks again for the great input.:up: I'll have a revised layout ready soon and will get going on the project just as soon as my monthly supply of Geritol gets here:rotfl: .
JScones
08-05-07, 10:20 PM
Unfortunately, for me (at the moment, anyway), the only thing I have that I'm comfortable working with is Visual Basic, so this would be a nasty .NET app.
Shame. You don't have VB6 I guess? I just hate it how such small and simple apps require 280mb of runtime files.
Hehe, I remember someone bragging to me recently that an app he wrote (unrelated to SH3 or SH4) was much smaller than a similar app I wrote - his was about 40kb, mine about 400kb. His argument crashed and burned though when I pointed out the 280mb of runtime files needed to power his 40kb creation (as one needs the whole "framework" installed; they can't just pick and choose the individual runtimes) compared to the 0kb of files (outside of the OS itself of course) needed to power mine. :rotfl: At least this is now less of an issue for Vista users as they have the framework (read: MS PR for runtime files) installed by default. Only updating it becomes a hassle for them.
Don't get me wrong, I use the .NET framework too...when I have no choice.
Anyway, enough on my hate of .NET...
I spent 16 years (from '76 to '92) programming IBM mainframes and midranges in Fortran, COBOL and Assembler, but VB is the one "semi-current" language that I'm even close to being proficient in.
Ah, COBOL. Will still be in use when the "year 9999 bug" hits. :rotfl:
fred8615
08-06-07, 10:39 AM
As a radio station creator, I like the idea, and really like what you've got so far.:up:
Digital_Trucker
08-06-07, 12:51 PM
OK, here's my redone layout with JScones suggestions implemented (as I understand them anyway :D )
http://i19.photobucket.com/albums/b173/digital_trucker/Screenshots/RadioStatonManager.jpg
Note: I didn't add the "Edit Event" button since the data grid will be editable.
I'm going to go ahead and start coding on it, but any further suggestions would still be welcomed.
Totally off topic:
Ah, COBOL. Will still be in use when the "year 9999 bug" hits. :rotfl:
I've got to start paying more attention to the state of the software world:oops: . While travelling around the country in my second career, I totally lost track of what programming languages were in use with Windoze. I just "ass-u-me-d" that COBOL was dead. Now I see that there are several "free" COBOL compilers (or should I say translators since what I saw ports the code over to C). You may just be right about it still being around when the "9999" bug hits.:lol:
CaptainCox
08-06-07, 01:00 PM
Looks like a kick ass app there Digital_Trucker. :up:
This game is getting better by the day. We are seeing some darn good work kicking in at the mo when it comes to applications for this game.
ReallyDedPoet
08-06-07, 01:16 PM
Dam there is some nice work being done here, keep it up:up::up:
RDP
Bill Nichols
08-06-07, 02:45 PM
:up: This will be a must-have for me. I'm getting tired of hearing about the free Mexican Jumping Beans that are available at my nearest Shelly gas station... :cool:
JScones
08-06-07, 09:42 PM
OK, here's my redone layout with JScones suggestions implemented (as I understand them anyway :D )
http://i19.photobucket.com/albums/b173/digital_trucker/Screenshots/RadioStatonManager.jpg
Note: I didn't add the "Edit Event" button since the data grid will be editable.
I'm going to go ahead and start coding on it, but any further suggestions would still be welcomed.
:up: IMHO much better! Good use of available "real estate". I like.
I've got to start paying more attention to the state of the software world:oops: . While travelling around the country in my second career, I totally lost track of what programming languages were in use with Windoze. I just "ass-u-me-d" that COBOL was dead. Now I see that there are several "free" COBOL compilers (or should I say translators since what I saw ports the code over to C). You may just be right about it still being around when the "9999" bug hits.:lol:
Our mainframe system has been in use since the mid-1970's. We're still using COBOL. ;)
Misfit138
08-08-07, 06:13 AM
Any progress? :smug:
I apologize my lack of patience but this is the tool I need before I start patrolling in the pacific ;)
Digital_Trucker
08-08-07, 07:53 AM
No problem on the lack of patience, Misfit138. I'm hoping to have the function that prepares the stations for a save game reload in mid patrol (that sure is a long function name:rotfl: ) ready today. I was planning on going ahead and putting it up with just the one function working until I get the rest of it coded since that discussion was what got me started on the project anyway.
Hope that's the part you're looking for 'cause the rest of it may take a little bit.
Edit:Thanks for asking the question since this post caused my rating to change. I was getting tired of lookin' at Popeye:lol:
Misfit138
08-08-07, 08:15 AM
Hope that's the part you're looking for 'cause the rest of it may take a little bit.
Yup, that's the one I want at the moment :) But also eagerly waiting you to finish the rest of your tool, Been thinking of making some sort of Ultimate Radio Pack. Now that I have a faster connection on my use I can even upload it to somewhere!
Just have to wait and see, like many times before
Digital_Trucker
08-09-07, 06:03 PM
Well, here's the first release of the RadioStationManager (such as it is). The ONLY function available with this version is the button that prepares your radio stations for your patrol to start (or resume). It's JSGME ready and comes with a very short README (for the moment. Will do better documentation as it progresses). Please read the readme before you use this app.
You can download it at http://files.filefront.com/RSM05Betarar/;8271800;;/fileinfo.html
I would highly recommend backing up your radio.ini and events.ini files before the first time you use this tool. It is set up to make a backup of the files it changes, but if you don't realize something is wrong until you've used it a couple times and the latest backup is hosed, then you're out of luck.
You will need to have .NET 2 installed for this app to work on your computer. I realize this is a problem for some folks, but at the moment I don't have the tools to do the job without it (nor the inclination to spend a bunch of time learning something new). I have no clue whether it works on W2K or not because I don't have a running machine with W2K installed at the moment. Anyone who wants to try it out on a W2K machine, please let me know if it works.
What you'll see when you run it looks something like this
http://i19.photobucket.com/albums/b173/digital_trucker/Screenshots/8-9-2007-538.58PM.jpg
That screenshot was taken right after the "Prepare Stations" function was completed. Note that you can see all the information that's in the files and you change it to your heart's content, but it won't change the data in the files (except for the "Prepare Stations" function) at the moment. I'll be finishing up the rest of the app just as soon as I possibly can. Most of the hard work is done, so it really shouldn't take too long to finish the rest of it.
As always, with me, this is a freeware application. You can distribute it however you like, but you better not charge anything for it or include it in any package that you charge for. If you do, may the fleas of a 1,000 camels infest your most sensitive hairy regions.
All I ask is that you include the original documentation and don't try to take credit for writing it (common sense, I know, but I like to keep my large posterior out of sight). The only other thing that I ask is that you don't blame me if you didn't make backups of your files and they somehow get FUBAR while your using this proggy.
As usual, all constructive (and even facetious and sarcastic) criticism is welcomed.
Enjoy, me heartys :arrgh!:
Misfit138
08-09-07, 06:40 PM
If you do, may the fleas of a 1,000 camels infest your most sensitive hairy regions.
:rotfl: :rotfl:
Anyways, seems to be working on Windows XP x64 but I get an error when I try to prepare the stations for game load. "Error while writing events.ini new file". This is actually pretty good thing. Gonna need to hit the sack but I'll start digging out tomorrow what's causing this. If I can that is...I have pretty good idea what's causing this but I wanna confirm it first
Thanks! :)
Ps. If you're in need of a mirror for this and coming versions please, let me know
Digital_Trucker
08-09-07, 06:51 PM
Misfit, just let me know if you can't get it to work right. May have to take a look at your files to find out what's causing the problem. Let me know if it created a partial file. It would be named events.ini.new and it might let us figure out where to look for the cause of the problem.
Misfit138
08-09-07, 07:01 PM
Naah, sleeping is a waste of time :cool:
In my case, there seems to be some kind of problem with mid patrol save. If I take from that save games list an autosave, everything works ok. And if I take a save which I've saved before exiting the game, I get this error
Digital_Trucker
08-09-07, 07:32 PM
I don't see anything obvious there and it works fine for me. Did it create a partial file in the events folder? It would be named events.ini.new. If it did that will give us a clue where to start looking for the problem. It's evidently something hinky in your files (or some possibility that I didn't forsee). I'll PM you an email address and if you'll zip up the events.ini files that you have in your radio stations and any of the .new files that were created, I'll see if I can find the problem.
Misfit138
08-09-07, 07:45 PM
Oops, forgot to mention that in my previous post but yeah, it did create an extra file in events folders. But tested this with radio Washington only and it was a go, no errors
But I'm starting to dig out those events.ini files for you and send them asap
Misfit138
08-09-07, 07:56 PM
Looks like a false alarm. Managed to figure out to start digging the radio London folder based on the figure of progress bar and I found a faulty events.ini file. Removed it and and ran your tool. Everything ok!
I apologize this mess
Damn, now I'm both, happy and embarassed hippie! :oops:
Edit: Seems like there's some sort of problem with BBC station from Multi Station V2 events.ini file and with this tool. Confirmation would be great
Digital_Trucker
08-09-07, 09:50 PM
No apologies necessary, dude. I figured there would be problems with some of the files. In fact, your problems have prompted me to add some more features to the thing. When I code the import station function, it's going to have some code in it to identify and possibly correct any problems it finds. Once that's done, if you have a problem with a station that's already in your radio.ini file, you can delete the station with the app (it will only delete the radio.ini entry for the station, not actually delete the folders) and then import it and have the prog get all the files up to snuff (events in correct order and no links to missing media files) and correct any perceived syntax errors. After that, everything should be copacetic.
Just send me any files that you can't figure out what the problem is with, and I'll try to duplicate the problems and conjure up a solution. I don't need the media files, just the events.ini files.
Digital_Trucker
08-10-07, 09:48 AM
For anyone else using the first beta of this app, I've uploaded a slightly improved version. It has more descriptive error messages so that determining the cause of any problems is greatly simplified. It is available at http://files.filefront.com/RSM05Beta.../fileinfo.html
Digital_Trucker
08-11-07, 11:43 AM
Second beta available at http://files.filefront.com/RSM075Betarar/;8287492;;/fileinfo.html
You can now save changes to the radio.ini and events.ini files (no addition or deletion yet though, coming shortly).
ReallyDedPoet
08-11-07, 12:20 PM
Second beta available at http://files.filefront.com/RSM075Betarar/;8286338;;/fileinfo.html
You can now save changes to the radio.ini and events.ini files (no addition or deletion yet though, coming shortly).
Nice :yep:
RDP
Digital_Trucker
08-13-07, 05:27 PM
The final Beta for this app (0.90) is available at http://files.filefront.com/RSM090Betarar/;8304137;;/fileinfo.html
It has all functions enabled and thanks to Misfit138's testing should have all the bugs worked out of it. It also now determines if the media files for an event exist and warns you if it doesn't and it verifies that all events are in the correct date/time order. About all that's left to add is nag screens for saving your changes before exiting the program if you didn't apply changes, a minor problem with the progress bars and doing the documentation (yech!)
Again, if anyone finds a bug, let me know ASAP so I can call the exterminator.
Von Manteuffel
08-14-07, 05:18 AM
Way to go! Well done, Digital_Trucker!
I'll D/L and have a look as soon as I finish work - only another seven hours, or so!
VM
I noticed 2 problems.
1) The Longitude and Latitude column labels should be reversed. ie: Latitude Longitude
2) I'm using 1280x960 resolution and I have to drop the Task Bar to use the bottom buttons as they hide behind it. I tried resizing but it just removes most of the bottom instead of shrinking vertically.
I haven't tried it yet as I am starting a new career.
I'm looking forward to using it. :up:
Jack
Digital_Trucker
08-14-07, 08:42 PM
:rock: Thanks for the feedback, wovik. I knew there was something I was supposed to verify and that was what order those two variables were in.:oops: Geography was never one of my stronger subjects.
I'm a little perplexed as to the size problem. The dialog is 778 pixels high. I tried resetting my desktop to 1280 by 960 and running the app and I still have plenty of room. Granted, I'm running on a 17" CRT monitor, but I would think that pixels are pixels.
I should be releasing it in a day or so (pending me getting off my lazy butt and writing the documentation) .:damn:
Sounds like I shouldn't have the problem. My Taskbar isn't that high. I checked and my screen on this 19" monitor is still at 1280x960 resolution. I wil try rebooting the computer and see if anything changes.
Rebooting didn't help. I looked at your screenshot above and see you are using the new look. I have my set to windows classic style. I noticed a couple of other abnormalties near the left side, top, and bottom. I will try 1280x1024 resolution after I eat supper. In the past when using an older video card I would get problems using 1280x960 but this is the first time I see any problems using this 8800 GTS in 1280x960. I will find a program to take a screen shot so I can post it. You can then see the other abnormalties using classic windows.
I will try changing to the new windows look and see if that fixes it. Be back in a couple hours.
Jack
Digital_Trucker
08-14-07, 10:04 PM
Hoversnap works real well for screenshots. Some of my screenshots were taken while I was running an app called "Windowblinds" that skins windows. I've run it with just the basic old style windows look and it doesn't change a whole lot (except for the flat look versus the 3D appearance of the buttons and such).
I'd be interested in seeing what type of anomolies you have with it. It's always something with 'puters:damn:
chopped50ford
08-14-07, 10:23 PM
is the radio.ini file the same as the radio configuration file?
I had .75 working now .90 is not, it says it cannot find the radio.ini file.
I have all my stations in the radio configuration file which I thought it reads from this one to list the stations.
I put the folder extracted from the file D/L'ed into the same folder as the DAta folder in SH4
Changing to 1280x1024 resolution cures the problem. I actually have a little space above the task bar.
I can't replicate the abnormalties now, it is fine. I don't think it is worth the effort to resize it as most would be using 1280x1024 instead of the 4/3 aspect ratio 1280x960. I can still click the buttons and see 1 and 7/8 horizontal bar graphs so it is usable without dropping the task bar out of the way.
Funny how earlier I had abnormalties like an offset image near the bottom. Perhaps I needed to minimize it and then reopen the screen? Looks fine now. I use the 1280x960 because 1280x1024 makes the small print smaller in height and difficult for me to read even with glasses on. (The glasses make it sharp but also makes it look smaller).
I wish I had this when I set up my radio stations a while back. I have more to add in but wanted to sink some ships so put it off. This tool will make it easier than just using notepad. Now I need to start a new career and get some saves to try it on!
You just need to swap the labels and it will be fine looking.
Jack
Digital_Trucker
08-14-07, 10:31 PM
@chopped50ford
yep, that's the same file. That's wierd. Let me see if I can fathom what the problem is. Is the RadioStationManager.exe in the same folder as the Data folder is? Maybe there is a folder level problem. If you used JSGME, you should have put the folder named RadioStationManager in your mods folder. If not, you should just put the RadioStationManager.exe file in the same folder as the Data folder (in other words, in the topmost folder for the game).
@wovik glad it worked itself out. I know what you mean about the print size, too, I just quit wearing my glasses and the blur made the letters look bigger:yep: Labels have been swapped in the release version, so unless any major bugs show up it'll be out very soon.
It might be less confusing to say... "Put it in the same folder where the sh4.exe file is."
Digital_Trucker
08-15-07, 08:36 AM
It might be less confusing to say... "Put it in the same folder where the sh4.exe file is."
yeah, that's it, what he said!:lol:
I can now tell you this program not only works but solved my CTD problem!
I was getting a CTD on a Mid '43 start in TM 1.5. I thought it appeared to be related to crossing a certain longitude. I've been trying to figure out what caused it.
I missed 2 important clues....
1. The CTD notice showed "MOD sound.act" on it's notice. I wondered if it was related but didn't consider the radio files as I wasn't playing it at the time.
2. It was always on the same date.
It turned out to be a missing file called by an event.ini file in my "Tokyo" event folder of the radio. I was missing 3 files there but all in '43 and '44. Fortunately I had 2 of the files from some other download. The third I substituted a related file in it's place. This cured the June 15, 1943 at 19:00 CTD I was getting. I tested it by removing the file again and sure enough it CTD'ed at exactly 19:00 on June 15, 1943!
Put it back in the folder and no CTD.
I also found problems with another station's event.ini file. It would have CTD'ed in '44 and '45 too!
Thank you for this program or I may never have figured this out. :up: :up: :up: :up: :up:
Jack
Digital_Trucker,
Now that I have used this and it altered all my event.ini files, how do I get it to remove all the semi-colons if I was to start a career again at an earlier date... perhaps in dec '41 again?
Digital_Trucker
08-16-07, 09:01 AM
wovik, open the program up, press the prepare stations button just like you were going to reload a game and when the list of saved games is displayed, select the one that says "New Career". Alternatively, you could chose a saved game that is "in port" such as the autosaves coming in to port. Any game save that is not one that was saved in mid patrol will reset all events to non-commented status.
I'm glad it solved your CTD problem. That's part of the reason I wrote the app to begin with. I used to get those, too, and they drove me crazy.
I understand now.
I never guessed that the problem was there. I unloaded all but mods to the radio and TM 1.5 trying to solve it.
Thank you for this utility. Also Misfit138 for inspiring you to program it.
I was begining to think I couldn't use SH4 with TM after 1942.
Jack
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.