Navigation
Community
Configuring
Creating
FAQ - General
Info for Sauerbraten Users
Introduction
Known Issues
Main Page
Notes
Playing
Troubleshooting
 

FAQ

  • When I read from a StateArray or StateArrayFloat, I get 'undefined' values

    Due to limitations of the JavaScript language (regarding overloading the [] operator), you can't write things like

    this.myArray[2] = 55;
    var x = this.myArray[0];

    Instead, you should write

    this.myArray.set(2, 55);
    var x = this.myArray.get(0);

    However, it is perfectly fine to do:

    this.myArray = [20, 40, 80];
    var anArray = this.myArray.asArray(); // Returns an array version

Updated on Aug 30, 2009 by Alon Zakai (Version 4)