Fetishman
Junior Member
Posts: 42
Threads: 3
Joined: Aug 2011
Reputation:
7
|
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 |
|
Juby
Senior Member
Posts: 290
Threads: 2
Joined: May 2011
Reputation:
5
|
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 |
|
Fetishman
Junior Member
Posts: 42
Threads: 3
Joined: Aug 2011
Reputation:
7
|
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 |
|
Phoroneus
Member
Posts: 141
Threads: 12
Joined: Feb 2011
Reputation:
0
|
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);
}
|
|
08-25-2011, 06:28 AM |
|
Fetishman
Junior Member
Posts: 42
Threads: 3
Joined: Aug 2011
Reputation:
7
|
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 isvoid 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 |
|
Phoroneus
Member
Posts: 141
Threads: 12
Joined: Feb 2011
Reputation:
0
|
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).
(This post was last modified: 08-25-2011, 07:28 AM by Phoroneus.)
|
|
08-25-2011, 07:26 AM |
|
Fetishman
Junior Member
Posts: 42
Threads: 3
Joined: Aug 2011
Reputation:
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 |
|
JetlinerX
Senior Member
Posts: 599
Threads: 49
Joined: Jun 2011
Reputation:
19
|
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.
|
|
08-25-2011, 07:29 PM |
|
Fetishman
Junior Member
Posts: 42
Threads: 3
Joined: Aug 2011
Reputation:
7
|
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 |
|
Timmy
Junior Member
Posts: 7
Threads: 1
Joined: Jul 2011
Reputation:
0
|
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 |
|
|