Space Engineers

Space Engineers

Isy's Sound Randomizer
32 則留言
Deapri 2024 年 1 月 24 日 下午 3:32 
Isy, would it be too much trouble to add an argument to skip a sound if ddesired?


void Main(string argument)
{
if(argument == "next")

{

firstRun = true;
}
Deapri 2024 年 1 月 24 日 上午 4:21 
Thanks for this Isy, was looking for a was to play a mix track while salvaging via a sound block.
MacMooey 2022 年 5 月 31 日 下午 3:32 
Okay, I was unaware. Still new to the modding scene of SE, thank you so much!
Isy  [作者] 2022 年 5 月 31 日 上午 1:55 
That's because you put it in the MOD list... Scripts are not mods! They have to be subscribed by every user and then loaded into programmable blocks.. Watch this video for more informations about how to do it:

https://youtu.be/NkhZ7BbYgvc
MacMooey 2022 年 5 月 30 日 下午 7:23 
Hey Isy, every time I attempt to load your script in a world, I get a fatal error and the script fails to load.
Sindobaddo 2022 年 4 月 14 日 上午 4:55 
oh... damn, well thank you anyway
Isy  [作者] 2022 年 4 月 14 日 上午 1:19 
No, it's more likely meant to play some ambient background noises now and then.. For your case, you'd need two sound blocks that are triggered by the sensors directly..
Sindobaddo 2022 年 4 月 13 日 上午 9:36 
can this script use a sensor to trigger a specified sound? and another sensor to trigger a different specified sound on the same sound block? or is it only meant for random?
Isy  [作者] 2022 年 2 月 24 日 上午 1:21 
It's definitely possible but would require some work on this script, which I'm honestly not willing to do.. Neither I nor many other people found a good use for it, so you have to take it as-is unfortunately..
waverider6000 2022 年 2 月 23 日 上午 8:00 
Hi Isy.... thanks for your prompt reply

I think I miss understood your description and was trying to achieve a result that the script isn't designed to do which is a shame.

"Main features: Play sounds in order or random order"

I believe that it will play all sounds in list once before restarting the list, but placing sounds in script one after the other doesn't ensure it will play them in the exact order in script.

wish you could enter a number command before sound in the script so that it knows the order to play. I am not sure if thats possible, I am jealous of those who can code thanks for your time.
Isy  [作者] 2022 年 2 月 23 日 上午 3:13 
Uh I didn't touch this script in years - don't know why it would behave that way... By looking at the code, there's not much that can go wrong - it's very straight forward, but it's also not very refined by the looks of things.. The script just starts over after the sequence finished which makes playing a defined set rather difficult.. It was more or less written for ambient noises (wind, birds, passing ships)..
waverider6000 2022 年 2 月 22 日 下午 3:12 
Hi Isy your work is amazing

I am struggling to sort this issue out. I want to play a set of sounds in ascending order example:

string[] soundList = { "Malfunction DetectedId", "Running Virus ScanId", "Systems NormalId", "RebootingId" };

The sounds run in sequence until I added the last sound, it appears they now run in alphabetical order, which is not what I want. can you help because I am trying to create a hilarious situation on my elevator and have further sounds to add which wont sound right otherwise. The sounds copied from custom data to avoid any conflict
Chuck 2020 年 10 月 14 日 下午 10:18 
@The High Velocity Pineapple Yeah that's a bug with small cockpits. I've tested it quite extensively. Not sure if it's reported or not - Keen makes it very difficult to report bugs, probably on purpose.

The only way to hear drone sounds in a small cockpit, would be if you could also hear them when just standing there (aka, the room around the small cockpit is airtight or you are on a planet, etc). I've tested this 15 ways to christmas. It applies to all 3 vanilla small cockpits. It doesnt matter if the small cockpit has an air supply of its own (that helps you hear all other sounds, but still not the drone sounds). Large cockpits in all the same circumstances will hear the drone sounds.
High Velocity Pineapple 2020 年 7 月 24 日 上午 9:45 
None of the Drone sounds appear to work, every thing else does thought?
Titan Nya 2020 年 3 月 17 日 上午 4:40 
Well not what i want to do exactly in my ship but it'll probably help me manage to edit another script for sound use as i have 1 sound block for flight alert that work nativelly with a script (just play the sound in the sound block then needed) and 1 sound block (mirrored cockpit) who is free and would be nice to use it for then a ship is detected or other things like that...

Hope i can understand how sound block work and all of that... I kinda want to finally use the sound mods i've had for a long time...
Isy  [作者] 2019 年 4 月 1 日 下午 3:32 
Current song on a LCD sounds like a good idea, because I love showing stuff on LCDs ;) Regarding the playtime.. I need to have a look at the options I have there, but I'm not sure, whether this is possible..
And regarding the broken sound: this bug exists for a very long time now.. I'm not sure that it will ever be fixed.. I think I need to start a new ticket at the bug tracker..
smartbadger 2019 年 4 月 1 日 下午 3:27 
I hope that Keen fix sound blocks soon, 'cause this script is excellent, but my station's Rec room still spends too long in silence, and my transport doesn't play trucking music nearly as often as it should.
Have you considered echoing the title of the currently playing track to an LCD? Perhaps one of the wee corner LCDs would be a good readout size. Also, I don't think that the script gives you any way to expose how long a particular track is, does it? If it did, it'd be good to have the ability to play the next track when the current one finishes, as opposed to using a fixed time.
Isy  [作者] 2018 年 11 月 3 日 上午 8:42 
Nothing.. Playing sounds with the sound block is always a hit and miss.. Because Keen.. Try playing the same sound in the sound block's terminal screen a few times after another.. It will bug out.. Because Keen!
RedRobin 2018 年 11 月 3 日 上午 5:26 
Hello, thanks for the script! I dont get it - I've read te post below but I dont know whats wrong. I have Station messages as you said. Like "Welcome to the station" but as it was written before - it plays only first sound and then other ones just first half second of it. What am I doing wrong?
Thanks RR
Isy  [作者] 2018 年 9 月 27 日 上午 5:06 
Use the sound block itself with that action..
kulinator1 2018 年 9 月 27 日 上午 4:07 
Can you please add stop and start to the script so i can play i by button?:steamhappy:
Helratz 2018 年 8 月 19 日 上午 6:52 
Is there a way to make a sound block or group of sound blocks play a specific list of sounds that will play in sequence automatically that doesn't require a ton of programmable blocks or timer blocks?
Diego 2018 年 5 月 22 日 上午 8:36 
hmm makes sense thanks
Isy  [作者] 2018 年 5 月 22 日 上午 8:17 
The script sets the loop time to 0 because if you want to randomize sounds, you don't want play one sound in a loop, do you ;) This script only really makes sense, if you have a sound pack with some ambient sounds installed, like bird chirps or station messages, like refinery xyz is broken, please send an engineer :P
Diego 2018 年 5 月 22 日 上午 7:38 
well strange, if i put the music from SE in it it plays one with the loop / the time to the next sound intervall but than it plays only a sek from the second one. With modded alarm sounds it plays only 1sek dosent matter what i do.
Diego 2018 年 5 月 22 日 上午 7:09 
hy Isy, you suprise me every time with your scripts :D but i have a problem with the loop time. That means it only play loopSounds 1sek long
ratheden 2018 年 5 月 20 日 下午 8:19 
Ah, sorry, i just assumed that it was hard to do, not impossible. I have a lot of music and most does not have a common item i their IDs or titles. Some of it does like it is labeled cd1 cd2 etc, those will be easy to search for but the rest i will have to do one by one it seems.


also can a volume setting per song be added? When doing it timer/per/sound block (my old way) i could set the volume on each sound block, as many of the songs play at a different volume.

Anyway, Thanks for a great Mod!
Isy  [作者] 2018 年 5 月 19 日 上午 11:17 
Did you even read my comment? "So, first of all: you can't rename sounds."
ratheden 2018 年 5 月 19 日 上午 10:57 
Can i rename the sounds? if so how? I would like to add a prefix to all songs to make finding them easy, as the names vary a lot.
Isy  [作者] 2018 年 5 月 19 日 上午 2:01 
I don't really understand your problem.. So, first of all: you can't rename sounds. All sounds have an internal ID that is stored in the game files, for example "Lights On" has the ID "SoundBlockLightsOn". That's the way, Keen labeled it internally. My script reads all these IDs and puts them in the custom data of the programmable block so that you can have a look at what IDs are available.
If you build your own soundpack, you can however define the names, IDs and so on.

As described in my script, it can find and play songs by searching for them with partial IDs, so if you have a mod, where all sounds are named like "MyModSound1", "MyModSound2", "MyModSound3", ... you could just use it like this:

string[] soundList = { "MyMod" };

The script will find all sounds, that contain "MyMod" and play them..
ratheden 2018 年 5 月 18 日 下午 6:53 
My current way is to build sound blocks on the electronics attachment mod, this lets me have 25 soundblocks in 1 large grid space, then i add a 2nd electronics attachment add 25 timers, and tell the first to play, then start the next timer.... LOTS of setup, no randomizing, and you have to set the delay on each timer for the song length....

So your script seems like the answer.. i have managed to get it to play 5 songs, learning the syntax of scripting as i go, but slowly.

ON to my question:
is there a easy way to change the ID or Song name? so i might make this easier by adding a prefix to Songs and not sounds?
ratheden 2018 年 5 月 18 日 下午 6:26 
This seems to be EXACTLY what i have been wanting so badly of late...
But when i copy a list of sounds from the custom data and place it in this area at the end of this, // List of sounds by ID. IDs are saved in the custom data of the programmable block for easier access.
// The search for sounds can be done with partial strings, like "Sound" will find all sounds containing this string
// Example: string[] soundList = { "SoundBlockLightsOn", "SoundBlockLightsOff", "SoundBlockObjectiveComplete" };
string[] soundList = {}; text
, placed here: soundList = {}; in the brackets. I get a lot of errors, tried adding commas after each sound(song) and that cleared a few errors but does not get them all.

So, How can i using the custom data, insert songs into end of that list of sounds by ID? Do i need a sound block for each song? i am only using 1 at them moment.

Your Scripts are the best, just gotta learn to use them right :)