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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Levers
Angerpull Offline
Member

Posts: 88
Threads: 24
Joined: Jun 2011
Reputation: 0
#11
RE: Levers

(07-27-2011, 09:50 PM)Kyle Wrote:
(07-27-2011, 09:35 PM)Angerpull Wrote:
(07-27-2011, 09:26 PM)Kyle Wrote: Make sure that everything is named correctly, or else I have hardly an idea why it's messing up. :/

Everything is named correctly. Why won't it work? Can you maybe make your own level and name the door and the lever the same and test it?

I made it exactly with the same names and the same script pieces. It works perfectly, and the way it should. I'm not sure why it doesn't work for you... :/

:C This is just stupid.
07-27-2011, 10:02 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#12
RE: Levers

void OnStart()
{
SetEntityConnectionStateChangeCallback("Slaver_Lever", "Lever_Slaver");
}
void Lever_Slaver(string &in asEntity, int alState)
{
if (alState == 1)
{
SetSwingDoorLocked("Slaver_Lever_Door", false, true);
AddDebugMessage("Door should unlock", false);
}
}

turn on debug messages and see if that message appears. If it does, the lever is fine but the door is misspelled or something somehow.
07-27-2011, 10:14 PM
Find
Angerpull Offline
Member

Posts: 88
Threads: 24
Joined: Jun 2011
Reputation: 0
#13
RE: Levers

(07-27-2011, 10:14 PM)Roenlond Wrote: void OnStart()
{
SetEntityConnectionStateChangeCallback("Slaver_Lever", "Lever_Slaver");
}
void Lever_Slaver(string &in asEntity, int alState)
{
if (alState == 1)
{
SetSwingDoorLocked("Slaver_Lever_Door", false, true);
AddDebugMessage("Door should unlock", false);
}
}

turn on debug messages and see if that message appears. If it does, the lever is fine but the door is misspelled or something somehow.

No it doesn't work, and IDK what you meant about debug stuff, so I'll just skip that. Is there something I have to do with the lever? It starts at the middle, and I can move the lever up and down... but nothing happens, it doesn't stay in place when it's supposed to be "Activated" It just slides back to it's original position.
07-27-2011, 10:41 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#14
RE: Levers

Debug messages are really helpful to try and determine where the problem is in your script. You turn on debug messages by pressing F1 while in-game if you are in a dev environment (which you really should be - http://wiki.frictionalgames.com/hpl2/amn...evenvguide)

In this example, I simply wrote the command "AddDebugMessage("Door should unlock", false);" which will display the messages "Door should unlock" in the bottom edge of your screen if you have debug messages turned on. If it doesn't show up, it means that something is messed up with either the lever name or the "void Lever_Slaver(string &in asEntity, int alState)" part. If it do show up however, something is wrong with the "
SetSwingDoorLocked("Slaver_Lever_Door", false, true);" part, most probably the same, since the function is ran without problems.
07-27-2011, 10:46 PM
Find




Users browsing this thread: 1 Guest(s)