Frictional Games Forum (read-only)
Script with the "sewer door" - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Script with the "sewer door" (/thread-15618.html)

Pages: 1 2


Script with the "sewer door" - stevenbocco - 05-25-2012

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?


RE: Script with the "sewer door" - Datguy5 - 05-25-2012

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


RE: Script with the "sewer door" - Putmalk - 05-25-2012

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

So a script would look like:

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



RE: Script with the "sewer door" - stevenbocco - 05-25-2012

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



RE: Script with the "sewer door" - Putmalk - 05-25-2012

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".


RE: Script with the "sewer door" - stevenbocco - 05-25-2012

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



RE: Script with the "sewer door" - Putmalk - 05-25-2012

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


RE: Script with the "sewer door" - stevenbocco - 05-25-2012

(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?



RE: Script with the "sewer door" - Putmalk - 05-25-2012

Yuppp. That should do it.


RE: Script with the "sewer door" - stevenbocco - 05-25-2012

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