The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Messages In This Thread
How do I import my own music? - by Mojake - 03-19-2012, 07:21 PM
RE: How do I import my own music? - by Mojake - 03-19-2012, 07:41 PM
RE: How do I import my own music? - by Xanthos - 03-20-2012, 12:23 AM



Users browsing this thread: 1 Guest(s)