Spacegate sounds

Veracity

Developer
Staff member
On the KoL Gameplay/Discussion forum, jon_diaz said this:

Also does the spacegate KAWOOSH when you dial up a planet? If not that's a travesty

KoLmafia can do that. This thread - Add sounds to barrel smashing! (patch-included) resulted in us adding barrel smashing sounds (opt in).

It was discussed doing it as a relay script, but was rejected at the time, since we didn't have good support for choice overrides based on choice #. We do now, so it could certainly be a relay script or built in, as with the barrel sounds, controlled by the same preference: relayAddSounds

We'd need an ash file in relay - choice.1235.ash - to inject javascript into the choice page.
We'd need an mp3 file - spacegate_activate.mp3 to play when any of the options that activate the gate are selected
We'd need a javascript file to play the sound.

Seems like a fun little project. I'm game to try a relay script for it. I'm not sure of the desired sound, however, having never actually seen the show. :)

The net has lots of resources - videos, as well as a variety of downloaded .mp3 files.

Here are a couple of examples I found and saved. If somebody (like jon_diaz) has a "canonical" version of the sound in mind, I'd appreciate it if they could point me to it.

Thanks.

spacegate-activate1.mp3 (59 KB)
spacegate-activate2.mp3 (1.07 MB)
 

Darzil

Developer
Probably the first one.
Second is much longer, and more the sound of an unexpected gate opening, with alarms going off, and we don't get those in KOL, we just open it ourselves.
 

fronobulax

Developer
Staff member
Probably the first one.
Second is much longer, and more the sound of an unexpected gate opening, with alarms going off, and we don't get those in KOL, we just open it ourselves.

If the second one were shorter I'd vote for it. I like the alarms and I have been in places where a deliberate and expected action sets off the alarm - pressing the alarmed fire escape crashbar or being near a vehicle backing up, as examples. But my opinion is not important since I am likely to enable the sounds.
 

Veracity

Developer
Staff member
Heh. I actually have this coded, using Ezandora's Choice Override library, which makes it easy to have choice.1235.ash.

I need one little addition to my Javascript file to make it not play the sound if you are using the second form (a 7-letter coordinate word) unless the input really is exactly seven letters, since KoL will reject invalid input.

Today is likely to be be busy, but I expect I'll be able to release it by tomorrow, at least. Time to sleep now.
 

jon diaz

New member
I was more thinking about an animated GIF of the activation than a sound, lol.

But I'd go with the first sound rather than the entire dialing sequence, yes. It kind of sounds like the second one has also been edited like a skipping record, too.

For the record I don't actually own a Spacegate so sorry if these comments were dumb

P.S: Let me take this opportunity to thank Veracity/y'all for your work on Mafia. Keep up the good work.
 

Veracity

Developer
Staff member
This was a learning experience.

Playing a sound is an asynchronous operation; you kick it off, and eventually it completes.
For the barrel sounds, the sound kicks off while animation shows and you remain on the same page.
For Spacegate, it kicks off when you submit the form - which leaves the page and kills the sound.

So, in the submit handler, disable default form submission, kick off the sound in a promise, when the sound finishes playing, resolve the promise, and then submit the form. I believe that is the "correct" way to do this, since Google is my friend.

The result is that you click the button, it plays the sound, and then the browser opens the "welcome to the new planet" page.

I submitted the code as a Relay Override at this thread.

I'll add it to the script manager, by and by.
 
Top