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:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to script Music when walking into a ScriptArea?
taylor122002 Offline
Junior Member

Posts: 13
Threads: 10
Joined: Aug 2012
Reputation: 0
#1
How to script Music when walking into a ScriptArea?


.png   amnesiahelp5.png (Size: 33.81 KB / Downloads: 164) Firstly, I want to say thank you to everyone at the forums for all of your help on scripting! I've learned many new things which could help my custom story come along nicely! I finally finished my first map, which was 128 lines of scripting! Big Grin And it all works! Now I'm working on the second map of the custom story, which is downstairs. I want to make it so when you walk into a script area, music will play, and that Daniel turns his head to the side and a monster charges at you but then disappears at last second It could be for a small scare. I already no how to set it up with sounds, but I want music, and know how to make it so when walked into the scripted area, the character will turn his head and see a monster.

Here is what I have for my script so far, but I get a ton of errors.:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Music_1", "Start", true, 1);
}

void Start(string &in asParent, string &in asChild, int alState)
{
PlayMusic("", "10_event_coming.ogg", true, 0.8, 2, 1, true);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}

And I don't know how to script so you turn your head.
That script I got from YouTube except changed the sound with music.
And I'll use an attachment for what the errors say.

I noticed though that the error had some things from the first map I used. Like the "Low Sanity" thing I used in my first map, Room01. But it's included in the error for Downstairs01. But I don't get these errors when I use an actual sound and not music.
(This post was last modified: 11-05-2012, 10:35 PM by taylor122002.)
11-05-2012, 10:33 PM
Find


Messages In This Thread
How to script Music when walking into a ScriptArea? - by taylor122002 - 11-05-2012, 10:33 PM



Users browsing this thread: 1 Guest(s)