[SCRIPT] Movable Book [Solved] - 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] Movable Book [Solved] (/thread-25197.html) |
Movable Book [Solved] - ethics - 05-01-2014 I had the idea that if you pull one of these movable books (located in a shelf) a door will be unlocked. I've tried it with SetEntityConnectionStateChangeCallback() but I don't think these books are considered as levers. I also tried to put a script area in front of it, so if I pull the book and it touches the area, a callback will be called. I got stuck there because it seems to work with variables and "if int=1, int=<3, int++" and I don't understand that. Do you have any idea on how to complete this? RE: Movable Book - Mudbill - 05-01-2014 I think what you saw was a for-loop, not an if-statement. For-loops generally look something like PHP Code: for(int i = 0; i <= 3; i++) { They basically repeat the code within for a set amount of times. But you don't need these to make the script area trigger the event. Did you set an AddEntityCollideCallback in OnStart using the book on the area? RE: Movable Book - daortir - 05-01-2014 For one book just add an entitycollidecallback between the book and a small area near it, that calls a function which unlocks the door. No need for variables with only 1 book ! : > RE: Movable Book - ethics - 05-02-2014 (05-01-2014, 09:30 PM)Mudbill Wrote: I think what you saw was a for-loop, not an if-statement. For-loops generally look something like Nope. I just used "SetEntityConnectionStateChangeCallback()". I gonna try that, but yesterday evening I was too confused to figure it out by myself. As always, thanks for your help. (05-01-2014, 10:09 PM)daortir Wrote: For one book just add an entitycollidecallback between the book and a small area near it, that calls a function which unlocks the door. No need for variables with only 1 book ! : > Yeah, I saw that too. I also looked in your script, but it had "for-loops" in it. That confused me quite a bit. Thanks for helping! RE: Movable Book - DnALANGE - 05-02-2014 Solved or? Just a hint Ztp; When your question \ tread is solved add this to your tread so people like me do not have to go into your tread anymore. Do this for example : [SCRIPT] Movable Book = SOLVED RE: Movable Book - ethics - 05-10-2014 (05-02-2014, 02:30 PM)DnALANGE Wrote: Solved or? I'm adding it to all my solved threads now. Thanks for noticing. |