Are you familiar with how scripting works? Have you made a simple door -> key puzzle before? If you have, then you're familiar with object names and referring to them in the script.
In this example, we have a singular function called
InteractConnectPropWithMoveObject.
InteractConnectPropWithMoveObject(string& asName, string& asPropName, string& asMoveObjectName, bool abInteractOnly,
bool abInvert, int alStatesUsed);
This function takes in six parameters. I'll explain them below:
This function connects a prop to an object that can move (like a door) so that when the prop is interacted with, the door will move with it. Hence, the wheel to door connection.
Parameter 1: First, we define a name for the callback. This can be anything. For my example I chose "wheel to door".
Parameter 2 and 3: When we create a wheel entity in the editor, such as valve_rusty, it gets assigned a name, such as valve_rusty_1. This is how the game sees it, how it refers to it, and everything you do that involves valve_rusty_1 will always be attached that one wheel entity. The function asks us to name two entities, one entity that is interacted with, and another that gets moved as a result of that interaction. Parameter 2 is the wheel object, parameter 3 is the door object.
Parameter 4: It's called "InteractOnly" and it's a boolean argument (true or false). I do believe that means it only moves the object when you interact with the entity, so I set this true. Just set it true, it's not worth explaining.
I don't fully understand it myself.
Parameter 5: This, if set to true, inverts the connection. Not very important for what you want to do. Set it false, and don't question it.
Parameter 6: States used, I believe this is referring to the direction that you spin the wheel in. I want it to spin both ways, so I'll put a 0 here. 1 would be spinning toward the maximum value, -1 would be toward the minimum value, but once again, not worth explaining. Just set it to 0.
Hope that helps. Just remember that for parameter 2 and 3, we are putting in the
name of the objects that we want to interact with and affect. If we are interacting with a wheel called
valve_rusty_1, then that is parameter 2, and if we want the door
castle_portcullis_1 to move, then that is what we place in parameter 3.
Can't explain it anymore than this, if you are confused then I don't know what to do. :/