Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign up[Ready]Car stereos #7458
Conversation
werty1124
added some commits
Apr 28, 2014
This comment has been minimized.
This comment has been minimized.
|
Wow! |
This comment has been minimized.
This comment has been minimized.
tyrael93
commented
Apr 28, 2014
|
Go go gadget cheap infinite morale boost. |
This comment has been minimized.
This comment has been minimized.
|
Nice work, but somehow you messed up the line endings in "data/json/items/melee.json" or maybe the indentation, it shows up as completely changed. Link to issue #7293 - so it can be closed later. |
This comment has been minimized.
This comment has been minimized.
|
Dang I didn't even notice that... Should be fixed now. I'm not really sure how I even managed to do that. |
KA101
reviewed
Apr 28, 2014
| "symbol":"?", | ||
| "color":"white", | ||
| "name":"music cd", | ||
| "description":"A cd with many hit songs burned to it.", |
This comment has been minimized.
This comment has been minimized.
KA101
Apr 28, 2014
Contributor
Probably capitalized: CD. Nice that we're still using CD-Rs in 204X; no objection on my part.
holds out for the dramatic classical CD or (of course) the post-glam speed polka
KA101
reviewed
Apr 28, 2014
| continue; | ||
| const int radio_x = global_x() + parts[p].precalc_dx[0]; | ||
| const int radio_y = global_y() + parts[p].precalc_dy[0]; | ||
| g->sound(radio_x,radio_y,15,"dun dun duuun"); |
This comment has been minimized.
This comment has been minimized.
KA101
Apr 28, 2014
Contributor
Huh. Any possibility of grabbing the sound-picking scheme from the mp3 player? Generic "dun dun duuun" might get old for players.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This has popped up on the forums for some time now, and will likely get aftermarket modded to handle USB drives and the mp3 player, I'd imagine. Nice start, though. :-)
It caps at 20, if I read the code correctly, so it's weaker than a rechargeable mp3 player. Ease up. |
This comment has been minimized.
This comment has been minimized.
|
Yea it caps at 20 and starts going away as soon as you leave it's range |
KA101
reviewed
Apr 29, 2014
| std::string sound = ""; | ||
| const int radio_x = global_x() + parts[p].precalc_dx[0]; | ||
| const int radio_y = global_y() + parts[p].precalc_dy[0]; | ||
| switch (rng(1, 10)) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
werty1124
Apr 30, 2014
Author
Contributor
I just copied the mp3 code. I'm guessing it's like that to keep From displaying a message for the sound every time you move but I can change it to 1,5
This comment has been minimized.
This comment has been minimized.
KA101
Apr 30, 2014
Contributor
Guessing, w/o having looked recently, that the mp3 only gives a message every so many turns. (I know the classical gave extra morale for high-IN folks too. Not sure if that's changed.)
Might be worth having it check every three to five minutes or so and change the message then?
This comment has been minimized.
This comment has been minimized.
werty1124
Apr 30, 2014
Author
Contributor
Yea that might work. I'll take a look at the mp3 code again.
werty1124
added some commits
Apr 30, 2014
This comment has been minimized.
This comment has been minimized.
|
Would radio stations still be transmitting without power? I would imagine instead of music, at the very least, you'd get a repetitive EBS warning every so often. Unless it's assumed that you're listening to music on some storage medium. Maybe have the option to swap back and forth, with the radio being able to clue you in to certain locations, and the CD/mp3/whatever player for music. |
BevapDin
reviewed
Apr 30, 2014
| stereo_on = false; | ||
| } else if (stereo_on == false) { | ||
| add_msg("You eject your CD!"); | ||
| g->u.inv.add_item_by_type(itypes["music_cd"]->id); |
This comment has been minimized.
This comment has been minimized.
BevapDin
Apr 30, 2014
Contributor
You already know the id of the item, it's "music_cd". No need to look it up in the itypes map. Just add_item_by_type("music_cd").
Also this checks for an item with the CD flag, but still uses the fixed item id.
This comment has been minimized.
This comment has been minimized.
werty1124
Apr 30, 2014
Author
Contributor
O ok I'll fix that at first I was going to just look for that flag but then decided just to do the fixed item id.
This comment has been minimized.
This comment has been minimized.
|
You have to have a music CD in your inventory to turn the radio on. When you turn it on I takes the |
This comment has been minimized.
This comment has been minimized.
|
Integrating radio into it makes sense, but I don't think it's absolutely essential to the feature. Further, that would probably touch radio broadcasting too (having each tower with its own frequency, etc). So yeah, it'd be nice, but having music in cars is a good first step. |
This comment has been minimized.
This comment has been minimized.
|
Just fyi, radio towers (and other transmitters) do have their own |
This comment has been minimized.
This comment has been minimized.
|
OK, so someone could just hook into that code. Good to know. |
This comment has been minimized.
This comment has been minimized.
|
This is a stupid question but how do you check for a specific item? I've been trying to figure it to work for like 40 minutes and nothing that I have tried worked. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
What other things are usable? looking for a "Ready" tag! |
This comment has been minimized.
This comment has been minimized.
|
Well I didn't add anything else but you can use anything with CD flag on the stero instead of just the music CD. It works like picking seeds to plant so if you have more than 1 item with the CD flag it pops up a menu where you choose the item. Also I think it's ready but I wanted to do a little more testing. |
This comment has been minimized.
This comment has been minimized.
|
I didn't see anything else get assigned the CD flag here. Something I missed? |
This comment has been minimized.
This comment has been minimized.
|
Yea I didn't add anything, at first only the music CD worked but now anything with the CD flag works to start the stereo... I think my commit name may have been a little confusing |
This comment has been minimized.
This comment has been minimized.
|
OK, so folks could add the "CD" flag to an mp3 player or (hypothetically) a "USB drive with music files", for instance. Fair enough. |
This comment has been minimized.
This comment has been minimized.
|
Exactly |
This comment has been minimized.
This comment has been minimized.
|
Throw one into the luxury RV or something, and let us know when you're ready for mergetesting? |
This comment has been minimized.
This comment has been minimized.
|
Alright I'll do that and it should be ready. |
werty1124
changed the title
Car stereos
[Ready]Car stereos
May 5, 2014
This comment has been minimized.
This comment has been minimized.
|
FWIW it doesn't ping us when you push a commit, so I missed this in my first pass. |
werty1124 commentedApr 28, 2014
#7293
The description and sound probably need changed. I couldn't think of anything.
Adds a stereo that can play music and boost morale if you are standing near it while it is playing music