Hi all,
I am well voiced in PhP and can do a fair bit of Javascript and even know some Java syntax. I have an enormous book on Python here and don't think basic syntax, conditions, etc. should be a problem. But... I have no clue how to start working all of this into Uru. Is there a list of object, references, etc. that I can use? Sample script even maybe? For starters i would like to be able to start and stop texture animations, change the colors of light or objects in general, etc.
Any directions are helpful!
thnx
Marcello
How to start writing Python script for UrU
Re: How to start writing Python script for UrU
I'm learning by attempting to write a script for Blender, then i'll move onto Uru.
D'Lanor's journal template could be a start, or just decompile the .py files from the python.pak in your uru install
D'Lanor's journal template could be a start, or just decompile the .py files from the python.pak in your uru install
Better to have loved and lost than never to have loved at all
-
- Councilor of Technical Direction
- Posts: 2180
- Joined: Fri Nov 16, 2007 9:45 pm
- MOULa KI#: 23335
- Location: South Georgia
- Contact:
Re: How to start writing Python script for UrU
Python in Uru is pretty simple, you can get a great grasp of it by reading some of Cyan's code. For starters, you might look at something like xAgeSDLBoolShowHide.py
However, I'll summarize some things here.
Python classes used in Plasma need to derive from ptModifier or ptResponders. ptModifiers are usually only reffed from the plSceneObject while ptResponders are usually called through complex logic interfaces.
In your class, you can override the following methods
Anyway, those are the basics. There are a few more methods that you could use, but they're likely not to be too useful right now (I don't see you needing to fetch the public age list)... Have fun!
However, I'll summarize some things here.
Python classes used in Plasma need to derive from ptModifier or ptResponders. ptModifiers are usually only reffed from the plSceneObject while ptResponders are usually called through complex logic interfaces.
In your class, you can override the following methods
- OnServerInitComplete
This is called when (in multiplayer) you are done talking to the server and the script is loaded.
OnFirstUpdate
This seems to be called sometime after OnServerInitComplete yet before linkin occurs
OnSDLNotify
This is called when an SDL Variable that you have registered for notify is changed
OnBehaviorNotify
This is called when a ptAvatar who you have registered for behavior notify has done a behavior
OnNotify
This is called when a registered notify (ptAttribute i.e.) throws a message
OnTimer
This happens on a scheduled time from PtAtTimeCallback
Anyway, those are the basics. There are a few more methods that you could use, but they're likely not to be too useful right now (I don't see you needing to fetch the public age list)... Have fun!

-
- Posts: 129
- Joined: Thu Oct 04, 2007 1:31 pm
Re: How to start writing Python script for UrU
Thanks Hoikas that helps me a bit also. 

- Marcello
- Posts: 374
- Joined: Sun Nov 04, 2007 8:59 am
- MOULa KI#: 64309
- Location: Haarlem, The Netherlands
Re: How to start writing Python script for UrU
Thnx guys that should give me a start.