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
Work in progress Lights , cant get them to activate (noob)
MacKetchup Offline
Junior Member

Posts: 25
Threads: 10
Joined: Apr 2013
Reputation: 0
#1
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
Find
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
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.

PHP Code: (Select All)
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);


Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 04-17-2014, 03:56 PM by Romulator.)
04-17-2014, 03:55 PM
Find
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#3
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
Find
MacKetchup Offline
Junior Member

Posts: 25
Threads: 10
Joined: Apr 2013
Reputation: 0
#4
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 Big Grin appreciate the fast help
04-17-2014, 03:59 PM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#5
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
Find
MacKetchup Offline
Junior Member

Posts: 25
Threads: 10
Joined: Apr 2013
Reputation: 0
#6
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 Big Grin
04-17-2014, 04:52 PM
Find




Users browsing this thread: 1 Guest(s)