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
TeleportPlayer Help
Nomad923 Offline
Junior Member

Posts: 46
Threads: 15
Joined: Dec 2011
Reputation: 2
#1
TeleportPlayer Help

I cant seem to figure out what to do to fix this, The error i keep getting is:

ExecuteString (19,17) : ERR : 'PlayerStartArea_2' is not declared
main (1, 1) : ERR : No matching signatures to 'OnGameStart()'


void OnStart()
{

}

void OnEnter()
{
    AddEntityCollideCallback("Player", "TeleportTrigger", "Nightmare", true, 1);
}

void OnLeave()
{

}

void Nightmare(string &inasParent, string &in asChild, int alState)
{
    FadeOut(0.0f);
    TeleportPlayer(PlayerStartArea_2);
}

[Image: qg_logo.png]
(This post was last modified: 12-22-2011, 09:41 AM by Nomad923.)
12-22-2011, 06:44 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: TeleportPlayer Help

You're supposed to provide a string for TeleportPlayer. Instead, you have provided an undeclared variable. Also, you may want to verify the definition of the Nightmare function.

Tutorials: From Noob to Pro
12-22-2011, 07:38 AM
Website Find
Nomad923 Offline
Junior Member

Posts: 46
Threads: 15
Joined: Dec 2011
Reputation: 2
#3
RE: TeleportPlayer Help

(12-22-2011, 07:38 AM)Your Computer Wrote: You're supposed to provide a string for TeleportPlayer. Instead, you have provided an undeclared variable. Also, you may want to verify the definition of the Nightmare function.

Ok after doing what you said, i get the following errors now
execute (1, 1) : ERR : No matching signatures to 'OnGameStart()'

main (17, 24) : ERR : Expected '('

These are the changes i made.

Im new to making custom stories, so could you show me the changes you would have made to this.

void OnStart()
{
}

void OnEnter()
{
    AddEntityCollideCallback("Player", "Teleport", "Nightmare", true, 1);
}

void OnLeave()
{
}

void Nightmare(string &inasParent, string &in asChild, int alState)
{
    FadeOut(0.0f);
    TeleportPlayer(string PlayerStartArea_2);
    PlaySoundAtEntity("", "insanity_monster_roar01", "slime_pile_3", 0, false);
    FadeIn(0.0f);
}

Ignore the fade in part im going to change the time for the fade in.

[Image: qg_logo.png]
(This post was last modified: 12-22-2011, 07:54 AM by Nomad923.)
12-22-2011, 07:50 AM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#4
RE: TeleportPlayer Help

Use quotation marks around PlayerStartArea_2.

It should look like this:
TeleportPlayer("PlayerStartArea_2");

When you don't enclose an argument quotation marks, you're using a variable like Your Computer mentioned.

12-22-2011, 09:01 AM
Find
Nomad923 Offline
Junior Member

Posts: 46
Threads: 15
Joined: Dec 2011
Reputation: 2
#5
RE: TeleportPlayer Help

(12-22-2011, 09:01 AM)palistov Wrote: Use quotation marks around PlayerStartArea_2.

It should look like this:
TeleportPlayer("PlayerStartArea_2");

When you don't enclose an argument quotation marks, you're using a variable like Your Computer mentioned.
Ah ok that makes sense, dont know why i didnt realize that was the problem. Thanks for the help guys.

[Image: qg_logo.png]
12-22-2011, 09:12 AM
Find




Users browsing this thread: 2 Guest(s)