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
Script Help help needed
Corpus Offline
Junior Member

Posts: 1
Threads: 1
Joined: Apr 2013
Reputation: 0
#1
help needed

I've been working on a script to turn off the lamps in a hallway, but unfortunately when I enter the script area nothing happens. I've checked the common "name" error and syntax but I cant seem to solve this especially since I'm a scripting noob. Here's my .hps script. Any help would be appreciated.

void OnStart()
{
AddEntityCollideCallback("", "KillTheLights", "LightsOut", true, 1);
}


void LightsOut(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch1", false, true);
AddTimer("", 2, "Out2");
}


void Out2(string &in asTimer)
{
SetLampLit("torch2", false, true);
AddTimer("", 2, "Out3");
}


void Out3(string &in asTimer)
{
SetLampLit("torch3", false, true);
AddTimer("", 2, "Out4");
}


void Out4(string &in asTimer)
{
SetLampLit("torch4", false, true);
AddTimer("", 2, "Out5");
}


void Out5(string &in asTimer)
{
SetLampLit("torch5", false, true);
AddTimer("", 2, "Out6");
}


void Out6(string &in asTimer)
{
SetLampLit("torch6", false, true);
AddTimer("", 2, "Out7");
}


void Out7(string &in asTimer)
{
SetLampLit("torch7", false, true);
AddTimer("", 2, "Out8");
}


void Out8(string &in asTimer)
{
SetLampLit("torch8", false, true);
AddTimer("", 2, "Out9");
}


void Out9(string &in asTimer)
{
SetLampLit("torch9", false, true);
AddTimer("", 2, "Out10");
}


void Out10(string &in asTimer)
{
SetLampLit("torch10", false, true);
}


void OnEnter()
{
}


void OnLeave()
{
}
04-15-2013, 03:51 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: help needed

AddEntityCollideCallback("", "KillTheLights", "LightsOut", true, 1);

You have nothing activating the script. Do this:

AddEntityCollideCallback("Player", "KillTheLights", "LightsOut", true, 1);
(This post was last modified: 04-15-2013, 04:35 PM by Statyk.)
04-15-2013, 04:35 PM
Find




Users browsing this thread: 1 Guest(s)