Need help with scripting.......again! Issue Semi-Resolved
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!
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.
Thanks for the advice though!
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!
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.
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!
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.
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? 
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? >.<