Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why teleportation script doesnt work?
kartanonperuna Offline
Posting Freak

Posts: 755
Threads: 44
Joined: Oct 2011
Reputation: 8
#1
Why teleportation script doesnt work?

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...

Voice actor

Painful shadows



02-10-2012, 06:58 AM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#2
RE: Why teleportation script 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");

(This post was last modified: 02-10-2012, 07:17 AM by flamez3.)
02-10-2012, 07:15 AM
Find
kartanonperuna Offline
Posting Freak

Posts: 755
Threads: 44
Joined: Oct 2011
Reputation: 8
#3
RE: Why teleportation script doesnt work?

Dont I already have that same exact one?

Voice actor

Painful shadows



02-10-2012, 03:19 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#4
RE: Why teleportation script doesnt work?

You used:

AddTimer("Timer_2", (10), "TELEPORT");

02-10-2012, 03:30 PM
Find
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#5
RE: Why teleportation script doesnt work?

Timer Callback syntax is:
Callback syntax: void MyFunc(string &in asTimer)

The Interrogation
Chapter 1

My tutorials
02-10-2012, 03:33 PM
Find
kartanonperuna Offline
Posting Freak

Posts: 755
Threads: 44
Joined: Oct 2011
Reputation: 8
#6
RE: Why teleportation script doesnt work?

(02-10-2012, 03:30 PM)flamez3 Wrote: You used:

AddTimer("Timer_2", (10), "TELEPORT");
Still doesnt work.

Voice actor

Painful shadows



02-10-2012, 03:39 PM
Website Find
flamez3 Offline
Posting Freak

Posts: 1,281
Threads: 48
Joined: Apr 2011
Reputation: 57
#7
RE: Why teleportation script doesnt work?

(02-10-2012, 03:33 PM)Elven Wrote: Timer Callback syntax is:
Callback syntax: void MyFunc(string &in asTimer)
Skipped that ^^

02-10-2012, 03:52 PM
Find




Users browsing this thread: 1 Guest(s)