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
#3
RE: How to script Music when walking into a ScriptArea?

(11-05-2012, 10:40 PM)ZodiaC Wrote:
(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! 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.
StartPlayerLookAt(string& asEntityName, float afSpeedMul, float afMaxSpeed, string& asAtTargetCallback);
To look at entity and
StopPlayerLookAt();
to stop looking
Thanks! I got the head motion right! But I can't get it right so when you walk into a script area, it happens. Right when I enter the level door leading to downstairs, then it goes straight to the "Grunt_1", and when I try to look away, it keeps going back there. Even after waiting for a long period of time.
11-06-2012, 12:14 AM
Find


Messages In This Thread
RE: How to script Music when walking into a ScriptArea? - by taylor122002 - 11-06-2012, 12:14 AM



Users browsing this thread: 1 Guest(s)