| Linden scripting Language Guide 中英文对照(1) |
| 作者:梦翔儿 日期:2007-6-27 23:38:00 |
Linden sc<x>ripting Language Guide林登脚本编辑语言指南(中英文对照版)
1. Introduction 导论 Chapter 1. Introduction The Linden sc<x>ripting Language (LSL) is a simple, powerful language used to attach behaviors to the ob<x>jects found in Second Life. It follows the familiar syntax of a c/Java st<x>yle language, with an implicit state machine for every sc<x>ript. Multiple sc<x>ripts may also be attached to the same ob<x>ject, allowing a st<x>yle of small, single-function sc<x>ripts to evolve. This leads to sc<x>ripts that perform specific functions ("hover", "follow", etc.) and allows them to be combined to form new behaviors. The text of the sc<x>ript is compiled into an executable byte code, much like Java. This byte code is then run within a virtual machine on the simulator. Each sc<x>ript receives a time slice of the total simulator time allocated to sc<x>ripts, so a simulator with many sc<x>ripts would allow each individual sc<x>ript less time rather than degrading its own performance. In addition, each sc<x>ript executes within its own chunk of memory, preventing sc<x>ripts from writing into protected simulator memory or into other sc<x>ripts, making it much harder for sc<x>ripts to crash the simulator. This tutorial introduces the reader to the basic features of LSL, how to edit and apply your sc<x>ripts, and a complete reference for standard linden constants, events, and library functions. LSL语言简单有效,易学,功能强大.给第二生命中的对象赋予生命。 它与C/Java类型语言语法相似, 每个语法对应一个隐型状态机。 多重脚本可以同时赋予一个,支持功能单一、没有风格的脚本的扩展,从而一段语法执行一个具体的函数,也允许函数绑定实现新的行为. LSL语言程序段是可执行代码,类似Java,直接在虚拟机或者仿真机上运行.每一个程序段接收分配到仿真机全部时间上的一个时间片. 因此带有多条执行指令的一个仿真机单条指令执行时间更短,而不会减低性能.而且,每条指令在其 这个教程给出了LSL的基本功能,比如如何编辑和应用指令,如何为一个标准的linden常量,事件以及函数建立参数等. |
