"Float" Chest open - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: "Float" Chest open (/thread-5786.html) |
"Float" Chest open - Endrek03 - 12-19-2010 Hey all, I got my lever solution somewhat figured out -- It works for the most part, I'm sure I can tweak a few things. So, after the player completes the Lever Puzzle, I want the character to look at a chest, which will then open slowly revealing the player has pulled the levers correctly. To do this, I have used: Code: void ChestLookAt(string &in asTimer) This adds the perfect propulsion to make the chest open somewhat slowly. Truth be told I would love to have it open even slower, but I have yet to figure out the exact math behind it. You'd think a lesser impulse with a more frequent timer would do the trick. . . but it seems to suck at getting over that initial opening harrumph. If anyone could help with this, that'd be great, but it's only a side thing; I'm okay with how much it opens now. That being said, as you can see the Timer basically calls upon itself in 0.01 "impulses" to fake the chest being opened slowly at that specific speed. The problem is, in my limited knowledge of coding, I don't know how to basically cancel out that timer. The chest keeps opening, and if you, the player, try to close it it just keeps opening and opening. I tried adding a secondary timer that after 1 second (The time it takes roughly for the chest to open), it would remove itself. I figured even if the script ran 1,000 times in 1 second it would still cancel itself just as fast. Of course, this is me at 4:30 AM thinking this, so I could be off. . . . . . . . . anyways. Point being is is there an easier way to do this or something I'm missing? I'd like the chest to stop opening once it has opened, and that seems to require a way to cancel a script that continuously calls on itself. RE: "Float" Chest open - Frontcannon - 12-19-2010 I had the same problem two with a timer loop and AddPropForce, but I forgot how I solved it, but the thread isn't that old, you'll find it on here.. |