Adding a Music Cue with Mappadds ?

Obsidian General.
fustrun
prop_static
prop_static
Posts: 92
Joined: Fri Sep 11, 2009 8:23 am

Adding a Music Cue with Mappadds ?

Post by fustrun »

So i was toying with mapadds and i have to say it's amazing ! thank you so much for puting it in !
So is there anyway to add A .WAV cue through map adds ? just a trigger to play a WAV sound of my choise . . and maybe remove the HL music ?
Thank you for this wonderfull mod !
User avatar
Neico
Lead Coder
Lead Coder
Posts: 1799
Joined: Tue Aug 15, 2006 3:39 pm
Location: Germany
Contact:

Re: Adding a Music Cue with Mappadds ?

Post by Neico »

modify or add an ambient_generic entity ;)
Image
fustrun
prop_static
prop_static
Posts: 92
Joined: Fri Sep 11, 2009 8:23 am

Re: Adding a Music Cue with Mappadds ?

Post by fustrun »

Thanks :)
Could you please give me a "coded" example ?
like

"Ambient_generic"
{
sound\Music.wav
}

So i'm sure i'm doing it properly.
User avatar
Neico
Lead Coder
Lead Coder
Posts: 1799
Joined: Tue Aug 15, 2006 3:39 pm
Location: Germany
Contact:

Re: Adding a Music Cue with Mappadds ?

Post by Neico »

This Modifys ANY ambient_generic in a Map to use mysound.wav instead of the one that was specified in the map, see http://wiki.obsidianconflict.net/?title=Mapadd_Scripts for more details in how to modify this code to fit your needs

Code: Select all

map
{
	Modify
	{
		ClassName
		{
			"ambient_generic"
			{
				"message"	"mysound.wav"
			}
		}
	}
}
Image
fustrun
prop_static
prop_static
Posts: 92
Joined: Fri Sep 11, 2009 8:23 am

Re: Adding a Music Cue with Mappadds ?

Post by fustrun »

In d1_canals_01 for example you have two music cues playing, a dark one where you enter the coridor where the combine beat someone up and another when you go down to the train rails and they throw a burning barreil down the stairs, so if i "modify" which one of those will it replace, or generally all music cues in the level ? and if i want to add rather then modify ?
I've visited the link a hunderd times and learned alot :) and i'm quite fammiliar with it allready i just didn't see anything about music cues.
Thank you again :)
fustrun
prop_static
prop_static
Posts: 92
Joined: Fri Sep 11, 2009 8:23 am

Re: Adding a Music Cue with Mappadds ?

Post by fustrun »

How do i open the .bsp maps ? to see entitey's names i want to change ? including music,
Also it dosent work, i got this

Code: Select all

Attempted to create unknown entity type ClassName!
MapEntity_ParseEntitiesFromTxtFile: Can't init ClassName
and this is what i wrote in the mapadd

Code: Select all

	ClassName
        {
         	"ambient_generic"
         	{
            	"message"   "sound\music\mod\d1_trainstation-a.wav"
		"origin"    "-5077 -1982 32"
         	}
        }

User avatar
Neico
Lead Coder
Lead Coder
Posts: 1799
Joined: Tue Aug 15, 2006 3:39 pm
Location: Germany
Contact:

Re: Adding a Music Cue with Mappadds ?

Post by Neico »

that is hopefully not everything in that file, esle you did it totally wrong...

also, you can open bsp files with GCFScape and extract the .ent file or decompile the map (if not protected) with VMEX to get the vmf file to look into the map via Hammer
Image
fustrun
prop_static
prop_static
Posts: 92
Joined: Fri Sep 11, 2009 8:23 am

Re: Adding a Music Cue with Mappadds ?

Post by fustrun »

No of course it's not all the file, i'll include the whole file for your review

Code: Select all

d1_trainstation_01
{
    Remove
    {
        ClassName
        {
            "info_player_start" {}
        }
        TargetName
        {
            "barney_door_close_trigger" {}
            "razortrain_gate_cop_2" {}
            "cage_playerclip" {}
            "barney_room_blocker" {}
            "trigger_cop_close_door_1" {}
            "trigger_barney_close_exitdoor" {}
            "barney_room_blocker_2" {}
            "train_door_2_counter" {}
            "logic_kill_citizens" {}
        }
        Origin
        {
            "-14112 -13824 -1140" {}
        }
    }
    Add
    {
	classname
	{
		"ambient_generic"
         	{
            	"message"   "music\mod\d1_trainstation-a.wav"
	    	"origin"    "-5077 -1982 32"
         	}
	}

        "logic_auto"
        {
            "spawnflags" "1"
            "OnMapSpawn" "logic_start_train,Trigger,,0,-1"
            "origin" "-9608.78 -2414.19 51.1139"
        }
        "info_player_deathmatch"
        {
            "angles" "0 0 0"
            "targetname" "trainstation_01_spawn1"
            "origin" "-5853 -1962.81 -31"
        }
        "info_player_deathmatch"
        {
            "angles" "0 0 0"
            "targetname" "trainstation_01_spawn1"
            "origin" "-5853 -2053 -31"
        }
        "info_player_deathmatch"
        {
            "angles" "0 0 0"
            "targetname" "trainstation_01_spawn1"
            "origin" "-5853 -2143 -31"
        }
        "info_player_deathmatch"
        {
            "angles" "0 90 0"
            "targetname" "trainstation_01_spawn1"
            "origin" "-5671 -2144 -31"
        }
        "info_player_deathmatch"
        {
            "angles" "0 270 0"
            "targetname" "trainstation_01_spawn1"
            "origin" "-5671 -1964 -31"
        }
        "info_player_deathmatch"
        {
            "angles" "0 90 0"
            "targetname" "trainstation_01_spawn1"
            "origin" "-5557 -2144 -31"
        }
        "point_trigger"
        {
            "spawnflags" "1"
            "StartDisabled" "1"
            "targetname" "barney_door_close_trigger"
            "TriggerOnce" "1"
            "TriggerRadius" "293"
            "OnStartTouch" "lcs_breakroom_pacer_arms,Resume,,0,-1"
            "OnStartTouch" "weapon_point_2,Cancel,,0,-1"
            "OnStartTouch" "lcs_cop_introom_preIdle,Start,,0,-1"
            "OnStartTouch" "conditions_introom_look,Enable,,0,-1"
            "OnStartTouch" "camera_tv_breen,SetOff,,0,-1"
            "OnStartTouch" "kleiner_security_camera_1,SetOnAndTurnOthersOff,,0,-1"
            "OnStartTouch" "lcs_tv_breencast,Kill,,0,-1"
            "OnStartTouch" "ss_citizen_introom_chair,BeginSequence,,0,-1"
            "OnStartTouch" "introom_door_2_slot,SetAnimation,open,0,-1"
            "OnStartTouch" "introom_door_cop_1,StartScripting,,0,-1"
            "OnStartTouch" "weapon_point_1,Cancel,,0,-1"
            "origin" "-3684 -514 28"
        }
    }
    Modify
    {
        ClassName
        {
            "worldspawn"
            {
                "disableareaportals" "1"
            }
            "trigger_changelevel"
            {
                "spawngroup" "trainstation_02_spawn1"
                "transitionradius" "91"
            }
        }
        TargetName
        {
            "customs_template"
            {
                "OnEntitySpawned" "razortrain_gate_cop_2,Kill,,1,-1"
            }
        }
    }
SpawnItems
{
    "weapon_healer" "1"
}
}
i added it under "add" and not "modify" though, i really appreciate your help !
I've been cracking on it for a few days now and can't get it to work.
User avatar
Neico
Lead Coder
Lead Coder
Posts: 1799
Joined: Tue Aug 15, 2006 3:39 pm
Location: Germany
Contact:

Re: Adding a Music Cue with Mappadds ?

Post by Neico »

Well, I'll give you a hint: always make the syntax right and you'll notice the problem, maybe you're now able to see what's wrong, just compare your lines with the rest

Code: Select all

Add
	{
		classname
		{
			"ambient_generic"
			{
				"message"   "music\mod\d1_trainstation-a.wav"
				"origin"    "-5077 -1982 32"
			}
		}

		"logic_auto"
		{
			"spawnflags" "1"
			"OnMapSpawn" "logic_start_train,Trigger,,0,-1"
			"origin" "-9608.78 -2414.19 51.1139"
		}

		"info_player_deathmatch"
		{
			"angles" "0 0 0"
			"targetname" "trainstation_01_spawn1"
			"origin" "-5853 -1962.81 -31"
		}

		"info_player_deathmatch"
		{
			"angles" "0 0 0"
			"targetname" "trainstation_01_spawn1"
			"origin" "-5853 -2053 -31"
		}

		"info_player_deathmatch"
		{
			"angles" "0 0 0"
			"targetname" "trainstation_01_spawn1"
			"origin" "-5853 -2143 -31"
		}

		"info_player_deathmatch"
		{
			"angles" "0 90 0"
			"targetname" "trainstation_01_spawn1"
			"origin" "-5671 -2144 -31"
		}

		"info_player_deathmatch"
		{
			"angles" "0 270 0"
			"targetname" "trainstation_01_spawn1"
			"origin" "-5671 -1964 -31"
		}

		"info_player_deathmatch"
		{
			"angles" "0 90 0"
			"targetname" "trainstation_01_spawn1"
			"origin" "-5557 -2144 -31"
		}

		"point_trigger"
		{
			"spawnflags" "1"
			"StartDisabled" "1"
			"targetname" "barney_door_close_trigger"
			"TriggerOnce" "1"
			"TriggerRadius" "293"
			"OnStartTouch" "lcs_breakroom_pacer_arms,Resume,,0,-1"
			"OnStartTouch" "weapon_point_2,Cancel,,0,-1"
			"OnStartTouch" "lcs_cop_introom_preIdle,Start,,0,-1"
			"OnStartTouch" "conditions_introom_look,Enable,,0,-1"
			"OnStartTouch" "camera_tv_breen,SetOff,,0,-1"
			"OnStartTouch" "kleiner_security_camera_1,SetOnAndTurnOthersOff,,0,-1"
			"OnStartTouch" "lcs_tv_breencast,Kill,,0,-1"
			"OnStartTouch" "ss_citizen_introom_chair,BeginSequence,,0,-1"
			"OnStartTouch" "introom_door_2_slot,SetAnimation,open,0,-1"
			"OnStartTouch" "introom_door_cop_1,StartScripting,,0,-1"
			"OnStartTouch" "weapon_point_1,Cancel,,0,-1"
			"origin" "-3684 -514 28"
		}
	}
Add doesn't use classname targetname or origin, that's something only remove and modify use (but you should know that if you read the mapadd example on the wiki site)
Image
fustrun
prop_static
prop_static
Posts: 92
Joined: Fri Sep 11, 2009 8:23 am

Re: Adding a Music Cue with Mappadds ?

Post by fustrun »

Damn i can't belive i fell for that one, i just acted with understanding that "add" is used to add non-existing emmiters and triggers, and i thought "modify" used to edit existing ones only, well i sorted it out but when i try to trigger the thing it just spams this in the console

Code: Select all


EmitAmbientSound:  sound note precached: sound\music\mod\d1_trainstation-a.wav
EmitAmbientSound:  sound note precached: sound\music\mod\d1_trainstation-a.wav
EmitAmbientSound:  sound note precached: sound\music\mod\d1_trainstation-a.wav

I checked the path and files and everything seems to be in order, maybe i need to precach the sound file in some obsidian sound preloading script ? like with the cs_weapon_sounds.txt ?
fustrun
prop_static
prop_static
Posts: 92
Joined: Fri Sep 11, 2009 8:23 am

Re: Adding a Music Cue with Mappadds ?

Post by fustrun »

Anyone ? Please i really want to sort it out.
xenoaisam
prop_physics
prop_physics
Posts: 158
Joined: Sat Aug 28, 2010 8:31 pm
Location: Combine Citadel
Contact:

Re: Adding a Music Cue with Mappadds ?

Post by xenoaisam »

fustrun... do you work with ut2004 before? i think i had same name who work on our Banzai mod long ago...

or this remind something: http://z13.invisionfree.com/BanzaiHQ/in ... owtopic=64
ImageImageImageImage
~My Beauty and The Beast~
fustrun
prop_static
prop_static
Posts: 92
Joined: Fri Sep 11, 2009 8:23 am

Re: Adding a Music Cue with Mappadds ?

Post by fustrun »

MaestraFénix
Team Member
Team Member
Posts: 2470
Joined: Mon May 10, 2010 11:50 am
Location: Spain
Contact:

Re: Adding a Music Cue with Mappadds ?

Post by MaestraFénix »

fustrun wrote:Yes it's me :) the composer !
http://www.youtube.com/user/NirShor?feature=mhum
The past is not dead. Never is it :D

That reminds that someday i´ll back to CSS (or by default, CS2).
Click on my photo to add me into your friends in Steam
Image
Steam photos | Steam videos

Image
fustrun
prop_static
prop_static
Posts: 92
Joined: Fri Sep 11, 2009 8:23 am

Re: Adding a Music Cue with Mappadds ?

Post by fustrun »

I guess it doesn't, i actually thought contributing a track to the obsidian conflict menu, i can make another shot at the "Tirage at Dawn" and add another varation of mine to the mix or create something new for for obsidian, havent talked to the developers though ,since i don't know if they'd be intrested.
Post Reply