Skip to content

Differences from legacy GS2

This engine knowingly differs from legacy GS2 in the places below. Turn on legacy_warnings to find the ones a script can reach. Behaviors that are not confirmed yet are listed in open questions.

  1. String literals convert to lists. In legacy GS2, "b" in "a,b,c" is false and for (x : "a,b,c") runs zero times. Here a string literal behaves like the same text held in a variable: the test is true and the loop runs three times. Warning: W-LEGACY-DIFF-LITERAL-LIST.
  2. floor, ceil, and round give correct results on the server. Legacy GS2 returned 0 there.
  3. Draw order of show images on one layer is always the same, by index. It is not random.
  4. formatfraction has no trailing space, and formatprice keeps the decimal part.
  5. Ternary with !. x ? y : !z works without parentheses.
  6. Frame rate. The client runs at up to 60 frames a second, not 20. The shortest timer is one frame on the client (about 0.0167 seconds) and one tick on the server (0.02 seconds at the default rate), not 0.05 seconds.
  7. Timer accuracy. The slack of the older scheduler is not reproduced. setTimer(0.1) and scheduleevent(0.1) run as close to the requested delay as a tick or frame allows.
  8. Limits and checks that older servers did not have. A requestsql runs one statement, so a script that sends A; B gets multiple statements are not allowed. File paths that contain .. or start at the root are refused even when harmless, and so are Windows device names and names that end in a dot or a space. There are caps on pending SQL and web requests for each object. Plain VACUUM is not available in SQL. Scripts only reach the folders and hosts the server lists.
  9. GS1 code is never run. Old character property codes (setcharprop) are not supported and are reported in the RC chat.
  10. Accepted where legacy GS2 rejects (verified on a legacy server). Legacy scripts never use these, so they cost no compatibility:
    • keywords in any case (IF, Function) and built-in function names in any case (Abs(-2); legacy finds only abs, and echo in any case);
    • unknown escapes such as \q;
    • object names in any case: isobject("ruannpc") and the plain name ruannpc find the NPC RuanNPC (legacy: exact case only);
    • a plain call of a function value held in a script-global variable;
    • an initializer block on a new whose result is assigned (temp.o = new T() { ... });
    • try/catch/finally/throw, strpos (legacy: .pos), and round on the server (legacy: Math.round on the client only).
  11. Loop limit. Legacy GS2 stops a run after about 10,000 loop iterations (nested loops counted together). The limit here is 1,000,000 for each uninterrupted run. Change it with the Server Option script_loop_limit.
  12. No built-in stats. hearts, maxhearts, rupees, gralats, bombs, arrows, ap and mp do not exist, and nothing shows hearts over a player. Keep your own numbers in player. flags or your own variables and draw them with GUI controls (see the default systems page of the admin guide).

These names cannot collide with older scripts, and each is listed in the API reference:

  • === and !==, typeof;
  • try, catch, finally, throw;
  • async and await;
  • regular expressions and JavaScript-style array methods;
  • native A* path finding;
  • formatprice and formatfraction;
  • the event onJoinedClassUpdated and the frame event onFixedUpdate;
  • the recursive option of savejsontostring;
  • parameter binding for SQL and the columns field of SQL requests;
  • the optional type annotations of the editor (type annotations);
  • the engine has no built-in stats, combat, items, or HUD, so legacy switches for them do not exist (default game systems).

Names, grammar, and run-time behavior that older scripts rely on are kept, including the quirks in compatibility quirks. When a rule here says “verified”, it was checked against a running older server. When it says provisional, see open questions.

Engine version 0.1.0. Built 2026-11-18.