Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script with the "sewer door"
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#7
RE: Script with the "sewer door"

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. Sad 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. Tongue

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. :/

05-25-2012, 03:16 PM
Find


Messages In This Thread
Script with the "sewer door" - by stevenbocco - 05-25-2012, 02:26 PM
RE: Script with the "sewer door" - by Datguy5 - 05-25-2012, 02:42 PM
RE: Script with the "sewer door" - by Putmalk - 05-25-2012, 02:43 PM
RE: Script with the "sewer door" - by stevenbocco - 05-25-2012, 02:48 PM
RE: Script with the "sewer door" - by Putmalk - 05-25-2012, 02:55 PM
RE: Script with the "sewer door" - by stevenbocco - 05-25-2012, 03:07 PM
RE: Script with the "sewer door" - by Putmalk - 05-25-2012, 03:16 PM
RE: Script with the "sewer door" - by stevenbocco - 05-25-2012, 03:32 PM
RE: Script with the "sewer door" - by Putmalk - 05-25-2012, 03:34 PM
RE: Script with the "sewer door" - by stevenbocco - 05-25-2012, 03:40 PM
RE: Script with the "sewer door" - by Putmalk - 05-25-2012, 04:09 PM



Users browsing this thread: 1 Guest(s)