Frictional Games Forum (read-only)

Full Version: sound script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
void CollideRoomThree(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("Sound_22", "break_stairs.snt", true, "", "");
}



How do i get this to work? above is what i have for it but i have no idea what to put in.

Edit: I get error as - no matching signatures to 'PlaySoundAtEntity .......' .
That is exactly how I did it... but when I put it in my script, the sound din't play for some reason. I hope someone else can give the answer. Sad
Read this thread:
http://www.frictionalgames.com/forum/thread-4865.html?

It explains how to use PlaySoundAtEntity really good Smile

Also, this explains what should be in PlaySoundAtEntity:
Code:
PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);

If abSaveSound = true the sound is never attached to the entity! Also note that saving should on be used on looping sounds!
Thanks it now works. But i just realised that i have another problem...


<CATEGORY Name="Journal">
<Entry Name="Note_MYNOTE_Name"> Diary 1</Entry>
<Entry Name="Note_MYNOTE_Text">Day 42 - I am beginning to lose it. I feel like i have been trapped here forever. I see things i shouldnt. I'm going to do something i may regret but its my only hope.</Entry>
</CATEGORY>


This is supposed to work for a note i have, i put down the note object and called it 'MYNOTE', what have i missed?

I also added this into the callfunc part - EntityCallPickNote
You're not supposed to name the note MYNOTE but instead change the NoteText field to say MYNOTE.

There's no need to use a callback either if you just want a normal note.
(10-12-2010, 11:01 PM)nofsky Wrote: [ -> ]You're not supposed to name the note MYNOTE but instead change the NoteText field to say MYNOTE.

There's no need to use a callback either if you just want a normal note.

Yeah i forgot to add that in too, i named it MYNOTE also in the NoteText field. When i pick the note up it has no name and no text, when i try to find it once its picked up its invisible also. Do i put anythign into the .hps file? If so what?
(10-12-2010, 10:55 PM)LoneWolf Wrote: [ -> ]Thanks it now works. But i just realised that i have another problem...


<CATEGORY Name="Journal">
<Entry Name="Note_MYNOTE_Name"> Diary 1</Entry>
<Entry Name="Note_MYNOTE_Text">Day 42 - I am beginning to lose it. I feel like i have been trapped here forever. I see things i shouldnt. I'm going to do something i may regret but its my only hope.</Entry>
</CATEGORY>


This is supposed to work for a note i have, i put down the note object and called it 'MYNOTE', what have i missed?

I also added this into the callfunc part - EntityCallPickNote

You are not really supposed to have "EntityCallPickNote" if you want the player to pick it up. Just go in the editor to "Entities/Item/note_generic"

There are also other different looking notes like "note_letter", "note_manual", "note_paper01", and "note_scroll". Once you placed the note you want, you select it with your mouse. Then go to the "Entity" tab and then near the bottom is "NoteText". So then put in "MYNOTE" which you had in the scripts above. Then when you click on the note while playing, you can read it.
I found the problem. In a tutorial a guy said to use the note_generic letter. That is totally wrong as it shows nothign on screen, i used the Note_Letter and now it works perfectly. Thanks for the help guys.
Now all i need is the script and an example for text appearing when interacting with objects, eg. locked door.
LoneWolf, sometimes you don't always get everything you wanted...

Lol, I don't know. But I do know some weird way to set up text for a locked level door.
Pages: 1 2