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
Area collide turning on torches problem.
Fetishman Offline
Junior Member

Posts: 42
Threads: 3
Joined: Aug 2011
Reputation: 7
#1
Area collide turning on torches problem.

So i have an area collide callback
AddEntityCollideCallback("Player", "Areagruntactive", "LightFuction", true, 1);

Which then is supposed to light "greentorch1". This is the void function that i have.
void LightFunction(string &in asParent, string &in asChild, int alState)
{
    SetLampLit("greentorch1", true,);
}

Now i'm pretty new to scripting in general, and a correction and/or explanation of why this doesn't work would be appreciated.
08-25-2011, 05:16 AM
Find
Juby Away
Senior Member

Posts: 290
Threads: 2
Joined: May 2011
Reputation: 5
#2
RE: Area collide turning on torches problem.

There is a comma after the true in SetLampLit.
Gotta remove it.

Insanity. Static.
(This post was last modified: 08-25-2011, 05:20 AM by Juby.)
08-25-2011, 05:18 AM
Find
Fetishman Offline
Junior Member

Posts: 42
Threads: 3
Joined: Aug 2011
Reputation: 7
#3
RE: Area collide turning on torches problem.

(08-25-2011, 05:18 AM)Juby Wrote: There is a comma after the true in SetLampLit.
Gotta remove it.

not the problem, still giving me a fatal error? got anything else? cus i'm CLUELESS
08-25-2011, 06:20 AM
Find
Phoroneus Offline
Member

Posts: 141
Threads: 12
Joined: Feb 2011
Reputation: 0
#4
RE: Area collide turning on torches problem.

You need to specify the "effects" part of your SetLampLit state. The syntax is
void SetLampLit(string& asName, bool abLit, bool abEffects);
so you want your code to look like this:
AddEntityCollideCallback("Player", "Areagruntactive", "LightFuction", true, 1);
void LightFunction(string &in asParent, string &in asChild, int alState)
{
    SetLampLit("greentorch1", true, false);
}


[Image: at_9365860.png]

Follow Harvest.
08-25-2011, 06:28 AM
Find
Fetishman Offline
Junior Member

Posts: 42
Threads: 3
Joined: Aug 2011
Reputation: 7
#5
RE: Area collide turning on torches problem.

(08-25-2011, 06:28 AM)Phoroneus Wrote: You need to specify the "effects" part of your SetLampLit state. The syntax is
void SetLampLit(string& asName, bool abLit, bool abEffects);
so you want your code to look like this:
AddEntityCollideCallback("Player", "Areagruntactive", "LightFuction", true, 1);
void LightFunction(string &in asParent, string &in asChild, int alState)
{
    SetLampLit("greentorch1", true, false);
}
well i did try that, and i didn't get a fatal error, the only problem is, that now the light won't actually light. it stays unlit.
So what does the effects do exactly?
(This post was last modified: 08-25-2011, 06:38 AM by Fetishman.)
08-25-2011, 06:36 AM
Find
Phoroneus Offline
Member

Posts: 141
Threads: 12
Joined: Feb 2011
Reputation: 0
#6
RE: Area collide turning on torches problem.

I'm not positive, to be honest. I usually just set them to "false". You can try "true", it might be the actual fading in of the light (as seen when you manually light an object with a tinderbox).
I'd also add in "AddDebugMessage("Lights on now.", false);" inside the LightFunction er... function. If you have a dev environment set up, turn on debug messages and you can see if it's a problem with the trigger or the actual execution (if the debug message pops up, the trigger is working and only the SetLampLit function is broken).

[Image: at_9365860.png]

Follow Harvest.
(This post was last modified: 08-25-2011, 07:28 AM by Phoroneus.)
08-25-2011, 07:26 AM
Find
Fetishman Offline
Junior Member

Posts: 42
Threads: 3
Joined: Aug 2011
Reputation: 7
#7
RE: Area collide turning on torches problem.

well, i suppose, instead of making it light, couldn't i just use the set entity active and put another torch on top of the torch that is unlit? then just use the SetEntityActive function to just replace the torches?
08-25-2011, 05:54 PM
Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#8
RE: Area collide turning on torches problem.

If all else fails, that's what I would do is set it active and just do double work unfortuately.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

08-25-2011, 07:29 PM
Website Find
Fetishman Offline
Junior Member

Posts: 42
Threads: 3
Joined: Aug 2011
Reputation: 7
#9
RE: Area collide turning on torches problem.

(08-25-2011, 07:29 PM)JetlinerX Wrote: If all else fails, that's what I would do is set it active and just do double work unfortuately.

thanks jetliner. oh and loved the attic! can't wait for chapter two!
08-26-2011, 02:28 AM
Find
Timmy Offline
Junior Member

Posts: 7
Threads: 1
Joined: Jul 2011
Reputation: 0
#10
RE: Area collide turning on torches problem.

Did you notice that you misspelled "LightFunction" in the addentitycollidecallback part? it is missing an N.
08-26-2011, 08:04 PM
Find




Users browsing this thread: 1 Guest(s)