Scripting:FAQ

From STNE Wiki

Jump to: navigation, search
Main | Syntax | Operators | Interfaces | FAQ | Contents | API Reference | Index


Contents

What scripting language is used to execute the scripts?

  • An independent interpreter was written for STNE. It is not available elsewhere. The syntax is likewise its own, though comparable to other languages - primary Javascript, PHP, and Visual Basic.


Are the used available objects of the Script engine also of the actual STNE engine?

  • No. STNE internally uses completely different objects within a completely different structure.


How are the current Script engine classes defined, and how can one define one's own classes?

  • At present it is not possible to define one's own classes. Available classes are firmly embodied within the STNE source text, and represent internally a genuine .NET object.

[Edit] While the available classes statment is still true, you can now define your own classes. The caveat is, they are simple classes, so there is no inheritance (so no overloading) or pragmas (private/protected/friend)

Would it be possible to use objects and classes which are not intended for the Script engine?

  • No. During the use of each object it is determined whether the object type is certified. This is also performed during a Script's execution.


How ensured that one does not use stranger of objects within the Script engine, e.g. stranger of ships steers?

  • Each object examines independently whether the owner of object agrees with the current player context and/or whether these accesses on it may have.


What if I cause a continuous loop within the source text - will it then hang the whole server?

  • In principle one can only hang one of four CCU cores. Each Script which does not terminated after 10 seconds of use is stopped. If it is repeatedly recognized that a Script exceeds the time limit on a CCU, the Script is then deactivated and/or the ability of implementing Scripts is withdrawn from that player's account.


How many variables may I define, and how large is the maximum memory consumption?

  • You may define as many variables as you require. With each object production, memory consumption is roughly estimated. If more than approximately 10 MB of memory will be used, then the Script is terminated. If the Script is estimated to exceed 50 MB of memory, then the ability of implementing Scripts will be automatically withdrawn from that player's account.


Why aren't Scripts implemented immediately, and how are they adjusted?

  • All Scripts are implemented internally one behind the other sequentially. Scripts which can be implemented, are placed in a waiting queue, and implemented only when all previous Scripts have been implemented.


What is the maximum allowable size of a Script?

  • A Script may be as large as 100 KB. This corresponds to approximately 2,500 lines of source text. This size should be more than sufficient.


My Script exceeds the limits. Is there a possibility to implement it anyway?

  • You may submit such Scripts for consideration as an exception. However, these are only approved if the Script represents a considerable enrichment to the Community. There must be a reasonable cause for such permission. Moreover, the Script source text will be examined. Turn it over to a Game Admin.


Can I store variables somewhere permanently, e.g. in a file?

  • Yes, over the object CDataNodeStorage.
  • See also the applicable thread in the forum.
Personal tools