Skip to content

Cross-Plot Variables

Because multiple plots can access the same namespace (even plots owned by different players), it is possible for plots to read and modify the same underlying set of variables.

When one plot loads a bucket, it locks the bucket so that no other plot can load it. When the plot unloads the bucket, it becomes accessible to other plots again.

The lock setup is simple when you are only accessing data on one plot at a time. However, sometimes you have data that needs to be visible to all plots (for example, the player counts of different instances of a game).

The standard pattern here is:

  • Load the bucket
  • Make the modifications
  • Immedietely save and unload the bucket

There is a Set Variable action which will let you copy the contents of a bucket into game/line variables without holding the lock; this will let other plots read the data without needing to grab the lock (keep in mind this loads the last saved data so you might want to implement periodic saving for your buckets aswell).