05-14-2017, 06:50 AM
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.
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.