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. The idea is that a function should trigger when the valve is turned all the way to its endpoint. The names are all just for the sake of clarity, and the functions in the trigger are just for testing.
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'm really stumped. 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.