Frictional Games Forum (read-only)
Wheel open door. - 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: Wheel open door. (/thread-17149.html)



Wheel open door. - ShyGuySays - 07-20-2012

Sorry for all the questions recently, but I was wondering how to trigger an event when a wheel (in this case a torture wheel) is completely turned (hits the stopping point). I was looking through the engine scripts and I am unsure of which one would suit my needs.


RE: Wheel open door. - Your Computer - 07-20-2012

SetEntityConnectionStateChangeCallback


RE: Wheel open door. - ShyGuySays - 07-20-2012

Would this make it so it triggers at the end, or just when you start turning it?


RE: Wheel open door. - Your Computer - 07-21-2012

(07-20-2012, 09:48 PM)ShyGuySays Wrote: Would this make it so it triggers at the end, or just when you start turning it?

Some things can be answered on their own.

It would trigger at the end.


RE: Wheel open door. - ShyGuySays - 07-21-2012

Thank you, sir. You are a gentleman and a scholar.


RE: Wheel open door. - BonesTheRabbit - 10-07-2013

Sorry to necro this thread, but it's the only one I could find on this particular subject. I've been trying to get this working, and I'm guessing I'm doing something silly, because it just doesn't want to work with me.

Code:
void OnEnter()
{    
    SetEntityConnectionStateChangeCallback("EntityName", "FunctionName");
}

void FunctionName(string &in asEntity, int ValveState)
{    
    if (ValveState == 1)
    {
        SetPropObjectStuckState("EntityName", 1);
        PlaySoundAtEntity("", "explosion_rock_large.snt", "Player", 0.0f, false);
    }
}

I've triple checked the entity name, but the valve isn't locking, and the sound isn't playing. I've been looking through various tutorials, though most deal with levers, and I guess something is different between them? I have a valve which opens a sliding door elsewhere on my map, and that works fine, but this one is proving problematic.

Any help would be greatly appreciated.