Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 12-06-2007, 08:09 PM   #1
Ihmhi
[AE] 0112 Ihmhi *SJB
Wiki Team
Fortress Forever Staff
 
Ihmhi's Avatar
 
Join Date: Mar 2007
Location: Newark, NJ, United States
Class/Position: A little bit o' everythin'
Gametype: Also a little bit o' everythin'
Affiliations: [AE] Asseater, *SJB Straight Jacket Brigade
Posts Rated Helpful 3 Times
Send a message via AIM to Ihmhi Send a message via MSN to Ihmhi Send a message via Yahoo to Ihmhi
Custom Sound In Map?

I have been tooling around with Hammer for a while, but there is something I can just not figure out - how do I implement a custom sound in my map?

Specifically, I want the sound to be broadcast from a point - i.e., I would place a speaker in a map and then the sound would eminate from the script attached to it.

I have got it to work by editing FF files (i.e. adding "lol.wav" to the same scripts that "unagi.wav" is in), but if I ever wanted to distribute a map I could not do that - if FF ever updated, then it would overwrite my changes and then they would have to redownload my map. As such, I would have to have everything work from completely new files and not by editing already existing files.

Can anyone help? (|:
__________________
Support FF:
Anime: The Thread: Reloaded
The one and only anime thread on these here forums.

Select the pistol, and then, select your horse.
Ihmhi is offline   Reply With Quote


Old 12-06-2007, 08:39 PM   #2
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
Using an ambient_generic and calling OutputEvent from the lua should do the trick. I couldn't get any custom sounds to play using only lua either. I guess it has something to do with precaching.
A1win is offline   Reply With Quote


Old 12-06-2007, 09:37 PM   #3
public_slots_free
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
I did exactly what you said A1win in my latest map.
public_slots_free is offline   Reply With Quote


Old 12-06-2007, 10:24 PM   #4
Ihmhi
[AE] 0112 Ihmhi *SJB
Wiki Team
Fortress Forever Staff
 
Ihmhi's Avatar
 
Join Date: Mar 2007
Location: Newark, NJ, United States
Class/Position: A little bit o' everythin'
Gametype: Also a little bit o' everythin'
Affiliations: [AE] Asseater, *SJB Straight Jacket Brigade
Posts Rated Helpful 3 Times
Send a message via AIM to Ihmhi Send a message via MSN to Ihmhi Send a message via Yahoo to Ihmhi
Quote:
Originally Posted by A1win
Using an ambient_generic and calling OutputEvent from the lua should do the trick. I couldn't get any custom sounds to play using only lua either. I guess it has something to do with precaching.
Yeah, I think something is wrong. I precached the sound after creating my own files, but Source still said that it was not precached.

How would I use ambient_generic with a custom sound, though? I have not messed around with that particular feature of Hammer as of yet.
__________________
Support FF:
Anime: The Thread: Reloaded
The one and only anime thread on these here forums.

Select the pistol, and then, select your horse.
Ihmhi is offline   Reply With Quote


Old 12-06-2007, 10:29 PM   #5
public_slots_free
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Which part do you need help with? Using a custom sound or using ambient generic? Or triggering the generic with LUA?
public_slots_free is offline   Reply With Quote


Old 12-06-2007, 11:29 PM   #6
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
  • Put the customsound.wav in FortressForever\sound\yourmapname\ folder
  • Set the ambient_generic's sound name key to "yourmapname/customsound.wav"
  • Give the ambient_generic a name, "sound1" for example.
  • Use the following lua command to play the sound: OutputEvent("sound1","PlaySound")
Also check http://developer.valvesoftware.com/wiki/Ambient_generic
A1win is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:31 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.