Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ready]Car stereos #7458

Merged
merged 11 commits into from May 5, 2014

Conversation

Projects
None yet
7 participants
@werty1124
Copy link
Contributor

commented Apr 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

werty1124 added some commits Apr 28, 2014

@Zireael07

This comment has been minimized.

Copy link
Contributor

commented Apr 28, 2014

Wow!

@tyrael93

This comment has been minimized.

Copy link

commented Apr 28, 2014

Go go gadget cheap infinite morale boost.

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Apr 28, 2014

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.

@werty1124

This comment has been minimized.

Copy link
Contributor Author

commented Apr 28, 2014

Dang I didn't even notice that... Should be fixed now. I'm not really sure how I even managed to do that.

"symbol":"?",
"color":"white",
"name":"music cd",
"description":"A cd with many hit songs burned to it.",

This comment has been minimized.

Copy link
@KA101

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

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.

Copy link
@KA101

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.

Copy link
@werty1124

werty1124 Apr 28, 2014

Author Contributor

Yea that's a good idea!

@KA101

This comment has been minimized.

Copy link
Contributor

commented Apr 28, 2014

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. :-)

Go go gadget cheap infinite morale boost.

It caps at 20, if I read the code correctly, so it's weaker than a rechargeable mp3 player. Ease up.

@werty1124

This comment has been minimized.

Copy link
Contributor Author

commented Apr 28, 2014

Yea it caps at 20 and starts going away as soon as you leave it's range

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.

Copy link
@KA101

KA101 Apr 29, 2014

Contributor

Uh, surely (1, 5)?

This comment has been minimized.

Copy link
@werty1124

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.

Copy link
@KA101

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.

Copy link
@werty1124

werty1124 Apr 30, 2014

Author Contributor

Yea that might work. I'll take a look at the mp3 code again.

@vache

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2014

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.

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.

Copy link
@BevapDin

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.

Copy link
@werty1124

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.

@werty1124

This comment has been minimized.

Copy link
Contributor Author

commented Apr 30, 2014

You have to have a music CD in your inventory to turn the radio on. When you turn it on I takes the
CD when you turn it off you get the CD back.

@KA101

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2014

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.

@kevingranade

This comment has been minimized.

Copy link
Member

commented May 1, 2014

Just fyi, radio towers (and other transmitters) do have their own
frequencies and transmission strengths already, it's what lets you tune
into different towers and use triangulation.

@KA101

This comment has been minimized.

Copy link
Contributor

commented May 1, 2014

OK, so someone could just hook into that code. Good to know.

@werty1124

This comment has been minimized.

Copy link
Contributor Author

commented May 1, 2014

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.

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented May 1, 2014

iexamine::dirtmound does it nicely. It's nearly the same but with the SEED flag instead.

@KA101

This comment has been minimized.

Copy link
Contributor

commented May 3, 2014

What other things are usable?

looking for a "Ready" tag!

@werty1124

This comment has been minimized.

Copy link
Contributor Author

commented May 4, 2014

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.

@KA101

This comment has been minimized.

Copy link
Contributor

commented May 4, 2014

I didn't see anything else get assigned the CD flag here. Something I missed?

@werty1124

This comment has been minimized.

Copy link
Contributor Author

commented May 4, 2014

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

@KA101

This comment has been minimized.

Copy link
Contributor

commented May 4, 2014

OK, so folks could add the "CD" flag to an mp3 player or (hypothetically) a "USB drive with music files", for instance. Fair enough.

@werty1124

This comment has been minimized.

Copy link
Contributor Author

commented May 4, 2014

Exactly

@KA101

This comment has been minimized.

Copy link
Contributor

commented May 4, 2014

Throw one into the luxury RV or something, and let us know when you're ready for mergetesting?

@werty1124

This comment has been minimized.

Copy link
Contributor Author

commented May 5, 2014

Alright I'll do that and it should be ready.

@werty1124 werty1124 changed the title Car stereos [Ready]Car stereos May 5, 2014

@KA101

This comment has been minimized.

Copy link
Contributor

commented May 5, 2014

FWIW it doesn't ping us when you push a commit, so I missed this in my first pass.

@KA101 KA101 self-assigned this May 5, 2014

@KA101 KA101 merged commit 894e2b5 into CleverRaven:master May 5, 2014

1 check passed

default This has been rescheduled for testing as the 'master' branch has been updated.

@ianestrachan ianestrachan referenced this pull request May 15, 2014

Closed

Music in the car #7293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.