[SCRIPT] Sliding Shelf - 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] Sliding Shelf (/thread-20811.html) |
Sliding Shelf - CarnivorousJelly - 03-18-2013 I've been trying to make a shelf slide like a secret door for... probably five hours now. I had it moving earlier, but in the wrong direction (positive X instead of positive Z based on world coordinates). This is the current script I'm using for it: Code: void OnEnter() The shelf in question started off being the shelf_secret_door.ent, which I had moving based on "SetMoveObjectState". There were two problems with this: 1. Shelf moved along the X axis (forward), I want it to move along the Z axis (left) 2. The books on the shelf didn't move with it Now I've switched it out for shelf_high_01.ent, which doesn't move at all. with either the SetMoveObjectState or AddPropForce. I've looked at TDD scripts, other CS scripts, checked the forum and the wiki to no avail. If you have any suggestions at all, please help me; I'm completely stumped. Thanks for being so patient with me RE: Sliding Shelf - PutraenusAlivius - 03-18-2013 For shelves and secret doors, use a lever. You cannot do it with a script area. RE: Sliding Shelf - FlawlessHappiness - 03-18-2013 You need to use the shelf, that is called something with secret door. There are 2. One of them is grabable, and it's probably not that one you want. The other one is a bit higher, and it uses SetMoveObjectState. Now you say it moves in the wrong direction. I'm pretty sure other people have had that problem too. First try searching for it. Secondly, try opening the model in the modeleditor, and check how it works. Then try to make it on the Z-axis instead. For the books: There's nothing to do. Those books are static, and if they were movable, it would look strange because that would be large squares of books, moving. What you could do is, to try to make it look realistic with movable books and stuff that could be on this shelf. (03-18-2013, 07:00 AM)JustAnotherPlayer Wrote: For shelves and secret doors, use a lever. You cannot do it with a script area. A script area should not be the problem. SetMoveObjectState does not change whether it's used by a lever or a script area. It doesn't change anything in the script, except for some parameters. RE: Sliding Shelf - NaxEla - 03-18-2013 You just need use a shelf that is a MoveObject (you can check in the model editor what type it is). Then use SetMoveObjectState to move the shelf. If the shelf doesn't move in the right direction, you can change which axis it moves on by opening it in the model editor, then going to Settings > User Defined Variables, and changing the direction that it moves. If the shelf you want to use isn't a MoveObject, just copy the entity file, put it in your custom story folder, change it's type to MoveObject, and then use it in the level editor. RE: Sliding Shelf - Akos115 - 03-18-2013 Shelf_secret_door should work fine, the only problem is that it can only move in one direction. RE: Sliding Shelf - CarnivorousJelly - 03-18-2013 It's working now thanks for the help (all of you)! |