Why teleportation script doesnt work? - 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: Why teleportation script doesnt work? (/thread-13215.html) |
Why teleportation script doesnt work? - kartanonperuna - 02-10-2012 Heres the whole script: //////////////////////////// // Run first time starting map void OnStart() { AddEntityCollideCallback("Player", "guardvoice", "Voicetrigger", true, 1); AddUseItemCallback("", "stone_hammer_1", "BreakArea", "break1", true); AddEntityCollideCallback("Player", "VIEW", "Voicetrigger2", true, 1); AddEntityCollideCallback("Player", "ROT", "Voicetrigger3", true, 1); SetEntityCallbackFunc("Pot of blood", "BoneSawItem"); } void Voicetrigger(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "guardconversation4.snt", "whinyguard2", 128, false); } void break1(string &in asItem, string &in asEntity) { SetEntityActive("breakablewall", false); SetEntityActive("brokenwall", true); SetEntityActive("whinyguard3", true); SetEntityActive("sword", true); SetEntityActive("block_box_1", true); SetEntityActive("guardlook", true); SetEntityActive("brick1", true); SetEntityActive("brick2", true); SetEntityActive("brick3", true); PlaySoundAtEntity("", "away.snt", "Player", 22, false); SetEntityActive("guardtorch", true); PlaySoundAtEntity("", "break_wood_metal3", "Player", 1, false); StartPlayerLookAt("guardlook", 6, 6, ""); AddTimer("look01", 4, "Timer_1"); } void Timer_1(string &in asTimer) { StopPlayerLookAt(); } void Voicetrigger2(string &in asParent, string &in asChild, int alState) { PlayMusic("hall.ogg", true, 1.0f, 1.0f, 1, false); } void Voicetrigger3(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "youcanrot.snt", "Player", 16, false); SetEntityActive("whinyguard4", true); SetEntityActive("sword2", true); SetEntityActive("guardtorch2", true); SetEntityActive("block_box_2", true); } void BoneSawItem(string &in asEntity, string &in type) { StartScreenShake(1, 1, 1, 1); AddTimer("Timer_2", (10), "TELEPORT"); AddEntityCollideCallback("Player", "playerteleport", "TELEPORT", true, 1); FadeOut(10); } void TELEPORT(string &in asParent, string &in asChild, int alState) { TeleportPlayer("PlayerStartArea_5"); } //////////////////////////// // Run when entering map void OnEnter() { PlayMusic(".ogg", true, 1.0f, 1.0f, 1, false); } //////////////////////////// // Run when leaving map void OnLeave() { } When I put the fade in inside TELEPORT's brackets,it worked.But the teleportation doesnt work... RE: Why teleportation script doesnt work? - flamez3 - 02-10-2012 Because callback's can't be used in the function blocks. EDIT: oh wait I get it c:. You used (). Use this: AddTimer("Timer_2", 10, "TELEPORT"); RE: Why teleportation script doesnt work? - kartanonperuna - 02-10-2012 Dont I already have that same exact one? RE: Why teleportation script doesnt work? - flamez3 - 02-10-2012 You used: AddTimer("Timer_2", (10), "TELEPORT"); RE: Why teleportation script doesnt work? - Elven - 02-10-2012 Timer Callback syntax is: Callback syntax: void MyFunc(string &in asTimer) RE: Why teleportation script doesnt work? - kartanonperuna - 02-10-2012 (02-10-2012, 03:30 PM)flamez3 Wrote: You used:Still doesnt work. RE: Why teleportation script doesnt work? - flamez3 - 02-10-2012 (02-10-2012, 03:33 PM)Elven Wrote: Timer Callback syntax is:Skipped that ^^ |