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
Whats wrong with my script?
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#1
Whats wrong with my script?

Hi, I cant see whats wrong with me script but it doesnt work ingame. I get a error Tongue

Script:

////////////////////////////
// Run first time starting map
void OnStart()
{
SetEntityPlayerInteractCallback("", "OpenCurtain", true);
SetEntityPlayerInteractCallback("", "Sleep", true);
SetEntityPlayerInteractCallback("", "StartConversation", true);
}

void StartConversation(string &in asEntity)
{
SetPlayerActive(false);
FadeOut(1);
AddTimer("", 2.0f, "TeleToDesk");
AddTimer("", 3.0f, "FadeToDesk");
}

void TeleToDesk(string &in asTimer)
{
AddTimer("", 2.0f, "InnkeeperHello");
SetEntityActive("block_box_1", true);
SetEntityActive("block_box_2", true);
SetEntityActive("block_box_3", true);
SetEntityActive("block_box_4", true);
SetEntityActive("StartConversation", false);
SetPlayerActive(true);
TeleportPlayer("PlayerStartArea_3");
}

void InnkeeperHello(string &in asTimer)
{
AddTimer("", 3.0f, "InnkeeperWhatDoYouWant");
SetMessage("TheInnkeeper", "Hello", 0);
}

void InnkeeperWhat(string &in asTimer)
}
SetMessage("TheInnkeeper", "What", 0);
}

void FadeToDesk(string &in asTimer)
{
FadeIn(3);
}

void Sleep(string &in asEntity)
{
SetPlayerActive(false);
FadeOut(1);
AddTimer("", 2.0f, "Tele");
AddTimer("", 3.0f, "SleepNow");
}

void Tele(string &in asTimer)
{
TeleportPlayer("PlayerStartArea_2");
}

void SleepNow(string &in asTimer)
{
FadeIn(1);
MovePlayerHeadPos(1.7, 0.03, 0.0, 0.5, 0.2);
AddTimer("", 6.0f, "Look1");
}

void Look1(string &in asTimer)
{
FadeOut(3);
}

void OpenCurtain(string &in asEntity)
{
FadeOut(1);
AddTimer("", 3.0f, "ActuallyOpen");
AddTimer("", 2.0f, "TheyAreOpen");
}

void TheyAreOpen(string &in asEntity)
{
SetEntityActive("curtain01_closed_1", false);
SetEntityActive("curtain01_open_1", true);
SetEntityActive("OpenCurtains", false);
}

void ActuallyOpen(string &in asTimer)
{
FadeIn(1);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
09-10-2011, 05:07 PM
Find
Darion97 Offline
Junior Member

Posts: 29
Threads: 1
Joined: Jun 2011
Reputation: 1
#2
RE: Whats wrong with my script?

What is the error? When the game crashes what it says?
09-10-2011, 06:10 PM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#3
RE: Whats wrong with my script?

(09-10-2011, 06:10 PM)Darion97 Wrote: What is the error? When the game crashes what it says?
It does'nt crash it says something about something being wrong with a "," or ";"
09-10-2011, 06:11 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Whats wrong with my script?

You didn't properly open InnkeeperWhat's code block.

Tutorials: From Noob to Pro
09-10-2011, 06:17 PM
Website Find
Darion97 Offline
Junior Member

Posts: 29
Threads: 1
Joined: Jun 2011
Reputation: 1
#5
RE: Whats wrong with my script?


This is wrong:
SetEntityPlayerInteractCallback("", "OpenCurtain", true);
SetEntityPlayerInteractCallback("", "Sleep", true);
SetEntityPlayerInteractCallback("", "StartConversation", true);




09-10-2011, 06:19 PM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#6
RE: Whats wrong with my script?

Could someone post the fixed script and tell me what I did wrong, still getting the error :C
09-11-2011, 12:21 PM
Find
Darion97 Offline
Junior Member

Posts: 29
Threads: 1
Joined: Jun 2011
Reputation: 1
#7
RE: Whats wrong with my script?

This is wrong:
void TheyAreOpen(string &in asEntity)

This is true:
void TheyAreOpen(string &in asTimer)
09-11-2011, 01:53 PM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#8
RE: Whats wrong with my script?

(09-11-2011, 01:53 PM)Darion97 Wrote: This is wrong:
void TheyAreOpen(string &in asEntity)

This is true:
void TheyAreOpen(string &in asTimer)
Arghh im still getting the same error :C
Thanks for correcting the script though.
09-11-2011, 02:10 PM
Find
Darion97 Offline
Junior Member

Posts: 29
Threads: 1
Joined: Jun 2011
Reputation: 1
#9
RE: Whats wrong with my script?

What say now?

void InnkeeperWhat(string &in asTimer)
}This is wrong
SetMessage("TheInnkeeper", "What", 0);
}
(This post was last modified: 09-11-2011, 02:23 PM by Darion97.)
09-11-2011, 02:21 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#10
RE: Whats wrong with my script?

Note: Differing-from-documentation variable names will not crash the game. Likewise, empty strings will only crash the game if a reference is required but none was given.

Tutorials: From Noob to Pro
09-11-2011, 03:48 PM
Website Find




Users browsing this thread: 4 Guest(s)