Levers in different levels - 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: Levers in different levels (/thread-23241.html) |
Levers in different levels - LankySpankey103 - 09-17-2013 Hey guys! Sorry if this has been asked before but me and a friend is working on a CS where we want the player to activate 2 levers (one in each level of our CS) and were wondering if this is possible, and how exactly? Is it something with global variables working across different levels of some sort? Thanks in advance :-) RE: Levers in different levels - Apjjm - 09-17-2013 You can store the lever state in a global variable. E.g. Code: void OnLeave() { You can then test the state value (1/-1 depending on "on"/"off") as needed for each lever. RE: Levers in different levels - LankySpankey103 - 09-18-2013 Thank you, will try that when I get home :-) I have one more question though: How come when you hover the mouse over the "full game save" property, it says that I should use as few of them as possible? RE: Levers in different levels - LankySpankey103 - 09-18-2013 Okay so i tried your method but no luck. Would you care to take a look at my coding? So I have in my first room where the locked door is, which the 2 levers are supposed unlock. Quote:void OnStart() Then in the second room with the first lever i have this: Quote:void OnStart() And the third room: Quote:void OnStart() Thanks in advance. RE: Levers in different levels - Apjjm - 09-18-2013 (09-18-2013, 11:13 AM)LankySpankey103 Wrote: How come when you hover the mouse over the "full game save" property, it says that I should use as few of them as possible?Every entity you enable full game save on is in the save file forever - so if you did this for loads of entities each map the save file will grow pretty big. It's fine to use for a select few props which you need to remember the state of between maps. Regarding your code, it looks like it should work provided you visit map 1 first and are pulling the levers in the right direction. Changing the code to the following will allow us to test where stuff is going wrong. First map: Code: void OnStart() Second map: Code: void OnStart() Third Map Code: void OnStart() RE: Levers in different levels - LankySpankey103 - 09-19-2013 Aha! Found the solution :-) Apparently whenever you "Reload Map" from the debug menu, it doesn't count as OnEnter(). I wasn't aware of that. Thanks a lot Apjjm! |