Szyu 52 Posted August 22, 2013 Local Switches & Variables Introduction Use local variables and switches for each map, while keeping the normal ones for global event triggering How to Use - set local switches and variables: $local_switches[switch_id] = true|false $local_switches.set(map_id, switch_id, value) - get local switches and variables: $local_switches[switch_id] $local_switches.get(map_id, switch_id) - for local variables use $local_variables Screenshots not possible and not necessary Links Pastebin via Adf.ly if you want to support me Pastebin CreditCredits to Szyu if you plan to use this script. Share this post Link to post Share on other sites
Ventwig 25 Posted August 22, 2013 Nice! This'll save me a lot of mess with all the switches while making it easier to keep track of the ones i need. Thanks Share this post Link to post Share on other sites
Aramis-IX 0 Posted October 3, 2014 Could you give an example of proper local variable commands? I can get your script to work just fine with the switch commands, but not with the variables. That being said, I may not be using the correct syntax. Here is an example of it not working: I set a variable in Events -> Scripts by using $local_variables.set(1,1,2) or $local_variables[1] = 1 and I get a NoMethodError ("undefined method '[]=' for nil:NilClass"). This makes me think I'm doing it wrong! Could you help? Share this post Link to post Share on other sites
Szyu 52 Posted October 5, 2014 Since it was one of my first scripts, I didn't know much about scripts. I just converted the ace version from my normal vx version. So I caught some issues in the script and fixed them. By now, everything should work fine if you use the latest version. $local_switches $local_variables are the terms to go now. Everything else stays as is Share this post Link to post Share on other sites
Aramis-IX 0 Posted October 7, 2014 Thanks Szyu! I appreciate it. Share this post Link to post Share on other sites