![]() |
Different Level Door Question (scripting) - 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: Different Level Door Question (scripting) (/thread-7246.html) |
Different Level Door Question (scripting) - genmills - 04-08-2011 Hello all! I have a quick question. I am making an outdoor map that has several buildings, some of which will be locked. I want the doors to lead to new levels, but I want to use regular door models (castle doors, dungeon doors, etc.) instead of the "level" doors. I know I can add an entity interact function that is triggered when the player clicks on a door, which causes the new level to load, but what do I do about locked doors? Is there a way I can make my function see if the door is unlocked or not before it loads the new level? Let me know if I am being clear enough. Thanks! ![]() p.s. My map is gonna be awesome! I scared myself so badly by accident today... I will try to post screens soon in another thread. RE: Different Level Door Question (scripting) - MrBigzy - 04-08-2011 Yea, you'd have to use variables to say whether the door is locked or not. For example: Code: if(GetLocalVarInt("Door")==1) //Door is locked, plays locked sound, etc. You'd make it so when you use the key on the door, it would do SetLocalVarInt("Door", 2). So yea, something like that. RE: Different Level Door Question (scripting) - Dalroc - 04-08-2011 (04-08-2011, 05:37 AM)MrBigzy Wrote: Yea, you'd have to use variables to say whether the door is locked or not. For example:Or he could use bool GetSwingDoorLocked(string& asName); Code: if(GetSwingDoorLocked(asEntity) == true){ RE: Different Level Door Question (scripting) - MrBigzy - 04-09-2011 Yea, that'll probably work better. ![]() RE: Different Level Door Question (scripting) - genmills - 04-09-2011 Sweet! Thanks guys! ![]() Just for clarification, in the part with "if(GetSwingDoorLocked(asEntity) == true) { }," I don't have to put anything in there right? It will just act as though it's locked. Another quick question so I don't have to make another thread... Is it possible to make a plane inactive? I'm using "ground" planes flipped backwards as invisible walls to prevent a player from moving on until they have completed parts of the storyline and solved some of the mystery. I know you can set entities inactive, but I'm not sure if that only applies to what is in the entity category? Also, I want to make a secret passage that is hidden by a regular rock. Is it possible to make a function that will move the rock? Thanks so much, and sorry for being such a noob! You'll like me again once you play my map, though, haha ![]() RE: Different Level Door Question (scripting) - Dalroc - 04-09-2011 (04-09-2011, 04:10 PM)genmills Wrote: Just for clarification, in the part with "if(GetSwingDoorLocked(asEntity) == true) { }," I don't have to put anything in there right? It will just act as though it's locked.If nothing special is supposed to happen when it's locked you don't need any if conditional for that, just put the conditional that the door is unlocked in a function, like this. Code: void AwesomeFunction(Parameters) ![]() (04-09-2011, 04:10 PM)genmills Wrote: Another quick question so I don't have to make another thread... Is it possible to make a plane inactive? I'm using "ground" planes flipped backwards as invisible walls to prevent a player from moving on until they have completed parts of the storyline and solved some of the mystery. I know you can set entities inactive, but I'm not sure if that only applies to what is in the entity category?Try looking under "Technical" in the entities tab. There you have several type of invisible block boxes. (04-09-2011, 04:10 PM)genmills Wrote: Also, I want to make a secret passage that is hidden by a regular rock. Is it possible to make a function that will move the rock? Thanks so much, and sorry for being such a noob! You'll like me again once you play my map, though, hahaThis one should be very possible, but I can't really think of how right now.. Try looking at the script functions on the wiki and searching the forums ![]() RE: Different Level Door Question (scripting) - MrBigzy - 04-09-2011 How is the rock gonna move? If you're not gonna see it move at all, simple make the rock inactive with the SetEntityActive function. Otherwise, is there a specific way you want the rock to move? Explosion, a push, etc? RE: Different Level Door Question (scripting) - Andari - 04-13-2011 A bit OFF: "if(GetSwingDoorLocked(asEntity) == false)" Is it correct int the Form: "if(!GetSwingDoorLocked(asEntity))" (The Function returns bool, and (B is a bool) !B is the same logical Function as B==False.) (That was a question btw. I do not know what is the scripts base langauge. (Java maybe?)) |