MicroCity

< 3.4 Navigating Scenes Table of Contents 4.2 Operation System >

4.1 SI Overview

Lua Engine

MicroCity Web uses Lua 5.4 as its script language. Many useful funtions embeded, which can not only manipulate data, but also can solve mathematical models and run simulations. You should read following chapters for more information.

Conventions

There are three major data types in Lua can be passed though embedded functions as parameters, namely Number, String and Object. The type Object includes builtin Lua objects, such as Table, Function and Thread…, as well as MicroCity Web objects, such as Scene. If v is an object, a call v:func(args) is syntactic sugar for v.func(v,args), except that v is evaluated only once. Some symbols are used when defining embedded functions. Following is an example of an embedded function:

coroutine.queue(rt, f|co [, arg1, ···])

In this case, the character ‘|’ among parameters means “or”. The pair of ‘[’ and ‘]’ means optional parameters. The three dots ‘…’ at the end of the parameter list indicates that any number of parameters can be followed.

Encoding

Any file in MicroCity Web is encoded as UTF-8 by default. Lua can handle them with utf8 library.

< 3.4 Navigating Scenes Table of Contents 4.2 Operation System >