Frictional Games Forum (read-only)
Little script problem - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Little script problem (/thread-9682.html)



Little script problem - Crypto - 08-10-2011

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()
{

}


RE: Little script problem - Endlvl - 08-10-2011

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


RE: Little script problem - Crypto - 08-10-2011

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


RE: Little script problem - Endlvl - 08-10-2011

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