Script:Persist.js

From Spherical
Revision as of 22:41, 3 June 2013 by Apollolux (talk | contribs) (Download: fix link)
Jump to: navigation, search

persist.js lets you store variables in persons and maps, and use them in event scripts.

At its simplest, you can store simple quest information, e.g. if you've talked to an NPC, or collected an item. Power users can take full advantage of JavaScript, and write templates for common person patterns, e.g. one-line townsfolk, store keepers, inn keepers, save points, chests, items, door switches, bosses blocking passages, and warps.

It helps you to organise your game data. If you ever got sick of making global variables and confusing data structures to hold your game info, this is your answer.

Download

  • persist.js (17.9 KB JavaScript file)
  • persist.js demo game (15.6 KB ZIP archive, requires Sphere)

The code (embedded Gist)

<gist>5702052</gist>

Quick start

Reference

How to…