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
Bizarre Music Error
AGP Offline
Senior Member

Posts: 448
Threads: 45
Joined: Dec 2012
Reputation: 23
#1
Bizarre Music Error

This feels silly, because I'd gotten down how to add scripted music and all of a sudden this strange thing happens! The music is not playing at all and where the script area is for the music to start, a hand appears. 0.0

Maybe I'm just looking to hard to find what's wrong and need a second pair of eyes. I've been fighting this problem for a while now.

hps file:
void OnStart ()
{    
    {    
    AddEntityCollideCallback("Player", "hallking_area", "HallKing", true, -1);
    }    
}

void OnEnter()
{

}

void OnLeave()
{
    
}

void HallKing(string &in parent, string &in child, int state)
{
    PlaySoundAtEntity("HallKing", "hallking.snt", "hallking_area", 0.5, false);

snt file: (named hallking.snt)
<SOUNDENTITY>
    <SOUNDS>
        <Main>
            <Sound File="hallking.ogg" />
        </Main>
    </SOUNDS>

    <PROPERTIES Volume="5" MinDistance="1" MaxDistance="50" Random="0"
    Interval="0" FadeEnd="False" FadeStart="False" Stream="False"
    Loop="False" Use3D="false" Blockable="False" BlockVolumeMul="0.7"
    Priority="5" />
</SOUNDENTITY>

In the level editor, the script area is named hallking_area and it's callback listed as HallKing under the area tab.

02-03-2013, 02:04 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Bizarre Music Error

It should of been:

void OnStart ()

{     

    {    

    AddEntityCollideCallback("Player", "hallking_area", "HallKing", true, -1);

    }    

}


void HallKing(string &in parent, string &in child, int state)

{

    PlaySoundAtEntity("HallKing", "hallking.snt", "hallking_area", 0.5, false);
}

void OnEnter()

{



}



void OnLeave()

{

    

}
void OnLeave and void OnEnter should be on the end. (IDK as i'm new, teehee!)

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 02-03-2013, 02:31 AM by PutraenusAlivius.)
02-03-2013, 02:31 AM
Find
AGP Offline
Senior Member

Posts: 448
Threads: 45
Joined: Dec 2012
Reputation: 23
#3
RE: Bizarre Music Error

(02-03-2013, 02:31 AM)JustAnotherPlayer Wrote: It should of been:

void OnStart ()

{     

    {    

    AddEntityCollideCallback("Player", "hallking_area", "HallKing", true, -1);

    }    

}


void HallKing(string &in parent, string &in child, int state)

{

    PlaySoundAtEntity("HallKing", "hallking.snt", "hallking_area", 0.5, false);
}

void OnEnter()

{



}



void OnLeave()

{

    

}
void OnLeave and void OnEnter should be on the end. (IDK as i'm new, teehee!)

Changing the order doesn't really do much. On another map I made, the void func is listed after the OnEnter and OnLeave and those work fine.

02-03-2013, 02:35 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#4
RE: Bizarre Music Error

(Just Realized it...) You wanted to play music, right? It's supposed to be
PHP Code: (Select All)
PlayMusic() 
NOT
PHP Code: (Select All)
PlaySoundAtEntity 

"Veni, vidi, vici."
"I came, I saw, I conquered."
02-03-2013, 02:38 AM
Find
AGP Offline
Senior Member

Posts: 448
Threads: 45
Joined: Dec 2012
Reputation: 23
#5
RE: Bizarre Music Error

(02-03-2013, 02:38 AM)JustAnotherPlayer Wrote: (Just Realized it...) You wanted to play music, right? It's supposed to be
PHP Code: (Select All)
PlayMusic() 
NOT
PHP Code: (Select All)
PlaySoundAtEntity 

That's for just playing it in the background, right? I've used PlaySoundAtEntity for when the player reaches a certain area so it activates the sound at a specific moment, which is the goal.

02-03-2013, 02:40 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#6
RE: Bizarre Music Error

in the Script Area properties, you put HallKing in its callback? That's odd. If i were you, i never put anything in the callback part on Script Area properties.

"Veni, vidi, vici."
"I came, I saw, I conquered."
02-03-2013, 02:52 AM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#7
RE: Bizarre Music Error

You can make it so that when the player walks into a certain area, the music plays in the background.

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""hallking_area""HallKing"true1);
}

void HallKing(string &in parentstring &in childint state)
{
    
PlayMusic("hallking.ogg"true1.0f01true);


EDIT: The reason the hand shows up is because you probably have some text where it says PlayerInteractCallback in the area properties.

In Ruins [WIP]
(This post was last modified: 02-03-2013, 02:55 AM by NaxEla.)
02-03-2013, 02:54 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#8
RE: Bizarre Music Error

(02-03-2013, 02:54 AM)NaxEla Wrote: You can make it so that when the player walks into a certain area, the music plays in the background.

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""hallking_area""HallKing"true1);
}

void HallKing(string &in parentstring &in childint state)
{
    
PlayMusic("hallking.ogg"true1.0f01true);


EDIT: The reason the hand shows up is because you probably have some text where it says PlayerInteractCallback in the area properties.
Your answer is mine 1 post ago!

"Veni, vidi, vici."
"I came, I saw, I conquered."
02-03-2013, 03:00 AM
Find
AGP Offline
Senior Member

Posts: 448
Threads: 45
Joined: Dec 2012
Reputation: 23
#9
RE: Bizarre Music Error

(02-03-2013, 02:54 AM)NaxEla Wrote: You can make it so that when the player walks into a certain area, the music plays in the background.

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("Player""hallking_area""HallKing"true1);
}

void HallKing(string &in parentstring &in childint state)
{
    
PlayMusic("hallking.ogg"true1.0f01true);


EDIT: The reason the hand shows up is because you probably have some text where it says PlayerInteractCallback in the area properties.

Tried it and still nothing plays. The hand is gone after deleting the callback function from the properties tab. This is really stumping!

I've used the PlaySoundAtEntity before in other scripts and they work, but for some reason this one is just not having it.

02-03-2013, 03:21 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#10
RE: Bizarre Music Error

I think i found the problem.
It should have been:
PHP Code: (Select All)
PlaySoundAtEntity("Player""hallking.snt""hallking_area"0.5false); 
]
NOT
PHP Code: (Select All)
PlaySoundAtEntity("HallKing""hallking.snt""hallking_area"0.5false); 
Or if that didn't work, delete the void OnLeave and OnEnter. And wasn't it supposed to be 0.0, not 0.5?

"Veni, vidi, vici."
"I came, I saw, I conquered."
02-03-2013, 03:27 AM
Find




Users browsing this thread: 1 Guest(s)