NadTheBat
Junior Member
Posts: 38
Threads: 4
Joined: Aug 2011
Reputation:
0
|
RE: Help with scripting and notes.
(08-12-2011, 10:31 AM)Tanshaydar Wrote: AddEntityCollideCallback("Player", "ScriptArea_2", "Func01", true, 1);
This should be in the braces of OnStart, not a standalone {}.
Keep in mind that { is used to open a function block, and } is used to close it. Every function block should have a name or an indicator. So it would be like this:
////////////////////////////
// Run when entering map
void OnEnter()
{
}
void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "MonsterFunc1" , true , 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Func01", true, 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt_1" , true);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("ScaryDoor", 0, 0, 5, "World");
PlaySoundAtEntity("", "21_bang_door.snt", "ScaryDoor", 0, false);
StartPlayerLookAt("ScaryDoor", 2, 2, "");
AddTimer("", 2, "TimerFunc");
}
void TimerFunc(string &in asTimer)
{
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
If you don't have the sound files notes will skip instantly.
Thank you! The script worked! And yes I do have the sound files for the notes, but it still skips instantly. I can view the notes in my journal, but there is no text at all. Could it be because I have too many notes?
EDIT: I tested my custom story again, and when I pick up one of the keys, it simply says "Picked up", and when I look in my inventory there isn't an item name or a description.
EDIT 2: I used the Langtool editor thing, and it told me exactly where the errors were. Again, thank you so much for the scripting help! I would've NEVER fixed that myself!
(This post was last modified: 08-12-2011, 12:06 PM by NadTheBat.)
|
|