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
PlayMusicAtEntity
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#1
PlayMusicAtEntity

what is wrong with this code?


void area_scare_5(string &in asParent, string &in asChild, int alState)
{
PlayMusicAtEntity(string& scare_tingeling.snt, bool Loop, float 7, float 3, int 1, bool true);
}

im sorry to made you notice this again, but i really need help :/

When you are looking for someone, to do the scripting for your Custom Story, ask me!
(This post was last modified: 11-12-2012, 06:56 PM by tonitoni1998.)
11-12-2012, 06:33 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: PlayMusicAtEntity

void area_scare_5(string &in asParent, string &in asChild, int alState)
{
PlayMusicAtEntity(scare_tingeling.snt, false, 7, 3, 1, true);
}


Those words weren't necessary, Toni XD they are for sintaxes and structures.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
11-12-2012, 07:46 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#3
RE: PlayMusicAtEntity

There is nothing called PlayMusicAtEntity.
It's PlaySoundAtEntity

Trying is the first step to success.
11-12-2012, 07:49 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#4
RE: PlayMusicAtEntity

"PlayMusicAtEntity" is not a function. You need to make a .snt file for the .ogg and use "PlaySoundAtEntity". Good luck!

I rate it 3 memes.
11-12-2012, 07:49 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#5
RE: PlayMusicAtEntity

(11-12-2012, 07:49 PM)beecake Wrote: There is nothing called PlayMusicAtEntity.
It's PlaySoundAtEntity
How could I... please someone facepalm me.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
11-12-2012, 08:18 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#6
RE: PlayMusicAtEntity

thanks to you guys.

how can i make this loop:
void area_scare_5(string &in asParent, string &in asChild, int alState)

{
PlaySoundAtEntity ("", "scare_whine_loop3.snt", "Player", 0, true);
}

When you are looking for someone, to do the scripting for your Custom Story, ask me!
11-13-2012, 02:54 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#7
RE: PlayMusicAtEntity

What kind of loop? The sound you are using is already looping isn't it? If it isn't then:

void area_scare_5(string &in asParent, string &in asChild, int alState)
{
AddTimer("LoopSound", 0, "LoopTimer");
}



void LoopSound(string &in asTimer)
{
if(asTimer == "LoopSound")
{
PlaySoundAtEntity ("", "scare_whine_loop3.snt", "Player", 0, true);

AddTimer("LoopSound", 5, "LoopTimer");

)
}

Trying is the first step to success.
11-13-2012, 03:07 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#8
RE: PlayMusicAtEntity

(11-13-2012, 03:07 PM)beecake Wrote: What kind of loop? The sound you are using is already looping isn't it? If it isn't then:

void area_scare_5(string &in asParent, string &in asChild, int alState)
{
AddTimer("LoopSound", 0, "LoopTimer");
}



void LoopSound(string &in asTimer)
{
if(asTimer == "LoopSound")
{
PlaySoundAtEntity ("", "scare_whine_loop3.snt", "Player", 0, true);

AddTimer("LoopSound", 5, "LoopTimer");

)
}
thank you. well yes "whine_loop" sounds like a loop to me too, but its not looping :/ but now it is Big Grin

if you could help me once again... Tongue i dont understand the wiki script examples... i tried to fade in a sound:

void area_scare_1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, true);
PlaySoundAtEntity("", "break_glass_large.snt", "Player", 0, true);
FadeInSound ("", "ui_torture.snt", "Player", 0, true);
GiveSanityDamage(90.0f, true);
}

i know this is very wrong, because i dont understand what all this "string&" "float" "bool" is. the only thing i did in java is a hello world, thats wh i dont really get all this stuff
this is what the wiki says:
void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart);

When you are looking for someone, to do the scripting for your Custom Story, ask me!
(This post was last modified: 11-13-2012, 03:25 PM by tonitoni1998.)
11-13-2012, 03:18 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#9
RE: PlayMusicAtEntity

i should tell you how to stop it too... If you have this sound playing all through your game it will be very annoying!
This is how the script should look:


void LoopSound(string &in asTimer)
{
if(asTimer == "LoopSound")
{
if(GetLocalVarInt("StopLoopSound") == 1)
{
return;
}
PlaySoundAtEntity ("", "scare_whine_loop3.snt", "Player", 0, true);
AddTimer("LoopSound", 5, "LoopTimer");
}
}


Then if you want to stop the loop you just make a script that calls: SetLocalVarInt("StopLookSound", 1);



For the fade in sound:

This line can fade in sounds: PlaySoundAtEntity("", "break_glass_large.snt", "Player", 0, true);

The 0 determines how many seconds it should fade, until it has reached full volume

string = Letters
float = Numbers
bool = True or false

You might want to see this too: http://www.frictionalgames.com/forum/thread-18368.html

Trying is the first step to success.
(This post was last modified: 11-13-2012, 03:33 PM by FlawlessHappiness.)
11-13-2012, 03:27 PM
Find
tonitoni1998 Offline
Member

Posts: 163
Threads: 54
Joined: Oct 2012
Reputation: 1
#10
RE: PlayMusicAtEntity

THANK YOU. you really helped me Big Grin i will try to get my answers by myself in future Wink

When you are looking for someone, to do the scripting for your Custom Story, ask me!
11-13-2012, 04:08 PM
Find




Users browsing this thread: 1 Guest(s)