![]() |
![]() |
![]() |
|
Content Scripting Python IntroductionFrom RexWiki
BackgroundrealXtend adds Python script support for the server using Ironpython. The script uses a different kind of system compared to LSL scripts which use the inventory system. This is because the scripts are more powerful and can also access the server machine's other resources. The scripts are stored in the server's ScriptEngines\PythonScript subfolders, not to database. By default this folder contains the RXCore folder which contains the core implementation of the script engine so this folder shouldn't be modified. Samples folder contains some example scripts. Objects & classesThe rex python script engine takes a different approach compared to the LSL scripting system. In rex python script engine every primitive and avatar in the world is an object. You can define which python class is tied to the primitive. If you don't define your own class for a prim, then the default class "Actor" is used for it.
Class hierarchyThe class hierarchy looks like this:
Python script engine features
Available functionalityWhen doing python scripting you actually have the following functionality in your fingertips: 1) The python script implements the LSL script interface which means that most of the LSL functions can be used in the script. All LSL functions are not supported because they haven't been implemented in the server's c# code yet. 2) There are also some additional script functions which have been implemented inside the server and are callable from the python script. Check out the RXCore\rxactor.py and RXCore\rxavatar.py files for details about the additional script functions. 3) You have most of the Python's functionality at your disposal. A note for regular Python users, Ironpython doesn't support all the functionality of the regular Python at the moment. Some of the standard library modules work and some not. For more information about Ironpython go to http://www.codeplex.com/IronPython 4) Ironpython supports c# stuff so you can for example create objects defined in c# dll's, then call their functions and do other kinds of c# stuff in the python scripts. Python tools, tutorialsYou can use notepad or any other text editor to create python scripts. There are also many IDE's available, one that we have used, is pretty good and also free is called PyScripter and can be downloaded from http://mmm-experts.com/Products.aspx?ProductID=4 Some other Python resources are: |
|||
![]() |
![]() |
![]() |



