Jump to content
Sign in to follow this  
Szyu

Local Switches & Variables

Recommended Posts

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

 

 

Credit
Credits to Szyu if you plan to use this script.

Share this post


Link to post
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×