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
[SOLVED] Lights on script
Aletho Offline
Junior Member

Posts: 14
Threads: 4
Joined: Jan 2015
Reputation: 0
#1
[SOLVED] Lights on script

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 Big Grin

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"
(This post was last modified: 02-25-2015, 06:10 PM by Aletho.)
02-24-2015, 08:53 PM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#2
RE: Lights on script

You're missing the callback declaration inside OnStart

I'm guessing you want one for that TorchOnSchool function with those parameters, so you need a collide callback. If I'm not mistaken it's AddEntityCollideCallback ( parent, child, function, deleteOnUse, state );
Just check the wiki. got the link?

02-24-2015, 09:06 PM
Find
Aletho Offline
Junior Member

Posts: 14
Threads: 4
Joined: Jan 2015
Reputation: 0
#3
RE: Lights on script

(02-24-2015, 09:06 PM)Daemian Wrote: You're missing the callback declaration inside OnStart

I'm guessing you want one for that TorchOnSchool function with those parameters, so you need a collide callback. If I'm not mistaken it's AddEntityCollideCallback ( parent, child, function, deleteOnUse, state );
Just check the wiki. got the link?

Yeah I have the link to the wiki and I found the function you're referring to, i'm going to try it out tomorrow, thanks for the help! :-)
02-24-2015, 09:57 PM
Find




Users browsing this thread: 1 Guest(s)