The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Script Help Sounds at entity
zulu52 Offline
Junior Member

Posts: 3
Threads: 2
Joined: Jun 2016
Reputation: 0
#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


Messages In This Thread
Sounds at entity - by zulu52 - 05-14-2017, 06:50 AM
RE: Sounds at entity - by FlawlessHappiness - 05-14-2017, 12:05 PM
RE: Sounds at entity - by Mudbill - 05-14-2017, 12:37 PM
RE: Sounds at entity - by zulu52 - 05-14-2017, 11:18 PM



Users browsing this thread: 1 Guest(s)