Frictional Games Forum (read-only)
Moving a fixed object - 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: Moving a fixed object (/thread-14249.html)



Moving a fixed object - Damascus - 03-26-2012

I'm trying to find a way to move an entity to move at or accelerate to a fixed speed in a specific direction. PropForce won't be enough to move the large object I have in mind, and it won't send the Object through the floor, like I want.

I've seen RotateProp send objects through solid objects, is there anything similar for just moving an Object in one direction?



RE: Moving a fixed object - Tanshaydar - 03-26-2012

Make it to a MoveObject from the Model Editor and enter the desired specifications there.


RE: Moving a fixed object - palistov - 03-26-2012

Create a custom entity of MoveObject type. You'll need to tweak settings to get it to move whichever way you want. Just know it moves along the global axes, not the entity's local axes. So the object might not move the direction you expect when you put it in-game.

The API function is on the wiki, it's SetMoveObjectStateExt


RE: Moving a fixed object - Damascus - 03-26-2012

So if I wanted to move it down through the floor I would say, set it's aiState = 0 for its normal position and aiState = 1 for where it's supposed to go to in the floor?

And hmm, I also seem to need a way to turn a Static Object into an Entity.



RE: Moving a fixed object - palistov - 03-26-2012

It depends. The default setting sends MoveObjects along the positive axis they are assigned. To change that you need to set its max state to a negative value in the user-defined variables window.

That way scripting the object to move to a positive state actually sends it downwards, and vice versa. Or you could just leave the entity as-is and script it to move to a positive state via script.

To make an entity out of a static object, copy all the appropriate files of that static object and paste it into a new folder, which you'll place under the entities directory of both TDD's root and your custom story's root. You need to place it in both directories because the level editor needs to find the object in Amnesia's files to place it, and it needs to be in the custom story directory so when others download and run your story, the entity loads up.

I suggest building it from either of the two directories then copying and pasting it over.

Just import the COLLADA file (.dae) in the ModelEditor and 1) Give it a body using the shape tool & converting to body. 2) Change it to MoveObject type. 3) Change all other relevant variables under user-defined variables.


RE: Moving a fixed object - Damascus - 03-26-2012

EDIT: (nevermind)



RE: Moving a fixed object - Damascus - 03-27-2012

Alright, it worked! Thanks everyone! Took forever to create a body for my spiral staircase, and it's kind of hard to walk up it, but I'll keep working on that!