Frictional Games Forum (read-only)

Full Version: Why teleportation script doesnt work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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...
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");
Dont I already have that same exact one?
You used:

AddTimer("Timer_2", (10), "TELEPORT");
Timer Callback syntax is:
Callback syntax: void MyFunc(string &in asTimer)
(02-10-2012, 03:30 PM)flamez3 Wrote: [ -> ]You used:

AddTimer("Timer_2", (10), "TELEPORT");
Still doesnt work.
(02-10-2012, 03:33 PM)Elven Wrote: [ -> ]Timer Callback syntax is:
Callback syntax: void MyFunc(string &in asTimer)
Skipped that ^^