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 Own music
Calypse1 Offline
Junior Member

Posts: 7
Threads: 3
Joined: Jan 2012
Reputation: 0
#1
Own music

hello I am trying to get my own music to work, it is just for 20 seconds or so in a flashback. Been trying to do it for several hours now and one out of two things always happens either the sound does not play and it becomes totally quite or i get the error message and my amnesia goes down. Though this only happens when i use my custom sound and not if I use one of the regular. I am out of ideas and need help.

this is from the .hps file


////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
AddEntityCollideCallback("Player", "cookarea", "CollideCookArea", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "oohnoo", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "music1", true, 1);
AddEntityCollideCallback("Player", "RoomTwoArea1", "CollideRoomTwo1", true, 1);
AddEntityCollideCallback("Player", "Walk_Quest_Area", "GetWalkQuest", true, 1);
AddEntityCollideCallback("Player", "Walk_Complete_Area", "FinishWalkQuest", true, 1);
AddEntityCollideCallback("Player", "Walk_Quest_Area_1", "GetWalkQuest1", true, 1);
AddEntityCollideCallback("Player", "Walk_Complete_Area_1", "FinishWalkQuest1", true, 1);
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
SetSwingDoorLocked("mansion_1", true, true);
}
void CollideCookArea(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_wall_stomp", "Player", 0, false);
AddPropImpulse("cook", 0, 0, 5, "");
GiveSanityDamage(30, true);
AddEntityCollideCallback("Player", "AfterCookArea", "CollideAfterCookArea", true, 1);
}
void oohnoo(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("BoxLight_2", false);
GiveSanityDamage(10, true);
PlayMusic("01_amb_darkness.ogg", true, 1, 3, 0, true);
}
void music1(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Ballroom.ogg", true, 1.0f, 1.0f, 0, false);
}
void CollideRoomTwo1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_6", true, true);
SetSwingDoorLocked("mansion_6", true, true);
}
void GetWalkQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("walkquest", "WalkQuest");
}

void FinishWalkQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("walkquest", "WalkQuest");
}
void GetWalkQuest1(string &in asParent, string &in asChild, int alState)
{
AddQuest("walkquest1", "WalkQuest1");
}

void FinishWalkQuest1(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("walkquest1", "WalkQuest1");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "monsterdoor", 0.0f, true);
RemoveItem("monsterdoorkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

this is my .snt file


<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="Ballroom" />
</Main>
</SOUNDS>
<PROPERTIES Volume="0.8" MinDistance="0.1" MaxDistance="50" Random="1" Interval="0" FadeEnd="true" FadeStart="False" Stream="False" Loop="false" Use3D="True" Blockable="False" BlockVolumeMul="0.6" Priority="0" />
</SOUNDENTITY>


please help me get my sound to work
02-04-2012, 04:50 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: Own music

(02-04-2012, 04:50 PM)Calypse1 Wrote: hello I am trying to get my own music to work, it is just for 20 seconds or so in a flashback. Been trying to do it for several hours now and one out of two things always happens either the sound does not play and it becomes totally quite or i get the error message and my amnesia goes down. Though this only happens when i use my custom sound and not if I use one of the regular. I am out of ideas and need help.

this is from the .hps file


////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
AddEntityCollideCallback("Player", "cookarea", "CollideCookArea", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "oohnoo", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "music1", true, 1);
AddEntityCollideCallback("Player", "RoomTwoArea1", "CollideRoomTwo1", true, 1);
AddEntityCollideCallback("Player", "Walk_Quest_Area", "GetWalkQuest", true, 1);
AddEntityCollideCallback("Player", "Walk_Complete_Area", "FinishWalkQuest", true, 1);
AddEntityCollideCallback("Player", "Walk_Quest_Area_1", "GetWalkQuest1", true, 1);
AddEntityCollideCallback("Player", "Walk_Complete_Area_1", "FinishWalkQuest1", true, 1);
AddUseItemCallback("", "monsterdoorkey_1", "monsterdoor", "UsedKeyOnDoor", true);
}
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
SetSwingDoorLocked("mansion_1", true, true);
}
void CollideCookArea(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_wall_stomp", "Player", 0, false);
AddPropImpulse("cook", 0, 0, 5, "");
GiveSanityDamage(30, true);
AddEntityCollideCallback("Player", "AfterCookArea", "CollideAfterCookArea", true, 1);
}
void oohnoo(string &in asParent, string &in asChild, int alState)
{
SetLightVisible("BoxLight_2", false);
GiveSanityDamage(10, true);
PlayMusic("01_amb_darkness.ogg", true, 1, 3, 0, true);
}
void music1(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Ballroom.ogg", true, 1.0f, 1.0f, 0, false);
}
void CollideRoomTwo1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_6", true, true);
SetSwingDoorLocked("mansion_6", true, true);
}
void GetWalkQuest(string &in asParent, string &in asChild, int alState)
{
AddQuest("walkquest", "WalkQuest");
}

void FinishWalkQuest(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("walkquest", "WalkQuest");
}
void GetWalkQuest1(string &in asParent, string &in asChild, int alState)
{
AddQuest("walkquest1", "WalkQuest1");
}

void FinishWalkQuest1(string &in asParent, string &in asChild, int alState)
{
CompleteQuest("walkquest1", "WalkQuest1");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("monsterdoor", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "monsterdoor", 0.0f, true);
RemoveItem("monsterdoorkey_1");
}
////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

this is my .snt file


<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="Ballroom" />
</Main>
</SOUNDS>
<PROPERTIES Volume="0.8" MinDistance="0.1" MaxDistance="50" Random="1" Interval="0" FadeEnd="true" FadeStart="False" Stream="False" Loop="false" Use3D="True" Blockable="False" BlockVolumeMul="0.6" Priority="0" />
</SOUNDENTITY>


please help me get my sound to work
Are you using it as a flashback? Because what I know flashbacks are in their own file with the music and talking etc.


02-04-2012, 05:37 PM
Find
Calypse1 Offline
Junior Member

Posts: 7
Threads: 3
Joined: Jan 2012
Reputation: 0
#3
RE: Own music


Now I am just trying to get it to work so that when I walk into a script the music will start. I already know how to make flashbacks and have done several before, but that is when I used sounds and voices that was already in the game.


(This post was last modified: 02-04-2012, 11:50 PM by Calypse1.)
02-04-2012, 11:49 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#4
RE: Own music

Change your
PlayMusic("Ballroom.ogg", true, 1.0f, 1.0f, 0, false);
to
PlayMusic("Ballroom.ogg", true, 0.8f, 1, 0, true);
and tell me if that does anything.

Hold up. Why did you post its' .snt file? The music is .ogg, a .snt file for it shouldn't even exist, because that makes it a sound. Check the ending for the music again. Does it say Ballroom.snt or Ballroom.ogg? (Look at it while its' on your desktop/music folder or wherever it is) The extension should be .ogg. If that's no use, post the error message.

Ba-da bing, ba-da boom.
02-06-2012, 12:41 AM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#5
RE: Own music

I imagine the .ogg file is in under YOURCUSTOMSTORYNAME>music?


02-06-2012, 03:48 AM
Find




Users browsing this thread: 1 Guest(s)