(01-30-2013, 01:54 AM)serbusfish Wrote: The scenario;
You enter a room, the sound of a plate or vase smashing is heard from another room, the centre dot 'looks' to where the sound came from, then the sound of a monster walking is heard followed by the sound of a door shutting.
How would I go about doing this? I have the actual level built ready, I just have no clue about scripting, I understand the basic idea of it but I cant just open up a text doc and type in what I want to do, whereas I have no problem opening the level editor and building a random set of aesthetically pleasing rooms (imo ).
Okay, it would be like this:
void OnStart()
{
AddEntityCollideCallback("Player", "Area", "Stuff", true, 1); //The area is when you enter the room.
}
void Stuff (string &in asParent, string &in asChild, int alState)
{
SetPropHealth("Vase_to_be_broken", 0);
StartPlayerLookAt("Area_to_look_at", 1, 1, ""); ///The numbers can change if necessary
AddTimer("", 1, "Sound");
}
void Sound (string &in asEntity)
{
///Play monster walking sound
AddTimer("", 1, "Anothersound");
}
void Anothersound (string &in asTimer)
{
///Door shutting sound
StopPlayerLookAt();
}