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
Script Help Levers
assassinhawk45 Offline
Junior Member

Posts: 31
Threads: 11
Joined: Dec 2012
Reputation: 0
#1
Question  Levers

I'm having trouble with scripting a lever. I'm am trying to make it activate a monster, but when I pull it, it doesn't do anything.

Script:
void OnStart()
{
AddEntityCollideCallback("Player", "trap_1", "Jump1", true, 1);
}
void Jump1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("fail_1", true);
}

The Necromancer's Touch: WIP Coming March 2013
01-15-2013, 10:13 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Levers

You are doing it wrong:

Copy&paste this:

void OnStart()
{
SetEntityConnectionStateChangeCallback("lever", "func_shelf");
}


void func_shelf(string &in asEntity, int alState)
{
     if (alState == 1)
     {
     SetEntityActive("fail_1", true);
     }
}
Hope it works!

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-15-2013, 10:17 PM
Find
assassinhawk45 Offline
Junior Member

Posts: 31
Threads: 11
Joined: Dec 2012
Reputation: 0
#3
RE: Levers

Do I have to do anything for the lever? I put the script in and nothing happened. I'm guessing it migh thave to do with something in the level editor, but I'm not sure.

The Necromancer's Touch: WIP Coming March 2013
01-15-2013, 10:26 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Levers

Ofc, change the name of the lever to "lever". The problem must be the names.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
01-15-2013, 10:28 PM
Find
assassinhawk45 Offline
Junior Member

Posts: 31
Threads: 11
Joined: Dec 2012
Reputation: 0
#5
RE: Levers

Thanks, it's working now

The Necromancer's Touch: WIP Coming March 2013
01-15-2013, 10:34 PM
Find




Users browsing this thread: 2 Guest(s)