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"
stevenbocco Offline
Junior Member

Posts: 28
Threads: 15
Joined: May 2012
Reputation: 0
#1
Script with the "sewer door"

Hey guys,
so i got a new challenge for you.
i want to make a "sewer" you know that one from the game when you first meet the water monster,
so i want to make a wheel to turn and when you turn it the sewer door will match the wheel when it turn, how to i do that, what scripts and what should i write Smile?
(This post was last modified: 05-25-2012, 05:59 PM by stevenbocco.)
05-25-2012, 02:26 PM
Find
Datguy5 Offline
Senior Member

Posts: 629
Threads: 25
Joined: Dec 2011
Reputation: 12
#2
RE: Script with the "sewer door"

Check the water level script and see how they did it.

(This post was last modified: 05-25-2012, 02:43 PM by Datguy5.)
05-25-2012, 02:42 PM
Find
Putmalk Offline
Senior Member

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

InteractConnectPropWithMoveObject(string& asName, string& asPropName, string& asMoveObjectName, bool abInteractOnly,
bool abInvert, int alStatesUsed);

So a script would look like:

void OnStart()
{
InteractConnectPropWithMoveObject("wheeltodoor1", "valve_rusty_1", "castle_portcullis_1", true, false, 0);
}

05-25-2012, 02:43 PM
Find
stevenbocco Offline
Junior Member

Posts: 28
Threads: 15
Joined: May 2012
Reputation: 0
#4
RE: Script with the "sewer door"

(05-25-2012, 02:43 PM)Putmalk Wrote: i see but what is the valve_rusty_1 Smile other wise im greatfull thanks Smile!
05-25-2012, 02:48 PM
Find
Putmalk Offline
Senior Member

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

It's just a random name of the wheel.

You have a wheel prop and a door prop.

Wheel prop in my example was called "Valve_rusty_1" but that's just anything, it can be any name as long as it exists on the map.

Door prop same thing, the example I used was "Castle_portcullis_1".

05-25-2012, 02:55 PM
Find
stevenbocco Offline
Junior Member

Posts: 28
Threads: 15
Joined: May 2012
Reputation: 0
#6
RE: Script with the "sewer door"

(05-25-2012, 02:55 PM)Putmalk Wrote: It's just a random name of the wheel.

You have a wheel prop and a door prop.

Wheel prop in my example was called "Valve_rusty_1" but that's just anything, it can be any name as long as it exists on the map.

Door prop same thing, the example I used was "Castle_portcullis_1".

so if i got this right, Castle_portcullis_1 is the door name? Valve_rusty_1 is the wheel name that i've placed on the map but what is then "wheeltodoor"?
im really cofussed, im sorry for taking your time man :/
05-25-2012, 03:07 PM
Find
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
stevenbocco Offline
Junior Member

Posts: 28
Threads: 15
Joined: May 2012
Reputation: 0
#8
RE: Script with the "sewer door"

(05-25-2012, 03:16 PM)Putmalk Wrote: okey so i think that im sure Big Grin but i can just put this to the void OnStart Big Grin? create the entitys in the map and then it will work Big Grin?
05-25-2012, 03:32 PM
Find
Putmalk Offline
Senior Member

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

Yuppp. That should do it.

05-25-2012, 03:34 PM
Find
stevenbocco Offline
Junior Member

Posts: 28
Threads: 15
Joined: May 2012
Reputation: 0
#10
RE: Script with the "sewer door"

(05-25-2012, 03:34 PM)Putmalk Wrote: yes it work thanks alot just one more problem it's moving to fast Sad xD
05-25-2012, 03:40 PM
Find




Users browsing this thread: 1 Guest(s)