02-24-2015, 08:53 PM
Hey guys!
I'm a bit rusty in creating custom stories, I've just returned to doing it because of a project in school. I'm trying to create a script area where the lights throughout the building becomes lit, in a sequence. My problem is that nothing happens when the player enters the script area, it won't even activate the first torch.
What am I missing? Probably something very simple
here's the script:
void OnStart()
{
SetPlayerMoveSpeedMul(1);
}
void OnEnter()
{
SetPlayerMoveSpeedMul(1);
}
// Functions
void Teleport1(string &in asParent, string &in asChild, int alState)
{
}
void TorchOnSchool(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torch_start1", true);
AddTimer("torch_start23", 2, "LightsOnSchool");
AddTimer("torch_start45", 4, "LightsOnSchool");
AddTimer("torch_start67", 6, "LightsOnSchool");
}
void LightsOnSchool(string &in asTimer)
{
if(asTimer == "torch_start23")
{
SetEntityActive("torch_start2", true);
SetEntityActive("torch_start3", true);
}
if(asTimer == "torch_start45")
{
SetEntityActive("torch_start4", true);
SetEntityActive("torch_start5", true);
}
if(asTimer == "torch_start67")
{
SetEntityActive("torch_start6", true);
SetEntityActive("torch_start7", true);
}
}
void OnLeave()
{
}
//////////////////////
//Functions
void test_this(string &in asEntity, string &in type)
{
}
The name of the script area is "TorchOnSchool"
I'm a bit rusty in creating custom stories, I've just returned to doing it because of a project in school. I'm trying to create a script area where the lights throughout the building becomes lit, in a sequence. My problem is that nothing happens when the player enters the script area, it won't even activate the first torch.
What am I missing? Probably something very simple
here's the script:
Spoiler below!
void OnStart()
{
SetPlayerMoveSpeedMul(1);
}
void OnEnter()
{
SetPlayerMoveSpeedMul(1);
}
// Functions
void Teleport1(string &in asParent, string &in asChild, int alState)
{
}
void TorchOnSchool(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("torch_start1", true);
AddTimer("torch_start23", 2, "LightsOnSchool");
AddTimer("torch_start45", 4, "LightsOnSchool");
AddTimer("torch_start67", 6, "LightsOnSchool");
}
void LightsOnSchool(string &in asTimer)
{
if(asTimer == "torch_start23")
{
SetEntityActive("torch_start2", true);
SetEntityActive("torch_start3", true);
}
if(asTimer == "torch_start45")
{
SetEntityActive("torch_start4", true);
SetEntityActive("torch_start5", true);
}
if(asTimer == "torch_start67")
{
SetEntityActive("torch_start6", true);
SetEntityActive("torch_start7", true);
}
}
void OnLeave()
{
}
//////////////////////
//Functions
void test_this(string &in asEntity, string &in type)
{
}
The name of the script area is "TorchOnSchool"