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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Sounds at entity
Author Message
zulu52 Offline
Junior Member

Posts: 3
Joined: Jun 2016
Reputation: 0
Post: #1
Sounds at entity

hello. It has been a while since I had used Suite, but with so much free time on my hands again, I thought I'd boot it back up - im enjoying it, but whats put me off from continuing is the zero scripts, so I thought I would try some simplistic things.


what im trying to achieve is a sound to play from an entity (namely a clock) - when the player walks up to it, it goes off - and it does, but its through the player, so even if I leave the proximity of the clock, the sound continues until it naturally stops. I have tried adding it to a couple objects - last one was a brick (which I hid behind the clock), which is down below, but no changes. either the sound plays via player, or it doesnt play at all.

surely I've made a dumb mistake somewhere, because I believe theres already a command to play sounds via player, and that is "PlayGuiSound".
-----------------------------------------

void OnStart()

{
PlayMusic("mansion.ogg", true, 0.8, 0, 10, true);
PreloadSound("clockscare.snt");
AddEntityCollideCallback("Player", "clockscarescript", "Sound", true, 1);
}



void Sound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("sound", "clockscare.snt", "brick_1", 0.1, false);
}

--------------------------------


I've barely got anything in there right now, but I'd like to sort out my problems before moving on, instead of putting it off and returning later.
05-14-2017 06:50 AM
Find all posts by this user Quote this message in a reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,961
Joined: Mar 2012
Reputation: 171
Post: #2
RE: Sounds at entity

It is possible that the clockscare.snt file does not use 3D sound, and thus just plays everywhere as long as you're in range.

I'm not sure what .snt you used to create clockscare.snt, but it is possible that you used a .snt file that does not use 3D sound.

[Image: zA46z3K.png]
05-14-2017 12:05 PM
Find all posts by this user Quote this message in a reply
Mudbill Offline
Posting Freak

Posts: 3,452
Joined: Apr 2013
Reputation: 163
Post: #3
RE: Sounds at entity

If you want 3D sound, your audio file must be using a mono channel, not stereo.

05-14-2017 12:37 PM
Find all posts by this user Quote this message in a reply
zulu52 Offline
Junior Member

Posts: 3
Joined: Jun 2016
Reputation: 0
Post: #4
RE: Sounds at entity

thank you guys so much for the help - it was the file not being specified as 3D. it was a custom sound I had edited via audacity, but I overlooked the extra options when creating the SNT file for it.
05-14-2017 11:18 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)