Welcome, Guest. Please login or register.
Did you miss your activation email?
October 17, 2021, 06:52:09 am

Login with username, password and session length
Search:     Advanced search
Savage: XR is a new patch for Savage, created by the Newerth.com staff. The XR1.1 Client is out now! Download it now!
190122 Posts in 11015 Topics by 18626 Members
Latest Member: RabbitWhite
* Home Forum Wiki Help Search Login Register
+  Newerth Forums
|-+  Savage XR
| |-+  Mapping & Modding Forum
| | |-+  Pick the music for your map!
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Go Down Print
Author Topic: Pick the music for your map!  (Read 9327 times)
Tjens
I make maps and stuff
Super Hero Member
******
Posts: 1995


GIFMEISTER


View Profile
« on: March 25, 2015, 07:01:41 pm »

So you want to handpick the music that plays on your map? Well now you can!!

You can find the available music in the Savage XR/game/music folder.



Then you can use this script in the editor:

!exec client StopMusic1
!exec null client "play2d music/[SONGNAME.OGG]


For making the music start at the beginning I use a trigger box right in front of the stronghold, so when a unit spaws it immediatly starts the script, check out the attached screenshot for the flags!


* stuff.png (3674.59 KB, 1680x1050 - viewed 618 times.)
Logged

KingKong_
Full Member
***
Posts: 122


View Profile
« Reply #1 on: March 29, 2015, 11:14:27 am »

Good find, though I think that script that you use to start the music will only work for the first player to enter the trigger. Unless I remember wrong the once flag means the script will only activate once per game, not once per player. The way xr_mini uses to create the "game objective" voice for all players might for music as well, I'll test this and post the results.

Actually, since there's no target flag I think what I said above is wrong and it will trigger the music for all the players? I have no way to test this really. Still, using trigger box infront of sh has the problem that the quickest player will fire the event and those that haven't loaded the map yet will miss it.

e:

couldn't get it working with the client file, perhaps because the stuff in client file might be executed before the normal music starts, so the normal music can't be stopped there and will replace what's done in the client file. or something.

e2:

one way to start the music (and stop the default) is to use event trigger. This method has two problems though:

1: only works for players who are there at the start of the map
2: the default music plays for the first few seconds (the duration you set the event to wait)

in the attached image i set the event to wait for five seconds so people with slower computers will have the map loaded before the event fires.

perhaps someone can find a way that fixes the problems of the above method? only the first one is serious, the second is quite trivial since the default musics start so slowly and quietly.

e3:

i actually have no idea whether music started this way will loop, if not you need two event triggers: one to fire at start to start the first time the music plays, and another with interval set to the duration of the track, that restarts the music after it ends. can't really be bothered to test whether the music will loop automatically or not right now.


* trigger.png (886.39 KB, 1239x642 - viewed 493 times.)
« Last Edit: March 29, 2015, 12:34:53 pm by KingKong_ » Logged
Daemon
XR Main Developer
Legendary Member
****
Posts: 4823


beware, for this is the everbroken...


View Profile
« Reply #2 on: March 29, 2015, 12:55:07 pm »

Music does loop by default.
Logged

SNOWFLAKE
Sr. Member
****
Posts: 372


I make Llambda_1757L


View Profile
« Reply #3 on: March 29, 2015, 11:20:57 pm »

Any chance to add music to the map's folder so when a client downloads the map it already has the music inside the .s2z file?
Logged

SNOWFLAKE
Sr. Member
****
Posts: 372


I make Llambda_1757L


View Profile
« Reply #4 on: March 30, 2015, 06:23:26 pm »

doublepost ftw!

Daemon, is there any way to allow world/xr_mapname/music folder when uploading a map?

Here's the log when uploading the .s2z

Map File Log:
File: world/xr_wild/xr_wild.texm
File: world/xr_wild/xr_wild.hm
File: world/xr_wild/xr_wild.shdref
File: world/xr_wild/xr_wild.cm
File: world/xr_wild/xr_wild.am
File: world/xr_wild/xr_wild.am2
File: world/xr_wild/xr_wild.sm
File: world/xr_wild/xr_wild.sm2
File: world/xr_wild/xr_wild.sm3
File: world/xr_wild/xr_wild.objpos
File: world/xr_wild/trigger/mus.aabox.trigger
File: world/xr_wild/trigger/mus2.aabox.trigger
File: world/xr_wild/scripts/music.gs
File: world/xr_wild/config_server.cfg
File: world/xr_wild/config_client.cfg
File: world/xr_wild/xr_wild.cfg
File: world/xr_wild/tod.cfg
File: world/xr_wild/music/
The uploaded map file has disallowed contents!

Note: whether I paste the music folder into "/world/music" or "/world/xr_wild/music" (inside the xr_wild.s2z file) they both work on the client, tested after deleting the "/game/music" folder
« Last Edit: March 30, 2015, 06:26:51 pm by SNOWFLAKE » Logged

Daemon
XR Main Developer
Legendary Member
****
Posts: 4823


beware, for this is the everbroken...


View Profile
« Reply #5 on: March 30, 2015, 06:51:30 pm »

I can't help you with that, sorry.
Logged

Tjens
I make maps and stuff
Super Hero Member
******
Posts: 1995


GIFMEISTER


View Profile
« Reply #6 on: March 30, 2015, 07:34:50 pm »

You might try putting the files in the "sound" folder inside the world archive! You could peek at "xr_bubbles" as how to implement sounds!
Logged

KingKong_
Full Member
***
Posts: 122


View Profile
« Reply #7 on: March 30, 2015, 08:55:36 pm »

Unfortunately bubbles isn't a good example of sound-use right now, all the methods I've tried so far only work on devworld, but fail to work on actual server. Well actually I know that the current method (using state-effects) would work (since it works in Djingis's xr_blink), but I think i got a bit too greedy and tried to minimize the delay between action and sound effect too much, and the server can't quite keep up. Would need some trial and error to find out what kind of delay (= state duration & effect interval) the server can comfortably handle. But using states to play sounds is quite hacky, perhaps there is a better working method and I just don't know about it.

Logged
Tjens
I make maps and stuff
Super Hero Member
******
Posts: 1995


GIFMEISTER


View Profile
« Reply #8 on: March 30, 2015, 09:06:36 pm »

Well, the method I used is just the play2d command as follows

Trigger/event ->

Code:
!exec all client "play2d sound/[YOUR SOUND COPIED INTO THE SOUND FOLDER HERE]"

Using states goes a bit over my head, but as KingKing said, try looking at xr_blink Smiley
Logged

KingKong_
Full Member
***
Posts: 122


View Profile
« Reply #9 on: March 30, 2015, 09:14:30 pm »

another way to play a sound is !exec voice, but i think these methods don't work in a "natural" way, ie. sound doesn't have location, radius etc. I believe state-emmited sound does. It unfortunately also needs a large delay to ensure it activates.
Logged
Tjens
I make maps and stuff
Super Hero Member
******
Posts: 1995


GIFMEISTER


View Profile
« Reply #10 on: September 12, 2018, 12:06:35 am »

Herrow!!!

I found the holy grail of mapbased music activation


So I was digging around in some file called "eden2.cfg" to look for a way to lessen a certain persons butterfly fobia, and came across this little set of lines:

Code:
set cl_music1 music/to_rebuild_and_restore.ogg
set cl_music2 music/the_savage_age.ogg
set cl_music3 music/a_new_earth.ogg
set cl_music4 music/lost_hills.ogg
set cl_music5 music/the_legion_advances_by_moonlight.ogg
set cl_music6 music/the_savage_age.ogg

The way it works is that you have to open a map file with an unzipper like winrar, and look for the [map's name] with a .CFG extension. Place in the lines you want to add, save, repack the "world" map as a zip and change the extension to [map's name].CFG.


So now you can change the music playing on any given map, to give it that extra bit of tune!
Logged

Trigardon
Forum Administrator
Legendary Member
****
Posts: 4830


Demonic Monster


View Profile WWW
« Reply #11 on: September 12, 2018, 12:38:01 am »

Herrow!!!

I found the holy grail of mapbased music activation


So I was digging around in some file called "eden2.cfg" to look for a way to lessen a certain persons butterfly fobia, and came across this little set of lines:

Code:
set cl_music1 music/to_rebuild_and_restore.ogg
set cl_music2 music/the_savage_age.ogg
set cl_music3 music/a_new_earth.ogg
set cl_music4 music/lost_hills.ogg
set cl_music5 music/the_legion_advances_by_moonlight.ogg
set cl_music6 music/the_savage_age.ogg

The way it works is that you have to open a map file with an unzipper like winrar, and look for the [map's name] with a .CFG extension. Place in the lines you want to add, save, repack the "world" map as a zip and change the extension to [map's name].CFG.


So now you can change the music playing on any given map, to give it that extra bit of tune!


Did you try it yourself?
Logged

Tjens
I make maps and stuff
Super Hero Member
******
Posts: 1995


GIFMEISTER


View Profile
« Reply #12 on: September 12, 2018, 08:19:43 pm »

No, I shall try such a thing right now!

And yes, it worked! Sacrifice
« Last Edit: September 12, 2018, 08:26:03 pm by Tjens » Logged

Trigardon
Forum Administrator
Legendary Member
****
Posts: 4830


Demonic Monster


View Profile WWW
« Reply #13 on: September 12, 2018, 10:45:59 pm »

And the music is placed inside the maps.s2z or is it using the ones from savage0.s2z?
Logged

Tjens
I make maps and stuff
Super Hero Member
******
Posts: 1995


GIFMEISTER


View Profile
« Reply #14 on: September 13, 2018, 02:55:57 pm »

The music you can pick from is limited to the game folder, and as far as I can tell can't be extracted from maps or other .s2z packs!
Logged

Pages: [1] 2 Go Up Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.037 seconds with 19 queries.