Kromster80 / kam_remake

"KaM Remake" is an RTS game remake written in Delphi from scratch.
http://www.kamremake.com
GNU Affero General Public License v3.0
361 stars 90 forks source link

Scripting: adding the option to abruptly stop a WAV file #365

Open lolslayer opened 7 years ago

lolslayer commented 7 years ago

When playing a WAV file it's impossible to stop it abruptly.

I've got a map in the works where a battle song plays using Actions.PlayWAVFadeMusic() when the enemy is attacking. But the only function to stop music when the attack is over is: Actions.StopLoopedWAV(). This doesn't stop the song abruptly though, it will just make sure that when the song is over it won't loop again. This way the song might play long after the battle is over.

Is it possible to add a scripting function that will stop the WAV while it's playing?

TehPlayer14 commented 7 years ago

Why not just create multiple wavs by spliting the song/music and playing them in order then stop them all at once via stoploopedwav?

Edit: Even if this gets added don't count on new build soon since there wasn't any in meanwhile

lolslayer commented 7 years ago

I thought of that already in the past, but it will take some time to split the songs in multiple files and play them exactly after eachother (which may even create small stops between the splits). Hard-coding all the files in will also take time to do and even if you got it all working perfectly, it still isn't completely perfect.

While a function that just abruptly stops a WAV file from playing works perfectly fine and makes it much easier to make something like custom music at certain intervals.

Kromster80 commented 7 years ago

Stopping playing WAV is a good idea )

TehPlayer14 commented 7 years ago

Indeed but would be nice if it got included in some release since there wasn't any Krom for a long time

When was last version compiled?

LauraRozier commented 7 years ago

AFAIK there must be a big change set before a new release will be published. On the website: Latest release: KaM Remake r6720 (10/12/2014)

lolslayer commented 7 years ago

"Stopping playing WAV is a good idea )"

Thanks :)

reyandme commented 7 years ago

Added StopSound procedure at my repo