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
Music OnStart?
srobb Offline
Junior Member

Posts: 24
Threads: 4
Joined: Sep 2012
Reputation: 0
#1
Music OnStart?

How do I get music to play as soon as the player enters the map? It's just ambient music, nothing special.
10-01-2012, 09:34 AM
Find
TeamSD Offline
Member

Posts: 51
Threads: 3
Joined: Apr 2012
Reputation: 2
#2
RE: Music OnStart?

(10-01-2012, 09:34 AM)srobb Wrote: How do I get music to play as soon as the player enters the map? It's just ambient music, nothing special.
void OnEnter()
{
PlayMusic("track_you_want_to_play.ogg", true, 2, 2, 0, true);
}

10-01-2012, 09:47 AM
Find
srobb Offline
Junior Member

Posts: 24
Threads: 4
Joined: Sep 2012
Reputation: 0
#3
RE: Music OnStart?

main (8, 1) : ERR : Unexpected token '{'
Line 8 is just '{'.


void OnEnter()
{
PlayMusic("29_amb.ogg", true, 2, 2, 0, true);
}
10-01-2012, 10:11 AM
Find
TeamSD Offline
Member

Posts: 51
Threads: 3
Joined: Apr 2012
Reputation: 2
#4
RE: Music OnStart?

(10-01-2012, 10:11 AM)srobb Wrote: main (8, 1) : ERR : Unexpected token '{'
Line 8 is just '{'.


void OnEnter()
{
PlayMusic("29_amb.ogg", true, 2, 2, 0, true);
}
Could you show me your whole script.

10-01-2012, 10:40 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#5
RE: Music OnStart?

void OnStart()
{

}

void OnEnter()
{
PlayMusic("29_amb.ogg", true, 2, 2, 0, true);
}

void OnLeave()
{


}

This should make no problem at all... It must've been something your script

Trying is the first step to success.
(This post was last modified: 10-01-2012, 10:42 AM by FlawlessHappiness.)
10-01-2012, 10:41 AM
Find
srobb Offline
Junior Member

Posts: 24
Threads: 4
Joined: Sep 2012
Reputation: 0
#6
RE: Music OnStart?

////Onstartmap

void OnStart()
{

}

void OnEnter()
{
PlayMusic("29_amb.ogg", true, 2, 2, 0, true);
}

Still won't work. It says "main (13, 1) : ERR: Unexpected token '{'.
Line 13 is just a {. I don't get what I've done wrong? Everything was working fine until I put the PlayMusic script in.
10-01-2012, 11:31 AM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#7
RE: Music OnStart?

Can you post the whole script, please?

"What you think is irrelevant" - A character of our time

A Christmas Hunt
10-01-2012, 11:48 AM
Find
srobb Offline
Junior Member

Posts: 24
Threads: 4
Joined: Sep 2012
Reputation: 0
#8
RE: Music OnStart?

Nevermind, I got it working.
Thanks Smile
10-01-2012, 11:51 AM
Find




Users browsing this thread: 1 Guest(s)