Frictional Games Forum (read-only)

Full Version: Wheel open door.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
SetEntityConnectionStateChangeCallback
Would this make it so it triggers at the end, or just when you start turning it?
(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.
Thank you, sir. You are a gentleman and a scholar.
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.