Need help with scripting.......again! Issue Semi-Resolved

Avatar
Tmast98
210 Posts
Posted Aug 19, 2013
Hi,

I'm running into a problem with the custom music in a map of mine. In the map, when the player enters a funnel, the music immediately stops, however upon leaving the funnel, the music does not continue or resume playing. I have figured that I probably have to script the music to play, or keep playing, since I found something similar to this valve did for the music which plays in the funnel in the Wheatley Maps in the scripts folder (scripts/game_sounds_music_a4.txt).

Here is some information which might help you help me:

My map's name is sp_tmastmap

The ambient generic in the map is started by a trigger, not by the flag start silent being unchecked.

The ambient generic plays everywhere.

The ambient generic is not looped, but is instead looped by a relay which recalls itself every 187 seconds (the length of the music) to loop it. This does work. The music is also called by a logic_auto for when the player dies, which also works.

I hope that helps! Does anyone know how I would even begin going about getting the music working properly? I don't care if it is silent while in the funnel, I just would like the music to resume playing when the player leaves the funnel at least.

Thanks for the help!

Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted Aug 19, 2013
Replied 8 hours later
You should actually loop the music, for one. :razz:

Then make a soundscript, using the game_sounds_music_a4 or whatever for a sample, containing your sound with the operator stacks for tbin and tbout.

Avatar
srs bsnss
552 Posts
Posted Aug 20, 2013
Replied 7 hours later
I found that playing A4 music via an ambient generic, not using 'RAW' but 'GAME SOUNNDS', made TBeam music start playing when I was in one...while it's only applicable if it suits your map, perhaps it's worth a shot? I used "music.sp_a4_laser_catapult_b1". I also used "music.sp_a4_laser_catapult_l1" on a laser catcher.
Avatar
Tmast98
210 Posts
Posted Aug 20, 2013
Replied 10 hours later
Well, the problem is that it isn't a4 music, it's custom music.

Thanks for the advice though!

Avatar
DaMaGepy
361 Posts
Posted Aug 21, 2013
Replied 1 day later
my custom musics loop similarly but they just fade out a little while I'm in a funnel and volume goes back up when I'm out, they never stop. weird.
Avatar
Tmast98
210 Posts
Posted Aug 26, 2013
Replied 4 days later
Anyone else have any idea's of how to fix this issue? I've run up with nothing after another two days of attempting to fix this.
Avatar
TeamSpen210
608 Posts
Posted Aug 26, 2013
Replied 44 minutes later
I was trying to fix the music for my own map the other day using soundscripts. I was just copying bits from the a4 music and renaming them to match my map name. Mine works, except that the exursion funnel music is stuck on. That's probably a typo.
Avatar
Tmast98
210 Posts
Posted Aug 26, 2013
Replied 4 hours later
Hey thanks for the help!

Question regarding the script. For editing it to play my music on exiting a funnel, is this the only part I would keep then?

{
"entry_name" "music.sp_a2_crushed_gel_tbin"
}
"stop_entry"
{
"match_entry" "music.sp_a2_crushed_gel_tbout"
}

Never done scripting before so much of the script went over my head, but I take it I need to change the tbout music next to "match_entry" to the music I want?

Thanks for the help!

Avatar
TeamSpen210
608 Posts
Posted Aug 26, 2013
Replied 20 minutes later
I don't understand soundscripts much either.
Probably what you should do is do a find/replace on "sp_a2_crushed_gel" to swap it with "sp_tmast_map" and set your background music to "music.sp_tmast_map". The "wave" sections are the ones to change to the actual music paths.
Avatar
Tmast98
210 Posts
Posted Aug 26, 2013
Replied 11 minutes later
One last question, for the "wave", if the sound is in mp3 form do I change this to "mp3"?
Avatar
TeamSpen210
608 Posts
Posted Aug 26, 2013
Replied 1 hour later
No, I don't even know if portal accepts mp3s.
Avatar
Tmast98
210 Posts
Posted Aug 26, 2013
Replied 32 minutes later
It does! I'll try getting this working again tomorrow. Thanks for the help though!
Avatar
Tmast98
210 Posts
Posted Aug 27, 2013
Replied 18 hours later
When experimenting with the map I found out that the funnel was changing the ambient generic's volume to 0. To resolve this I placed a timer that calls the ambient generic to set the volume to 10 every 3 seconds, as well as recalling itself.

I am pleased with this outcome, there is a small delay with the music starting up again after you exit the funnel (1-3 seconds) and the music will never play in the funnel, even if the volume is called to be 10 by the timer when you are in it, but these aren't nearly as bad as the constant quietness that would happen.

Thanks for the help everyone!

Avatar
greykarel
225 Posts
Posted Aug 31, 2013
Replied 4 days later
I'm a bit late on the topic, but resently Calmly Frenetic posting video for may map Bansai said he wished music had kept playing while player is in the funnel. So that prompts me to make a little research.
I had no problem to resume music on player leaving the funnel. All you need for this is to have your music to be properly looped .wav file (though it may lead to rather big file size) and have ambient_generic's flag is NOT looped checked.
I was experimenting with two different sound files: custom music and some Cave Johnson line from DLC 2 and found that while music becomes silent in funnel, Cave's voice still keeps its volume. So I placed my music file in *sound \ vo \ cavejohnson* path and it works without any scripts.
Avatar
josepezdj
2,386 Posts
Posted Oct 10, 2013
Replied 1 month later
..............and again........

OK, the thing is that I'm trying to make a door model swapping in mid-game via vscripting (the model the prop_testchamber_door uses, models/props/portal_door_combined.MDL, by a hexed one with different textures) and, even though it works out fine and I can see the desired door model in every prop_testchamber_door, the new model seems to have buggy animations: its animations have changed so when you fire the output "Open" it closes, and when you fire "Close" it opens >.<

Any thoughts? :biggrin:

Avatar
FelixGriffin
2,680 Posts
Posted Oct 10, 2013
Replied 53 minutes later
Perhaps check the order of your animations? Otherwise just use the outputs backwards. :razz:
Advertisement
Registered users don’t see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Oct 11, 2013
Replied 16 hours later

FelixGriffin wrote:
Perhaps check the order of your animations?

I don't get it, I'm using the same model than the entity uses, but with only a slight hexing, I didn't even decompile the model... This is the code into the FGD for the prop_testchamber_door entity:

@PointClass base(Targetname, Parentname, Angles) studio("models/props/portal_door_combined.mdl") = prop_testchamber_door :
"Test chamber door entity."
[
   lightingorigin(target_destination) : "Lighting Origin" : "" : "Select an info_lighting to specify a location to sample lighting from for all gibs spawned by this shooter, instead of their own origins."

   AreaPortalWindow(target_destination) : "Area Portal Window Name" : "" : "The name of an area portal window that is controlled by the door."
   UseAreaPortalFade(boolean) : "Fade Area Portal?" : 0 : "If the area portal should use the specified fade distances to fade out."
   AreaPortalFadeStart(float) : "Fade Start Distance" : 0 : "The distance at which the area portal starts fading out."
   AreaPortalFadeEnd(float) : "Fade End Distance" : 0 : "The distance at which the area portal turns completely opaque."

   input Open(void) : "Open the door and cause the portal to activate."
   input Close(void) : "Close the door and cause the portal to deactivate."
   input Lock(void) : "Locking a door will prevent the Open or Close inputs from doing anything."
   input Unlock(void) : "If locked, unocking a door will allow the Open or Close inputs to function."

   output OnOpen(void) : "Called when the door has started its open animation."
   output OnClose(void) : "Called when the door has started its close animation."
   output OnFullyOpen(void) : "Called when the door has finished its open animation."
   output OnFullyClosed(void) : "Called when the door has finished its close animation."
]

If I'm using the same model that the entity uses, why is this happening then? >.<