Author Topic: True "radio stations" and setVehicleStereo  (Read 427 times)

I have some ideas for events that would be pretty useful involving radio stations.

{Self/Named B rick/Vehicle} radioSetStation [stationFrequency] - Allows you to "tune into" a station. You could set a brick's station or a vehicle's station (allowing for a true car radio experience). There would be a single textbox accepting a floating-point number from 0 to 1000. Alternatively, you could use names for stations. A frequency of 0 would be the default and would act as the off-state, effectively "de-tuning" the brick's/vehicle's radio, preventing broadcasts to it.
Expansion on the idea: It would be cool if someone could figure out some way to instantly change the brick's/vehicle's music to the song currently being broadcast when the station is changed. They'd miss out on messages since those are instantaneous, but it'd be cool to hear what's playing on the new station right away, instead of waiting until the next broadcast from the station. Also, there could be a chat command allowing the driver of a vehicle to manually tune to a station with /setStation [0-1000]

{Self/Named Brick}radioBroadcastSong [stationFrequency] [songToPlay] - Broadcast a song over a certain frequency. Would have a textbox identical to radioSetStation, as well as a dropdown for the song to play.

{Self/Named Brick}radioBroadcastMessage [stationFrequency] [msgType] [msg] - Broadcast a message over a certain frequency. Would have a textbox for the frequency, a dropdown to select whether the message is a chatMessage, centerPrint, or bottomPrint, and another textbox for the contents of the message. For bricks, the message would be broadcast within a certain radius. For vehicles, everyone mounted to the vehicle would receive the message.

{Self/Named Brick} setVehicleStereo / {Vehicle} setStereo [list {Enable, Disable, Set Song}] [songToPlay] - Allows you to change the properties of a vehicle's stereo. When the first dropdown is set to "enable", the stereo works as normal (type /stereo and select a song). "Disable" stops the stereo from working (would display a message if a user typed /stereo in the vehicle). The "Set Song" option would utilize the second dropdown, allowing you to remotely change the song that is playing in the vehicle.

---

I realize a lot of this can already be done with named bricks, but these events would work across brickgroups, allowing users to opt-into listening to a station or simply disallow reception of broadcast songs. Also, there is currently no event to change a vehicle's music (as the vehicle stereo is an add-on itself).

The only issue I could see with an event like radioBroadcastSong is that it would probably have to iterate through every single brick and vehicle to see if it has the same station as the broadcast event and, if it does, set its music (if possible).

Let me know whether or not you think this is a good idea.[/list]
« Last Edit: June 22, 2012, 11:01:01 PM by Slezak »

The only thing that wouldn't work is playing a song works by telling the client "play this song" only once, so you may get misalignment issues.

I tried to work with someone to get a radio OGG file to play when someone was in the car, but to have it continuously playing when they weren't in the vehicle to simulate "live" radio.

There were lots of technical challenges and it never got finished. That person might have been just no-good with code, but still, you'll want to consider how "realistic" you want your  radio.