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
Learning the ropes: literally
R. Peters Offline
Junior Member

Posts: 48
Threads: 10
Joined: Apr 2012
Reputation: 0
#1
Learning the ropes: literally

Hey guys, new guy here. I'm just about to release my first custom story, so I like to think I have a moderate understanding of scripting (I can open doors with keys AND make enemies patrol, get me Tongue). However, I recently decided to challenge myself to create a puzzle using more or less the only thing I didn't know about: Ropes.

I built a map, came up with a premise for the use of the rope and so far it's gone ok. In fact, it'd be fully functional in terms of actually being able to get past the puzzle, but for some reason whenever the rope is slacked too much, or one end of the rope is at a lower height than the other, the rope goes through the floor.

So, in the spirit of learning and helping etc., I was hoping that the pro's on here could submit not any knowledge about how my problem could be solved, but also any additional information about ropes that new-ish coders like myself may find useful when working with ropes in the game. Thanks, and I hope this helps plenty of people that find ropes annoying like myself. Smile

Author of: - A Morbid New Year (Also available as a full conversion).
04-12-2012, 07:35 AM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#2
RE: Learning the ropes: literally

Ropes are a bit annoying, they do not have any collision properties so there is pretty much no way to solve your problem unfortunately. There are a couple of workarounds, like with everything.

You can connect the end of your rope which is falling through the floor to a small (invisible) entity which collides. Then attach another rope to this entity. The result will be a rope with collision properties, but only at that one point. The rest of the rope will still fall through stuff.

I'm not great with ropes myself, so I can't give you some 'Pro-tips' but your best bet would be to keep rope entities simple, and try not to set them up in a way that makes them go through floors, because it is a pain to get them looking nice when they do that.

04-12-2012, 04:58 PM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#3
RE: Learning the ropes: literally

Thought I'd just add:
I've been playing around with ropes recently and I've found out a few things.
- First off, setting the string's tension (I've forgot the parameter name - it's default value is 4) too high, the game will crash. I set the value to 100 and I got a blackbox error.
Setting Automove to true will instantly drop the rope to it's maxlength on start, even if the end entity is held at it's minimum length. If you don't want the rope to extend instantly, you will have to script it (look at bottom point)
- You can attach bodies to the rope by suffixing with the body name, ie: "cabinet_leftDoor".
- For some objects, physics will seem very strange when attached to a rope. You will have to make a joint between the main physics body and the point where the rope connects to fix it.
- Finally, there is a function called InteractConnectPropWithRope("","","", , , , , , , );
This behaves like InteractConnectPropWithMoveObject, except it has more parameters (some of which I don't understand, like alUsedStates or abInteractOnly
You can connect the rope directly to a wheel so spinning the wheel raise/lowers the rope, or you can connect the wheel to a door aswell (offscreen), so raise/lowering the door with script will spin the wheel, whiich raise/lowers the rope.
There is no other way to change the height of rope with script. I believe FG did it this way in Justine. Smile


(This post was last modified: 04-13-2012, 12:39 PM by DRedshot.)
04-13-2012, 12:30 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#4
RE: Learning the ropes: literally

I have a bit of experience with ropes (see ~1:50 at the video).





What would you like to know how to do?

04-13-2012, 04:54 PM
Find
R. Peters Offline
Junior Member

Posts: 48
Threads: 10
Joined: Apr 2012
Reputation: 0
#5
RE: Learning the ropes: literally

(04-13-2012, 04:54 PM)Putmalk Wrote: I have a bit of experience with ropes (see ~1:50 at the video).

What would you like to know how to do?


Well my main questions are as follows, some of them have already been answered by the previous posters but:

- is there a way to stop ropes going through the floor? (i.e, have some collision).

- is there a way to make ropes disappear or appear? (something like set entity active, 'active' for the rope areas doesn't seem to work.)

However, the main purpose of this thread is to help anyone who's trying to work with ropes, not just me Smile I couldn't see any major threads about ropes, so I figured i'd start one. Any additional insight into 'tricks' with ropes would be appreciated by me, and hopefully more Smile

Author of: - A Morbid New Year (Also available as a full conversion).
04-13-2012, 07:32 PM
Find
Putmalk Offline
Senior Member

Posts: 290
Threads: 13
Joined: Apr 2012
Reputation: 15
#6
RE: Learning the ropes: literally

(04-13-2012, 07:32 PM)R. Peters Wrote:
(04-13-2012, 04:54 PM)Putmalk Wrote: I have a bit of experience with ropes (see ~1:50 at the video).

What would you like to know how to do?


Well my main questions are as follows, some of them have already been answered by the previous posters but:

- is there a way to stop ropes going through the floor? (i.e, have some collision).

- is there a way to make ropes disappear or appear? (something like set entity active, 'active' for the rope areas doesn't seem to work.)

However, the main purpose of this thread is to help anyone who's trying to work with ropes, not just me Smile I couldn't see any major threads about ropes, so I figured i'd start one. Any additional insight into 'tricks' with ropes would be appreciated by me, and hopefully more Smile
1. Attach a small "invisible_box_mass" to the rope, that's what the EndBody should point to. If it's small, then when it collides with the floor, it should stop and the rope shouldn't go further down. However, the ropes themselves don't have collision, and that is an unavoidable problem. If you notice in base Amnesia (and in the custom story I'm working on that I posted), the ropes are built in a way so that it is impossible for them to actually hit something and go through them (minus those pulleys that hold the ropes together, but they're designed to accommodate that and look nice).

Note that the invisible_box_mass is an object and, even though it is invisible, can still be interacted with like it's an object. If you push into it, the rope will follow the object, it will fall and the rope will go with it. So the rope won't act like a real rope, it'll act like it's a rope attached to a bucket or something.

You can always adjust the parameters of the rope through the RopeAreas. I had to adjust Min and Max length, for example, to prevent the first two ropes (from the crank to the two pulleys) so that they wouldn't sink so deep from the floor. Good values would be like .5 -> 4, or .5 -> 3.5 or so. You have to experiment and test it out yourself.

2. Have you tried SetEntityActive? I myself haven't, and this is not used anywhere in the base game. Maybe that'll work, use it on the PosNode and RopeArea and see if the rope still exist afterwards. If not, then I do not think this is possible.

04-13-2012, 07:47 PM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#7
RE: Learning the ropes: literally

Quote:is there a way to make ropes disappear or appear? (something like set
entity active, 'active' for the rope areas doesn't seem to work.)

You could set the rope length to 0. It would give the illusion that it doesn't exist.
Of course, anything that was attached to it would be hanging from the endpoint, so you would have to set the entityinactive (Unless you want it that way)

Changing rope length in script is quite tricky. First you must place a slide-door and a wheel/valve (Both out of sight)
Put the following script OnStart():
InteractConnectPropWithRope("RopeWheelConnect", "wheel", "rope" , false , 3 , 10 , 50 , false , 1);
InteractConnectPropWithMoveObject("DoorWheelConnect", "wheel", "door", true, false, 1);

Now you are all set to adjust the rope with script!
What you do is use "SetMoveObjectStateExt("door", afAmount, 15.0f, 20.0f, 0.0f, false);"
This command raises the door, which spins the wheel, which pulls the rope down!
If you set the ropes minimum length to zero, moving the door to position 0.0f will essentially make the rope disapppear. This also has the advantage of keeping the rope under your control more, without it stretching more or less than you want.





04-13-2012, 10:04 PM
Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#8
RE: Learning the ropes: literally

Make a decent model of a rope, make an entity of it connecting segments and using physics to connect them and then you'll have a rope with collision.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
04-13-2012, 10:38 PM
Find
R. Peters Offline
Junior Member

Posts: 48
Threads: 10
Joined: Apr 2012
Reputation: 0
#9
RE: Learning the ropes: literally

(04-13-2012, 07:47 PM)Putmalk Wrote:
(04-13-2012, 07:32 PM)R. Peters Wrote:
(04-13-2012, 04:54 PM)Putmalk Wrote: I have a bit of experience with ropes (see ~1:50 at the video).

What would you like to know how to do?


Well my main questions are as follows, some of them have already been answered by the previous posters but:

- is there a way to stop ropes going through the floor? (i.e, have some collision).

- is there a way to make ropes disappear or appear? (something like set entity active, 'active' for the rope areas doesn't seem to work.)

However, the main purpose of this thread is to help anyone who's trying to work with ropes, not just me Smile I couldn't see any major threads about ropes, so I figured i'd start one. Any additional insight into 'tricks' with ropes would be appreciated by me, and hopefully more Smile
1. Attach a small "invisible_box_mass" to the rope, that's what the EndBody should point to. If it's small, then when it collides with the floor, it should stop and the rope shouldn't go further down. However, the ropes themselves don't have collision, and that is an unavoidable problem. If you notice in base Amnesia (and in the custom story I'm working on that I posted), the ropes are built in a way so that it is impossible for them to actually hit something and go through them (minus those pulleys that hold the ropes together, but they're designed to accommodate that and look nice).

Note that the invisible_box_mass is an object and, even though it is invisible, can still be interacted with like it's an object. If you push into it, the rope will follow the object, it will fall and the rope will go with it. So the rope won't act like a real rope, it'll act like it's a rope attached to a bucket or something.

You can always adjust the parameters of the rope through the RopeAreas. I had to adjust Min and Max length, for example, to prevent the first two ropes (from the crank to the two pulleys) so that they wouldn't sink so deep from the floor. Good values would be like .5 -> 4, or .5 -> 3.5 or so. You have to experiment and test it out yourself.

2. Have you tried SetEntityActive? I myself haven't, and this is not used anywhere in the base game. Maybe that'll work, use it on the PosNode and RopeArea and see if the rope still exist afterwards. If not, then I do not think this is possible.


Cheers Smile That's a great work-around, i've tried it in a basic way and it seems to work. Sadly setEntityActive doesn't seem to work though. I guess there are some things I will have to accept Amnesia isn't set up for doing, but this should help. Thanks Smile

Author of: - A Morbid New Year (Also available as a full conversion).
04-15-2012, 12:47 PM
Find




Users browsing this thread: 1 Guest(s)