LuaAPI.wiki
changeset 1531 9a4773488054
parent 1522 4f9e1a0d56d9
child 1532 94030dc69d1e
equal deleted inserted replaced
1530:288bee4b94d5 1531:9a4773488054
   200 === <tt>onPreviewInit()</tt> ===
   200 === <tt>onPreviewInit()</tt> ===
   201 This function is called when the map preview in the frontend is initialized. This happens when the script is selected or you change a map generator parameter.
   201 This function is called when the map preview in the frontend is initialized. This happens when the script is selected or you change a map generator parameter.
   202 
   202 
   203 It is useful for scripts which create their own maps (see `AddPoint` and `FlushPoints`). If you create a map in this function, a preview will be generated from this map and is exposed to the frontend.
   203 It is useful for scripts which create their own maps (see `AddPoint` and `FlushPoints`). If you create a map in this function, a preview will be generated from this map and is exposed to the frontend.
   204 
   204 
       
   205 Note the variables `LeftX`, `RightX`, `TopY`, `LAND_WIDTH` and `LAND_HEIGHT` are *not* yet available at this stage!
       
   206 
   205 === <tt>onParameters()</tt> ===
   207 === <tt>onParameters()</tt> ===
   206 This function is called when the script parameters (as specified in the game scheme) become available. The script parameter string is stored in the global variable `ScriptParam`.
   208 This function is called when the script parameters (as specified in the game scheme) become available. The script parameter string is stored in the global variable `ScriptParam`.
   207 
   209 
   208 Please note that it is normally not safe to call many of the other functions inside this function, this function is called very early in the game, only use this to initialize variables and other internal stuff like that.
   210 Please note that it is normally not safe to call many of the other functions inside this function, this function is called very early in the game, only use this to initialize variables and other internal stuff like that.
   209 
   211