ZodiaC
Member
Posts: 120
Threads: 8
Joined: Oct 2012
Reputation:
2
|
RE: How to script Music when walking into a ScriptArea?
(11-05-2012, 10:33 PM)taylor122002 Wrote: 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! 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. StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);
To look at entity and
StopPlayerLookAt();
to stop looking
|
|
11-05-2012, 10:40 PM |
|