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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 1 Votes - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sound script
Author Message
LoneWolf Offline
Senior Member

Posts: 305
Joined: Sep 2010
Reputation: 0
Post: #1
sound script
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 .......' .
10-12-2010 09:20 PM
Find all posts by this user Quote this message in a reply
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #2
RE: sound script
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

10-12-2010 09:43 PM
Find all posts by this user Quote this message in a reply
Stangi Offline
Junior Member

Posts: 20
Joined: Oct 2010
Reputation: 0
Post: #3
RE: sound script
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:
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!
10-12-2010 10:37 PM
Find all posts by this user Quote this message in a reply
LoneWolf Offline
Senior Member

Posts: 305
Joined: Sep 2010
Reputation: 0
Post: #4
RE: sound script
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
10-12-2010 10:55 PM
Find all posts by this user Quote this message in a reply
nofsky Offline
Senior Member

Posts: 421
Joined: Sep 2008
Reputation: 1
Post: #5
RE: sound script
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
Find all posts by this user Quote this message in a reply
LoneWolf Offline
Senior Member

Posts: 305
Joined: Sep 2010
Reputation: 0
Post: #6
RE: sound script
(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 11:05 PM
Find all posts by this user Quote this message in a reply
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #7
RE: sound script
(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.

10-12-2010 11:17 PM
Find all posts by this user Quote this message in a reply
LoneWolf Offline
Senior Member

Posts: 305
Joined: Sep 2010
Reputation: 0
Post: #8
RE: sound script
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.
10-12-2010 11:29 PM
Find all posts by this user Quote this message in a reply
LoneWolf Offline
Senior Member

Posts: 305
Joined: Sep 2010
Reputation: 0
Post: #9
RE: sound script
Now all i need is the script and an example for text appearing when interacting with objects, eg. locked door.
10-13-2010 12:34 AM
Find all posts by this user Quote this message in a reply
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #10
RE: sound script
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.

10-13-2010 02:31 AM
Find all posts by this user Quote this message in a reply
Post Reply 




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