Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding a Sound Triggered by an Area
Samuelblitz Offline
Junior Member

Posts: 16
Threads: 4
Joined: Feb 2011
Reputation: 0
#10
RE: Adding a Sound Triggered by an Area

(03-02-2011, 09:45 PM)Nye Wrote:
(03-02-2011, 09:37 PM)Samuelblitz Wrote:
(03-02-2011, 08:17 AM)Russ Money Wrote:
Quote:enabled.snt is one of the grunt's sound files and i tried the fade at 0.0f but still no sound in-game,

just out of curiosity, is this a common problem? or is it just my game specifically?

Most likely just a coding or some small detail we're overlooking. Just for testing sake, try this instead.


PlaySoundAtEntity("", "enabled.snt", "Player", 0.0f, false);

It'll play directly on the player, letting them hear it regardless. If it doesn't play, it's .snt file. Which alternatively, you can try a different .snt and test that.

Ahh, that worked perfectly! Thank you very much.

However are there any disadvantages to playing the sound directly from "Player"? Because i was planning to have quite a few triggered sounds and i might end up having to use this method for all of them.

The issue here, which I found out the hard way, you CANNOT play sounds from entities. As silly as it sounds, there are a few exceptions, like the player. And don't stick to the partial solution, since you might as well play a GuiSound if you want to play a sound from the player.

The solution is to create a script area and play the sound from that script area.

Sleepy

Really? That sounds perfect, thanks for your help too Nye, i'll reply again if there are any more problems Smile

i actually have a few more questions about editing that i would be grateful for your help on, and i don't think i want to spam this board with more help threads:

- I'm trying to set it so when i interact with a locked door WITHOUT the key in my inventory, text will appear on screen telling me that i need to find the key. However i also want a quest to be added at the same time.

The problems i'm having are that no text pops up in-game, BUT it does show the little memento icon in the corner, however when i check that quest, the the text just says " - " like it's missing text...

this is my .hps:

"void TouchLockedDoor(string &in asEntity)

{
if(HasItem("Storage_Room_Key")) SetMessage("Hints", "HaveKeyLockedDoor1", 6.0f);
else AddQuest("Quests", "QuestLockedDoor1");
SetMessage("Hints", "LockedDoor1", 6.0f);


}"


and this is my extra_english.lang:

"<LANGUAGE>

<CATEGORY Name="Hints">
<Entry Name="LockedDoor1"> The door is locked sturdily.</Entry>
<Entry Name="LockedCrowBarDoor1"> The door is locked with an old, weak lock.</Entry>
<Entry Name="HaveKeyLockedDoor1"> You need to use the key on the door to unlock it.</Entry>
<Entry Name="HaveCrowBarCrowBarDoor1"> You need to use the crowbar on the door to break the lock.<Entry>

</CATEGORY>
<CATEGORY Name="Quests">
<Entry Name="QuestLockedDoor1"> I need to find the key for the Storage Door.</Entry>
<Entry Name="QuestCrowBarDoor1"> I need to find a way to break the lock.</Entry>

</LANGUAGE>"

in-case your wondering, the "HaveKeyLockedDoor1" should just display a message telling you that you need to drag the key to the door.

thanks for your help! Smile
03-03-2011, 12:09 AM
Find


Messages In This Thread
RE: Adding a Sound Triggered by an Area - by Nye - 03-02-2011, 09:45 PM
RE: Adding a Sound Triggered by an Area - by Samuelblitz - 03-03-2011, 12:09 AM



Users browsing this thread: 3 Guest(s)