Might be a little late, but for the portcullis/lever problem:
Keep in mind that the portcullis is opened by:
void SetMoveObjectState(string& asName, float afState);
Moves an object to a certain state.
asName - internal name
afState - state of the object, 0 = closed, 1 = open, values inbetween are valid too!
or the extended version with more options:
void SetMoveObjectStateExt(string& asName, float afState, float afAcc, float afMaxSpeed, float afSlowdownDist, bool abResetSpeed);
Moves an object to a certain state, extended method.
asName - internal name
afState - state of the object, 0 = closed, 1 = open, values inbetween are valid too!
afAcc - acceleration
afMaxSpeed - maximum speed
afSlowdownDist - Distance to the target state before decceleration occurs.
abResetSpeed - Set to True if the prop's speed should be reset before performing the movement, else the prop will accelerate from it's current speed to afMaxSpeed.
and the callback for a changed lever:
void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);
A callback called when ever the connection state changes (button being switched on, lever switched, etc).
Callback syntax:
void Func(string &in asEntity, int alState)
alState: -1 = off, 0 = between, 1 = on
Now for the sample:
void OnEnter()
{
SetEntityConnectionStateChangeCallback("LeverNameHere", "OpenPortcullis");
}
void OpenPortcullis(string & in asEntity, int alState)
{
if(alState==1)
{
SetMoveObjectState("PortcullisNameHere", 1);
}
else if(alState==-1)
{
SetMoveObjectState("PortcullisNameHere", 0);
}
}
However, you will have to experiment on which position of the lever you want the portcullis to open or close.