Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Work in progress Lights , cant get them to activate (noob)
Author Message
MacKetchup Offline
Junior Member

Posts: 25
Joined: Apr 2013
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Romulator Offline
G'day mate! :3

Posts: 3,503
Joined: Jan 2013
Reputation: 191
Post: #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#4942
[Image: 8f5d099c7b.png]
(This post was last modified: 04-17-2014 03:56 PM by Romulator.)
04-17-2014 03:55 PM
Find all posts by this user Quote this message in a reply
HumiliatioN Offline
Posting Freak

Posts: 1,176
Joined: Dec 2010
Reputation: 18
Post: #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 all posts by this user Quote this message in a reply
MacKetchup Offline
Junior Member

Posts: 25
Joined: Apr 2013
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
PutraenusAlivius Offline
Posting Freak

Posts: 4,712
Joined: Dec 2012
Reputation: 119
Post: #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 all posts by this user Quote this message in a reply
MacKetchup Offline
Junior Member

Posts: 25
Joined: Apr 2013
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)