Product Chat / Inserting Game Over / Win music

Author
Message
Cylo
Game Guru Backer
14
Years of Service
User Offline
Joined: 2nd Jun 2010
Location:
Posted: 23rd Mar 2017 14:55
Just like the "title.ogg" file in the menu, I would like to add music for game over for the player's death or for the game victory.
Is it possible to do it directly?
PM
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 23rd Mar 2017 15:02
Yes, you would need to add it to a script using PlaySound(e,0) if you check

If g_PlayerHealth == 0 then PlaySound(e,0)

Where e is the entity soundbank slot 0 of the music file.

Hope that helps.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
Cylo
Game Guru Backer
14
Years of Service
User Offline
Joined: 2nd Jun 2010
Location:
Posted: 23rd Mar 2017 15:06
I mean during the Gameover/Victory screen.
PM
Tarkus1971
Audio Media Maker
9
Years of Service
User Offline
Joined: 24th Feb 2015
Location: England, UK
Posted: 23rd Mar 2017 15:18 Edited at: 23rd Mar 2017 15:18
Never tried there, I'm not sure. Maybe add something to gameloop.lua

Backup the original file 1st though.
Aftershock Quad Core AMD FM2+ 3.5 GHz 8GB Motherboard and Processor, A7700k apu, Asus GT970 STRIX 4gb Nvidia gfx card.
King Korg Synth, Alesis SR18 Drum Machine, Akai MPX8 sample player, Roland Fantom XA Synth, Axus Digital AXK2 Digital Drum Kit, Novation Ultranova Synth, Waldorf Blofeld Synth.
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 23rd Mar 2017 15:43
I'm pretty sure one of the pre-made games has this already, i forget which, take a look in your titlesbank at the various demo game folders and look at the game over script for them, that might give you an idea.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Cylo
Game Guru Backer
14
Years of Service
User Offline
Joined: 2nd Jun 2010
Location:
Posted: 23rd Mar 2017 19:52
Quote: "I'm pretty sure one of the pre-made games has this already, i forget which, take a look in your titlesbank at the various demo game folders and look at the game over script for them, that might give you an idea.
"
What do you mean? They're just maps.
PM
Belidos
3D Media Maker
9
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 23rd Mar 2017 20:53
some of them also have titlesbank files for if you want to make them standalone

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Cylo
Game Guru Backer
14
Years of Service
User Offline
Joined: 2nd Jun 2010
Location:
Posted: 23rd Mar 2017 22:31
Just The Escape.

And I think there must be some scripting for what I want, or maybe one of GG developers could tell this.
PM
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 24th Mar 2017 11:38
The win/lose screens are just like the title screen, LUA scripted and easily modded. Just look at how the title screen music is loaded and played, and copy the code to your end screens and you should be fine. I externalized them all to scripts so these kinds of cool tricks could be done. The commands you want to look at are:

LoadGlobalSound ( "titlesbank\\default\\yourendmusic.ogg", 2 )
LoopGlobalSound ( 2 )

Hope this helps.
PC SPECS: Windows 8.1 Pro 64-bit, Intel Core i7-5930K (PASSMARK:13645), NVIDIA Geforce GTX 980 GPU (PASSMARK:9762) , 32GB RAM

Cylo
Game Guru Backer
14
Years of Service
User Offline
Joined: 2nd Jun 2010
Location:
Posted: 25th Mar 2017 10:42
Thank you, I've tried this for the gameover screen, but the sound keeps looping after clicking Continue...
PM
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 27th Mar 2017 21:59
Yes you will need to call StopGlobalSound ( 2 ) when you click the button to stop the music.
PC SPECS: Windows 8.1 Pro 64-bit, Intel Core i7-5930K (PASSMARK:13645), NVIDIA Geforce GTX 980 GPU (PASSMARK:9762) , 32GB RAM

Cylo
Game Guru Backer
14
Years of Service
User Offline
Joined: 2nd Jun 2010
Location:
Posted: 28th Mar 2017 19:54
Well, can StopGlobalSound work in trigger zones too?

I want to stop an ambience music looping while entering in Story Zone.
PM
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 28th Mar 2017 20:28 Edited at: 28th Mar 2017 20:28
Sure, the global sounds will work in any phase (though they cannot transition between title, game, endscreens, e.t.c. Loaded global sounds are only valid for the session they are created in).
PC SPECS: Windows 8.1 Pro 64-bit, Intel Core i7-5930K (PASSMARK:13645), NVIDIA Geforce GTX 980 GPU (PASSMARK:9762) , 32GB RAM

3com
10
Years of Service
User Offline
Joined: 18th May 2014
Location: Catalonia
Posted: 31st Mar 2017 20:46
I've done something about here.

3com
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz

OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4

PM

Login to post a reply

Server time is: 2024-11-24 13:28:17
Your offset time is: 2024-11-24 13:28:17