Frictional Games Forum (read-only)
[WIP] Lights , cant get them to activate (noob) - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+--- Thread: [WIP] Lights , cant get them to activate (noob) (/thread-25093.html)



Lights , cant get them to activate (noob) - MacKetchup - 04-17-2014

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


RE: Lights , cant get them to activate (noob) - Romulator - 04-17-2014

Assuming this is all your code?

If so, then just put the AddEntityCollideCallback in an OnStart() subroutine.

PHP Code:
void OnStart()
{
AddEntityCollideCallback("Player""ScriptArea_5""Light"true1);
}

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);




RE: Lights , cant get them to activate (noob) - HumiliatioN - 04-17-2014

(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.


RE: Lights , cant get them to activate (noob) - MacKetchup - 04-17-2014

(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 Big Grin appreciate the fast help


RE: Lights , cant get them to activate (noob) - PutraenusAlivius - 04-17-2014

Just use "torch_floor_*" for the first SetLampLit argument. Naming them all individually is more tedious (if they all had the same name).


RE: Lights , cant get them to activate (noob) - MacKetchup - 04-17-2014

(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 Big Grin