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
#17
RE: Help getting music to play in map

(02-01-2015, 10:39 PM)Neelke Wrote: Maybe you need to add another collide function? (Another area to collide with). Or just put the music script in one of the functions.

void start(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "general_piano01.snt", "Player", 1, false);
PlayMusic("02_amb_safe.ogg", true, 1.0f, 0, 0, true);
}

Or a new function:

void OnStart()
{
     AddEntityCollideCallback("Player", "AreaStartMusic", "CollideStartMusic", true, 1);
}

void CollideStartMusic(string &in asParent, string &in asChild, int alState)
{
     PlayMusic("02_amb_safe.ogg", true, 1.0f, 0, 0, true);
}

I honestly have no idea how to apply that to the existing script. Where would i put it? Thanks

(02-02-2015, 12:55 AM)Mudbill Wrote: I would strongly advice against using nordic characters in your script. Try to make it as clean as possible. Using Æ Ø Å can mess with your script because the game doesn't know how to parse it.

Ok i will fix that, thank you.

Ok, got it working. Thanks guys! Smile

void OnStart()
{
AddEntityCollideCallback("Player", "Musik", "CollideStartMusic", true, 1);
AddEntityCollideCallback("Player", "Flaska", "PlaySound", true, 1);
AddEntityCollideCallback("Player", "Ljud", "start", true, 1);
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
AddUseItemCallback("", "Nyckel", "Rumpa", "UseKeyOnDoor", true);
AddUseItemCallback("", "Tillskap", "Skap", "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", 1, false);
}

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

void CollideStartMusic(string &in asParent, string &in asChild, int alState)
{
     PlayMusic("02_amb_safe.ogg", false, 1.0f, 0, 0, true);
}
(This post was last modified: 02-02-2015, 04:40 PM by LDOriginal.)
02-02-2015, 04:06 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
RE: Help getting music to play in map - by LDOriginal - 02-02-2015, 04:06 PM



Users browsing this thread: 1 Guest(s)