Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Candle fade
Post your script.
|
|
11-09-2011, 01:51 PM |
|
proshitness
Junior Member
Posts: 20
Threads: 3
Joined: Nov 2011
Reputation:
0
|
RE: Candle fade
void OnStart()
{
AddEntityCollideCallback("Player", "Lights_Out", "LampsOff_func", true, 1);
}
void OnEnter()
{
}
void OnLeave()
{
}
void LampsOff_func(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_static01_1", false, true);
SetLampLit("torch_static01_2", false, true);
SetLampLit("torch_static01_3", false, true);
SetLampLit("torch_static01_4", false, true);
SetLampLit("torch_static01_5", false, true);
SetLampLit("torch_static01_6", false, true);
}
void SetLampLit(string& asName, bool abLit, bool abEffects);
|
|
11-09-2011, 02:00 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Candle fade
Try this:
void OnStart() { AddEntityCollideCallback("Player", "Lights_Out", "LampsOff_func", true, 1); }
void OnEnter() { }
void OnLeave() { }
void LampsOff_func(string &in asParent, string &in asChild, int alState) { if (asChild == "Lights_Out") { SetLampLit("torch_static01_1", false, true); SetLampLit("torch_static01_2", false, true); SetLampLit("torch_static01_3", false, true); SetLampLit("torch_static01_4", false, true); SetLampLit("torch_static01_5", false, true); SetLampLit("torch_static01_6", false, true); } }
|
|
11-09-2011, 02:26 PM |
|
proshitness
Junior Member
Posts: 20
Threads: 3
Joined: Nov 2011
Reputation:
0
|
RE: Candle fade
didn't work...=\
maybe i need to use something else then the torch_static01
|
|
11-09-2011, 02:49 PM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Candle fade
Do you have a script area in your map named "Lights_Out"? Do you have 6 torch_static01 entities in your map?
|
|
11-09-2011, 03:47 PM |
|
proshitness
Junior Member
Posts: 20
Threads: 3
Joined: Nov 2011
Reputation:
0
|
RE: Candle fade
Yes and yes
do the torches need to be inside the area script?
(This post was last modified: 11-09-2011, 06:28 PM by proshitness.)
|
|
11-09-2011, 03:47 PM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: Candle fade
(11-09-2011, 03:47 PM)proshitness Wrote: Yes and yes
do the torches need to be inside the area script? No they do not. They can be anywhere. the area is just there to trigger the script when the player walks into it. Try using a different torch and see if it does anything. Also, try to make sure the area is a "SCRIPT" area, not a insanity area, spawn area, etc. could be a simple little mistake. the script is fine. something is wrong in the level itself is my best guess.
|
|
11-09-2011, 09:58 PM |
|
proshitness
Junior Member
Posts: 20
Threads: 3
Joined: Nov 2011
Reputation:
0
|
RE: Candle fade
ok i changed the torches and still didn't work, i check and the area is a script what can i do? =\
|
|
11-09-2011, 10:06 PM |
|
Statyk
Schrödinger's Mod
Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation:
241
|
RE: Candle fade
I'll try to mimic this exact scenario to see if it works. If it does, something may be wrong between your .hps and map. do their names match exactly?
example:
NOT:
- TorchMap.map
- Torchmap.hps
IS SHOULD BE:
- TorchMap.map
- TorchMap.hps
Simple things make a BIG difference. One of my scripts failed because I typed it "PlaySoundatEntity..." the "a" was not capitalized.
Just did it and it worked perfectly... Make sure your names of areas and torches match EXACTLY. I caught myself titling the area: "LightsOut" when in the script, it asks for "Lights_Out" again... Make sure EVERY LETTER matches EXACTLY.
My only guess of this situation is that you didn't title something right.
(This post was last modified: 11-09-2011, 10:22 PM by Statyk.)
|
|
11-09-2011, 10:12 PM |
|
proshitness
Junior Member
Posts: 20
Threads: 3
Joined: Nov 2011
Reputation:
0
|
|
11-09-2011, 10:23 PM |
|
|