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 Help getting music to play in map
LDOriginal Offline
Junior Member

Posts: 35
Threads: 7
Joined: Oct 2014
Reputation: 0
#1
Help getting music to play in map

I've been away from Custom Story'ing a while and just got back to it. I would like music to play in my map when i enter an area. Music that's in the "music" folder in amnesia. I've tried scripting it several times but it's not working. I've allso looked around for a solution but without success. If any of you would please take a look at my script and see were the music code should be put it would be very appreciated! Scripting is hard for the lesser talented...

So this is my script:

void OnStart()
{

AddEntityCollideCallback("Player", "Rabarber", "PlaySound", true, 1);
AddEntityCollideCallback("Player", "Stopp", "PlaySound", true, 1);
AddEntityCollideCallback("Player", "Ljud", "start", true, 1);
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
AddUseItemCallback("", "Nyckel", "Rumpa", "UseKeyOnDoor", true);
AddUseItemCallback("", "Tillskåp", "Skåp", "UseKeyOnDoor", true);
}

void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "Unlock_door.snt", asEntity, 10, false);
RemoveItem(asItem);
}

void start(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "general_piano01.snt", "Player", 0.0f, false);
}

void PlaySound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "21_intro_scream.snt", "Player", 1, false);
}


All i know is that "void PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);" is to be placed in there in order to work, but i can't figure it out. Sad Anyone care to give some pointers? Smile
02-01-2015, 01:49 PM
Find


Messages In This Thread
Help getting music to play in map - by LDOriginal - 02-01-2015, 01:49 PM
RE: Help getting music to play in map - by Neelke - 02-01-2015, 01:57 PM
RE: Help getting music to play in map - by Neelke - 02-01-2015, 02:05 PM
RE: Help getting music to play in map - by Neelke - 02-01-2015, 02:18 PM
RE: Help getting music to play in map - by Neelke - 02-01-2015, 02:49 PM
RE: Help getting music to play in map - by Neelke - 02-01-2015, 09:02 PM
RE: Help getting music to play in map - by Neelke - 02-01-2015, 10:39 PM



Users browsing this thread: 3 Guest(s)