Frictional Games Forum (read-only)
Speed of a spinning wheel? - 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: Speed of a spinning wheel? (/thread-21020.html)



Speed of a spinning wheel? - DeAngelo - 04-02-2013

OK, so after a few hours of tinkering I finally managed to accomplish what I was trying to do: a custom entity that can spin. I did it by putting a hing joint into the entity and setting it as a wheel in the user variables. Second thing I wanted to do is make the wheel spin 540 degrees when the player enters a scrip area. Did that by using SetWheelAngle("custom_wheel", 540, true);

It does what I want but the problem is it spins at supersonic speeds. I want it to be much slower and unfortunately that script doesn't seem to account for the speed. I've tried changing "moveMaxSpeed" in the user variables of the entity to a really low number but that doesn't change anything.

Any ideas?

Thanks in advance.


RE: Speed of a spinning wheel? - PutraenusAlivius - 04-02-2013

What you're saying is that when you enter a script area, the wheel will turn 540 degrees? If you're trying to make it turn like it did on the vanilla game (FYI, vanilla game is the original one Wink), i think you're using the wrong perimeter.


RE: Speed of a spinning wheel? - DeAngelo - 04-02-2013

(04-02-2013, 08:45 AM)JustAnotherPlayer Wrote: What you're saying is that when you enter a script area, the wheel will turn 540 degrees?

Yes, this is what I'm trying to do. If by "The way it did in the vanilla game" you mean the whole "clicking on the wheel and spinning your mouse" stuff, that's not what I'm going for (I actually don't want to let the player even interact with the wheel.)


RE: Speed of a spinning wheel? - PutraenusAlivius - 04-02-2013

(04-02-2013, 08:51 AM)DeAngelo Wrote:
(04-02-2013, 08:45 AM)JustAnotherPlayer Wrote: What you're saying is that when you enter a script area, the wheel will turn 540 degrees?

Yes, this is what I'm trying to do. If by "The way it did in the vanilla game" you mean the whole "clicking on the wheel and spinning your mouse" stuff, that's not what I'm going for (I actually don't want to let the player even interact with the wheel.)
What i meant is that the wheel moves automatically and the player won't be able to interact with it. As you can see in the Machine Room level, the cogs move automatically, never stops and cannot be interacted.


RE: Speed of a spinning wheel? - DeAngelo - 04-02-2013

(04-02-2013, 08:55 AM)JustAnotherPlayer Wrote:
(04-02-2013, 08:51 AM)DeAngelo Wrote:
(04-02-2013, 08:45 AM)JustAnotherPlayer Wrote: What you're saying is that when you enter a script area, the wheel will turn 540 degrees?

Yes, this is what I'm trying to do. If by "The way it did in the vanilla game" you mean the whole "clicking on the wheel and spinning your mouse" stuff, that's not what I'm going for (I actually don't want to let the player even interact with the wheel.)
What i meant is that the wheel moves automatically and the player won't be able to interact with it. As you can see in the Machine Room level, the cogs move automatically, never stops and cannot be interacted.

Yeah, something like that. I was looking at the Water Wheel script in the sewer level and they're using RotatePropToSpeed But I gotta make it only do it 540 degrees instead of continuous.

maybe instead of having it be a wheel, I can make it a static prop, user the rotateproptospeed thing then use a very rigidly timed timer to stop the rotation when it gets to 540.

Only problem is the object is supposed to be inactive until at first and I can't do that with static props. Perhaps I can make a script area right where the prop should be then use the "create prop" script to make it appear then make it spin. I'll mess with all this and see what I can get going.


RE: Speed of a spinning wheel? - PutraenusAlivius - 04-02-2013

(04-02-2013, 09:01 AM)DeAngelo Wrote:
(04-02-2013, 08:55 AM)JustAnotherPlayer Wrote:
(04-02-2013, 08:51 AM)DeAngelo Wrote:
(04-02-2013, 08:45 AM)JustAnotherPlayer Wrote: What you're saying is that when you enter a script area, the wheel will turn 540 degrees?

Yes, this is what I'm trying to do. If by "The way it did in the vanilla game" you mean the whole "clicking on the wheel and spinning your mouse" stuff, that's not what I'm going for (I actually don't want to let the player even interact with the wheel.)
What i meant is that the wheel moves automatically and the player won't be able to interact with it. As you can see in the Machine Room level, the cogs move automatically, never stops and cannot be interacted.

Yeah, something like that. I was looking at the Water Wheel script in the sewer level and they're using RotatePropToSpeed But I gotta make it only do it 540 degrees instead of continuous.

maybe instead of having it be a wheel, I can make it a static prop, user the rotateproptospeed thing then use a very rigidly timed timer to stop the rotation when it gets to 540.

Only problem is the object is supposed to be inactive until at first and I can't do that with static props. Perhaps I can make a script area right where the prop should be then use the "create prop" script to make it appear then make it spin. I'll mess with all this and see what I can get going.

Seriously? It's that easy. Add a sticky area to the place where the cogs will be placed. When it's attached, de-activate the entity and activate the static prop. When it's turned to 540, test how many seconds and placement of it. Then test it out.
EDIT:
Make a script area at the place where the cog is in place, and script it so that when it's attached, it deactivates and the static prop activates.


RE: Speed of a spinning wheel? - DeAngelo - 04-02-2013

Huzzah! Took forever to find the sweetspot on the timer to make the spinning stop at just the right angle, but I got it working. Thanks Smile


RE: Speed of a spinning wheel? - PutraenusAlivius - 04-03-2013

(04-02-2013, 10:37 AM)DeAngelo Wrote: Huzzah! Took forever to find the sweetspot on the timer to make the spinning stop at just the right angle, but I got it working. Thanks Smile

No problemo. Now i got my own s**t to deal with.