Damascus
Senior Member
Posts: 646
Threads: 118
Joined: Mar 2012
Reputation:
29
|
Moving a fixed object
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?
(This post was last modified: 03-27-2012, 06:57 AM by Damascus.)
|
|
03-26-2012, 07:12 AM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
RE: Moving a fixed object
Make it to a MoveObject from the Model Editor and enter the desired specifications there.
|
|
03-26-2012, 07:14 AM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Moving a fixed object
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
|
|
03-26-2012, 07:15 AM |
|
Damascus
Senior Member
Posts: 646
Threads: 118
Joined: Mar 2012
Reputation:
29
|
RE: Moving a fixed object
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.
|
|
03-26-2012, 07:27 AM |
|
palistov
Posting Freak
Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation:
57
|
RE: Moving a fixed object
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.
(This post was last modified: 03-26-2012, 07:03 PM by palistov.)
|
|
03-26-2012, 07:02 PM |
|
Damascus
Senior Member
Posts: 646
Threads: 118
Joined: Mar 2012
Reputation:
29
|
RE: Moving a fixed object
EDIT: (nevermind)
(This post was last modified: 03-26-2012, 07:40 PM by Damascus.)
|
|
03-26-2012, 07:34 PM |
|
Damascus
Senior Member
Posts: 646
Threads: 118
Joined: Mar 2012
Reputation:
29
|
RE: Moving a fixed object
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!
|
|
03-27-2012, 06:40 AM |
|