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


Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sound script
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#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
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#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
Stangi Offline
Junior Member

Posts: 25
Threads: 3
Joined: Oct 2010
Reputation: 0
#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
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#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
nofsky Offline
Senior Member

Posts: 423
Threads: 13
Joined: Sep 2008
Reputation: 1
#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
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#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
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#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
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#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
LoneWolf Offline
Senior Member

Posts: 308
Threads: 43
Joined: Sep 2010
Reputation: 0
#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
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#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




Users browsing this thread: 1 Guest(s)