![]() |
[SCRIPT] AddLocalVarInt and valves problems - 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] AddLocalVarInt and valves problems (/thread-13361.html) Pages:
1
2
|
AddLocalVarInt and valves problems - SilentStriker - 02-15-2012 So my problem is I try to use AddLocalVarInt when I turn 4 valves so the LocalVar is 4 but the problem is that it wont add anything. And before you ask, Yes I added SetLocalVarInt 0 and I don't have any typos. The thing I asking about is, Is it any bug/problems with using AddLocalVar when using the valves? RE: AddLocalVarInt and valves problems - Your Computer - 02-15-2012 As far as i know, there aren't any issues with AddLocalVarInt, but having us assume that you've set everything up correctly won't get you anywhere. RE: AddLocalVarInt and valves problems - Ninami - 02-15-2012 If you did everything correctly then there wouldn't be any problems in the first place ![]() RE: AddLocalVarInt and valves problems - flamez3 - 02-16-2012 Show us the script c: RE: AddLocalVarInt and valves problems - Ninami - 02-16-2012 I got a map with the same mechanic. I just add "SetLocalVarInt("Valve", 0);" and then every time you turn a valve you add "AddLocalVarInt("Valve", 1);". Then every time you try to open the door, the "if" statement starts, if("Valve" == 4);{ the door opens } else{ message saying its locked }. RE: AddLocalVarInt and valves problems - SilentStriker - 02-16-2012 There must be a bug or something because Statyk tried it to and the same results, He got it working with using only SetLocalVar but not AddLocalVar... oh well here's my script PHP Code: void OnStart(); All the other things work but not the LocalVarInt RE: AddLocalVarInt and valves problems - Your Computer - 02-16-2012 Where's the rest of the script? RE: AddLocalVarInt and valves problems - jens - 02-16-2012 Is it intended to add different amounts to Valve? As it is in the for loops it sometimes add 1 but sometimes 3, so if turning 4 valves is meant to make the value of Valve equal 4 the current code does not do this. RE: AddLocalVarInt and valves problems - SilentStriker - 02-16-2012 it is intended for the valves to be equal to 4 so each valve adds 1. So how do I not make them random? Do I put them before the for loop? ![]() RE: AddLocalVarInt and valves problems - Your Computer - 02-16-2012 (02-16-2012, 09:46 AM)SilentStriker Wrote: it is intended for the valves to be equal to 4 so each valve adds 1. So how do I not make them random? Do I put them before the for loop? Your script has each valve add either 2, 3 or 4, which would mean the total result may never equal 4. Your attempt at convenient naming is increasing the variable more than it should. |