Frictional Games Forum (read-only)
Lever problems. - 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)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Lever problems. (/thread-24870.html)



Lever problems. - Slanderous - 03-17-2014

Hey guys, so I've been making a script that player must pull down a lever in order to move the door (safety_large_vert.ent)

I did it, but for unknown reason for me it doesn't work.

Here is the script:

Spoiler below!
PHP Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("lever_1""move1");
}

void move1(string &in entityint alState)
{
     if(
alState == 1)
     {
    
SetMoveObjectState("wejscie_1",1.0f);
    
SetPropStaticPhysics("lever_1"true);
     }



Is it caused because of the entity? As I wrote above it's safety_large_vert.ent


RE: Lever problems. - Mudbill - 03-17-2014

Does nothing happen? Does it crash? Is this all the script?
It does looks pretty alright to me. Any typos in names?


RE: Lever problems. - Slanderous - 03-17-2014

(03-17-2014, 11:08 PM)Mudbill Wrote: Does nothing happen? Does it crash? Is this all the script?
It does looks pretty alright to me. Any typos in names?

Nothing happens. Just loads up map normally, and it doesn't work.
There is no typos for sure. Perhaps it's caused by a map cache file, I deleted that son of a bitch, but then I returned to Level Editor and it created again... I'm gonna delete it again and post if that helped.

EDIT: Nope, nothing happens. Perhaps it's caused by the entity itself?


RE: Lever problems. - Mudbill - 03-17-2014

Do you have dev environment? If so, add a debug message to check if this happens like it should. If not, just add something noticeable in there and check it if executes. Something like SetMessage perhaps.


RE: Lever problems. - Slanderous - 03-18-2014

Hmm, this seems to be very weird. I added a debug message, and now it's working fine. Some paranormal stuff goin' up with my notepad++ I see o.O


RE: Lever problems. - Mudbill - 03-18-2014

It's the Script Poltergeists! :O