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 How do I import my own music?
Mojake Offline
Junior Member

Posts: 7
Threads: 6
Joined: Mar 2012
Reputation: 0
#1
How do I import my own music?

I am trying to make music play when I enter an area, however it doesn't play at all and I have no idea why. Here's my .hps file:


////////////////////////////
// Run first time starting map

void OnStart()

{
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 9.0f, "beginStory");

AddUseItemCallback("", "Crowbar", "mansion_1", "Break", true);
AddUseItemCallback("", "HallwayKey", "mansion_2", "OpenHallwayDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "mansion_1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "StartMusic_1", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "StatueAppear", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "StatueShock", true, -1);
AddEntityCollideCallback("Player", "ScriptArea_5", "Falling", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_6", "ChefSpawn", true, 1);
AddEntityCollideCallback("TheChef", "ScriptArea_7", "ChefLoop", false, 1);
AddEntityCollideCallback("Player", "ScriptArea_8", "StartMusic_2", true, 1);
}


void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 20, 20);
FadeRadialBlurTo(0.01, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
PlayMusic("react_sigh3.ogg", false, 1.0, 2, 0, true);
}

////////Chef////////

void ChefSpawn(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("TheChef", true);
AddEnemyPatrolNode("TheChef", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("TheChef", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("TheChef", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("TheChef", "PathNodeArea_4", 2, "");
PlaySoundAtEntity("", "react_scare4.ogg", "Player", 0, false);
GiveSanityDamage(30.0f, true);
SetPlayerActive(false);
StartPlayerLookAt("map_05_winecellar_1", 2.0f, 5.0f, "");
AddTimer("timer01", 4.0f, "StopLookChef");
}

void StopLookChef(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

////////ShelfDrop////////

void Falling(string &in asParent, string &in asChild, int alState)
{
AddPropForce("pot_plant_small01_1", -1000.0f, 0.0f, 0.0f, "world");
}

////////Openmansion_1////////

void Break(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("Crowbar");
}

////////Openmansion_2////////

void OpenHallwayDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_2", 0, false);
RemoveItem("HallwayKey");
}

////////DoorSlam////////

void mansion_1(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
PlaySoundAtEntity("", "react_scare", "Player", 0, false);
PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);
GiveSanityDamage(10.0f, true);
SetPlayerActive(false);
StartPlayerLookAt("mansion_1", 3.0f, 5.0f, "");
AddTimer("timer01", 1.5f, "StopLook");
}

void StopLook(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

////////Music////////

void StartMusic_1(string &in asParent, string &in asChild, int alState)
{
PlayMusic("ambience_swoop_myst.ogg", true, 0.2, 2, 1, true);
}


void StartMusic_2(string &in asParent, string &in asChild, int alState)
{
PlayMusic("Requiem.ogg", false, 1.0f, 3.0f, 0, true);
}

////////StatueAppear////////

void StatueAppear(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("deformedman", true);
}

void StatueShock(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("deformedman", 3.0f, 5.0f, "");
AddTimer("timer01", 1.5f, "StopLookStatue");
GiveSanityDamage(20.0f, true);
PlaySoundAtEntity("", "scare_male_terrified3.ogg", "Player", 0, false);
PlaySoundAtEntity("", "react_breath_slow1.ogg", "Player", 0, false);
}

void StopLookStatue(string &in asTimer)
{
StopPlayerLookAt();
SetPlayerActive(true);
}

I can't see a problem with it? Undecided
03-19-2012, 07:21 PM
Find
Prelauncher Offline
Senior Member

Posts: 451
Threads: 11
Joined: May 2011
Reputation: 13
#2
RE: How do I import my own music?

Have you created a .snt file that you´ve connected to your music?

Socialism (noun): A great way to run out of other people's money.
03-19-2012, 07:33 PM
Find
Mojake Offline
Junior Member

Posts: 7
Threads: 6
Joined: Mar 2012
Reputation: 0
#3
RE: How do I import my own music?

(03-19-2012, 07:33 PM)Prelauncher Wrote: Have you created a .snt file that you´ve connected to your music?
I tried, I don't know if it's in the right folder or the right content:


<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="Requiem.ogg" />
</Main>
</SOUNDS>
<PROPERTIES Volume="1" MinDistance="12" MaxDistance="50" Random="1" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="True" Blockable="False" BlockVolumeMul="0.7" Priority="0" />
</SOUNDENTITY>

It's in the same folder as the .ogg
(This post was last modified: 03-19-2012, 07:41 PM by Mojake.)
03-19-2012, 07:41 PM
Find
Xanthos Offline
Senior Member

Posts: 318
Threads: 9
Joined: Mar 2012
Reputation: 8
#4
RE: How do I import my own music?

(03-19-2012, 07:41 PM)Mojake Wrote:
(03-19-2012, 07:33 PM)Prelauncher Wrote: Have you created a .snt file that you´ve connected to your music?
I tried, I don't know if it's in the right folder or the right content:









</properties>

It's in the same folder as the .ogg



If you convert it to a .snt then why not use

PlayGuiSound
Instead of
PlayMusic
?

03-20-2012, 12:23 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: How do I import my own music?

There's no need to create a .snt file for music. Check the hpl.log file for insight on the issue of the OGG file.

Tutorials: From Noob to Pro
03-20-2012, 12:38 AM
Website Find




Users browsing this thread: 4 Guest(s)