![]() |
Variable help needed PLEASE :'( - 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: Variable help needed PLEASE :'( (/thread-8171.html) |
Variable help needed PLEASE :'( - X4anco - 05-21-2011 Hello , I need help with a script -to do with variables, Ive never used them before- and when the player interacts with a lever nothing happens when I want a message when door = 0 but nothing happens, I hope you can help ![]() Code: //VARAIBLES Code: void used1(string &in asParent, string &in asChild, int alState) RE: Variable help needed PLEASE :'( - nemesis567 - 05-21-2011 You know that you don't need to declare the variables? AddLocalVarInt("door1", 0); // This will add 0 to the door1 variable, which means that it will do nothing. RE: Variable help needed PLEASE :'( - X4anco - 05-21-2011 (05-21-2011, 09:58 PM)nemesis567 Wrote: You know that you don't need to declare the variables? What do you mean? RE: Variable help needed PLEASE :'( - Kyle - 05-21-2011 Do you really need a global variable in this case? In your "void OnStart()", you could add this: SetLocalVarInt("door1", 0); Then the place where you set it to 1, put this: SetLocalVarInt("door1", 1); or AddLocalVarInt("door1", 1); This is what the used1 function should look like. Code: void used1(string &in asParent, string &in asChild, int alState) RE: Variable help needed PLEASE :'( - X4anco - 05-21-2011 (05-21-2011, 10:07 PM)Kyle Wrote: Do you really need a global variable in this case? Still nothing happens SD@ ![]() *feels like screaming! RE: Variable help needed PLEASE :'( - Kyle - 05-22-2011 It should work. Maybe if you shown a little more of your script I can be able to fix it all. :/ |