if & else URGENT! PLZ! - 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: if & else URGENT! PLZ! (/thread-8161.html) |
if & else URGENT! PLZ! - X4anco - 05-21-2011 Hello peoples, I wanted to know is there such features in angle script (the one to code Amnesia and custom stories) like 'if' and 'else' because I was going to do a bit in my level where you pull a lever and if a variable = 0 then a message will appear otherwise a door will unlock. How would I set my script to detect if my var is 0 and show a message or 1 and unlock a door? I hope that you can help EDIT: Code: void used1(string &in asParent, string &in asChild, int alState) RE: if & else URGENT! PLZ! - Karai16 - 05-21-2011 Code: void OnStart(){ Code: void L2(string &in asEntity, int alState) RE: if & else URGENT! PLZ! - Russ Money - 05-21-2011 If the lever is pulled, have the interaction call back set a global variable to 1. SetGlobalVarInt(string& asName, int alVal); Then have the callback area, timer, etc to check the global variable. GetLocalVarInt(string& asName); Example for checking the global variable from an area Code: void Checking(string &in asParent, string &in asChild, int alState) Someone correct me if I'm wrong. RE: if & else URGENT! PLZ! - X4anco - 05-21-2011 Never mind it was my script |