MacKetchup
Junior Member
Posts: 25
Threads: 10
Joined: Apr 2013
Reputation:
0
|
Lights , cant get them to activate (noob)
AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true , 1);
void Light(string &in asEntity)
{
SetEntityActive("torch_floor_1", true);
SetEntityActive("torch_floor_2", true);
SetEntityActive("torch_floor_3", true);
SetEntityActive("torch_floor_4", true);
}
Thanks on beforehand
|
|
04-17-2014, 03:39 PM |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
RE: Lights , cant get them to activate (noob)
Assuming this is all your code?
If so, then just put the AddEntityCollideCallback in an OnStart() subroutine.
void OnStart() { AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true, 1); }
void Light(string &in asEntity) { SetEntityActive("torch_floor_1", true); SetEntityActive("torch_floor_2", true); SetEntityActive("torch_floor_3", true); SetEntityActive("torch_floor_4", true); }
Discord: Romulator#0001
(This post was last modified: 04-17-2014, 03:56 PM by Romulator.)
|
|
04-17-2014, 03:55 PM |
|
HumiliatioN
Posting Freak
Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation:
18
|
RE: Lights , cant get them to activate (noob)
(04-17-2014, 03:39 PM)MacKetchup Wrote: AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true , 1);
void Light(string &in asEntity)
{
SetEntityActive("torch_floor_1", true);
SetEntityActive("torch_floor_2", true);
SetEntityActive("torch_floor_3", true);
SetEntityActive("torch_floor_4", true);
}
Thanks on beforehand
Let me fix that for you:
AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true, 1);
void Light(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_floor_1", true, true);
SetLampLit("torch_floor_2", true, true);
SetLampLit("torch_floor_3", true, true);
SetLampLit("torch_floor_4", true, true);
}
You are using wrong function and wrong commands to make the lamps lit.
This should work.
“Life is a game, play it”
|
|
04-17-2014, 03:58 PM |
|
MacKetchup
Junior Member
Posts: 25
Threads: 10
Joined: Apr 2013
Reputation:
0
|
RE: Lights , cant get them to activate (noob)
(04-17-2014, 03:58 PM)HumiliatioN Wrote: (04-17-2014, 03:39 PM)MacKetchup Wrote: AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true , 1);
void Light(string &in asEntity)
{
SetEntityActive("torch_floor_1", true);
SetEntityActive("torch_floor_2", true);
SetEntityActive("torch_floor_3", true);
SetEntityActive("torch_floor_4", true);
}
Thanks on beforehand
Let me fix that for you:
AddEntityCollideCallback("Player", "ScriptArea_5", "Light", true, 1);
void Light(string &in asParent, string &in asChild, int alState)
{
SetLampLit("torch_floor_1", true, true);
SetLampLit("torch_floor_2", true, true);
SetLampLit("torch_floor_3", true, true);
SetLampLit("torch_floor_4", true, true);
}
You are using wrong function and wrong commands to make the lamps lit.
This should work.
Thanks for the help appreciate the fast help
|
|
04-17-2014, 03:59 PM |
|
PutraenusAlivius
Posting Freak
Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation:
119
|
RE: Lights , cant get them to activate (noob)
Just use "torch_floor_*" for the first SetLampLit argument. Naming them all individually is more tedious (if they all had the same name).
"Veni, vidi, vici."
"I came, I saw, I conquered."
|
|
04-17-2014, 04:22 PM |
|
MacKetchup
Junior Member
Posts: 25
Threads: 10
Joined: Apr 2013
Reputation:
0
|
RE: Lights , cant get them to activate (noob)
(04-17-2014, 04:22 PM)SomethingRidiculous Wrote: Just use "torch_floor_*" for the first SetLampLit argument. Naming them all individually is more tedious (if they all had the same name).
Thanks. This is useful if i use a larger amount of torches as for this case
|
|
04-17-2014, 04:52 PM |
|
|