Frictional Games Forum (read-only)

Full Version: Little script problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can you guys help me out. I just cant get it to work. Angry

Script:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("mansion_3", "ScriptArea_1", "Func01", true, 1);
PlayMusic("06_amb.ogg", true, 1, 0, 0, true);
AddEntityCollideCallback("player", "ScriptArea_3", "viini", true, 1);

AddUseItemCallback("", "key_tower_1", "mansion_5", "KeyOnDoor", true);

}

void KeyOnDoor(string &in asItem, string &in asEntity){
SetSwingDoorLocked("mansion_5", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_5", 0.0f, true);
}

void Func01(string &in asParent, string &in asChild, int alState)

{
AddPropImpulse("mansion_3", 0, 0, 5, "World");
PlaySoundAtEntity("", "21_bang_door.snt", "mansion_3", 0, false);
PlaySoundAtEntity("", "22_start.ogg", "mansion_3", 0, false);
StartPlayerLookAt("mansion_3", 2, 2, "");
AddTimer("", 2, "TimerFunc");
}
void TimerFunc(string &in asTimer)
{
StopPlayerLookAt();
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}

void viini(string &in asParent, string &in asChild, int alState)
PlaySoundAtEntity("", "05_event_bottles.ogg", "Player", 0, false);

}



////////////////////////////
// SetEntityActive("ParticleSystem_10", true); Run when entering map
void OnEnter()
{

}


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

}
Ur missing a { after the void vinni() remember to use the errors to guide u to the solution I wnt check the rest but if u get an error the first number is the line where it happened and the second is the charecter then it tells u whaat ur missing or what it thinks isn't there it was telling u that the statement had no end
Thanks Endlvl ! Its working again Smile
Map is starting now but when i walk trough scriptarea 3 i cant hear bottle event sound effect at all..Dodgy
Remember to. Try using debug messages (and enableing them in the debug F1 menu) to test if an event is occuring. It may be the volume or some other things gl and happy scripting