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
Script Help No sound playing in script area
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#19
RE: No sound playing in script area

Let's start from the top.

You have a void OnStart()

In that, you are specifying what functions you want to create, such as.

PHP Code: (Select All)
AddEntityCollideCallback("Player""Ljud""start"true1); 

Right here you are saying a lot of things.

You want the Parent object to be the "Player".
You want the Child object (the object the parrent collides with) to be "Ljud".
You want your function to be named "start".
You want it to only happen once by setting "true".
And you make it happen, only when you enter the Child ("Ljud") by using 1.

That is all the information the script needs, and that's what you gave it.

Now you said that you want the function to be named "start", but where is it?
Correct, it's nowhere, because you haven't created it yet.

So how do we do that?
Like this:

PHP Code: (Select All)
void FunctionName(parameters

The FunctionName is the name of the function. In our case, it's "start".
The parameters are special parameters that the script needs, to understand what kind of function it is.
The function we are using right now is a Collide function.

A collide function needs 3 parameters.
(string &in asParent, string &in asChild, int alState)

To understand what all these does, please read this:
http://www.frictionalgames.com/forum/thread-18368.html


Now that we know all the things we need, we can create the function.

PHP Code: (Select All)
void start(string &in asParentstring &in asChildint alState

All you need to do now is fill in something inside the function. Fx. play a sound.

PHP Code: (Select All)
void start(string &in asParentstring &in asChildint alState)
{
PlaySoundAtEntity("""25_strain_wood.snt""Player"0.0ffalse);


Trying is the first step to success.
10-08-2014, 01:11 PM
Find


Messages In This Thread
No sound playing in script area - by LDOriginal - 10-07-2014, 07:03 PM
RE: No sound playing in script area - by Neelke - 10-07-2014, 07:43 PM
RE: No sound playing in script area - by Neelke - 10-07-2014, 07:59 PM
RE: No sound playing in script area - by Neelke - 10-07-2014, 08:10 PM
RE: No sound playing in script area - by FlawlessHappiness - 10-08-2014, 01:11 PM



Users browsing this thread: 2 Guest(s)