Plasma Python API
- Agenotfound
- Posts: 189
- Joined: Mon Jun 29, 2009 7:15 am
- MOULa KI#: 0
Re: Plasma Python API
it seems that the pyhton code released by chogon with the KI max file contains a description of every python function that might help to fix the gaps !

-
- Councilor of Technical Direction
- Posts: 2180
- Joined: Fri Nov 16, 2007 9:45 pm
- MOULa KI#: 23335
- Location: South Georgia
- Contact:
- Agenotfound
- Posts: 189
- Joined: Mon Jun 29, 2009 7:15 am
- MOULa KI#: 0
-
- Councilor of Technical Direction
- Posts: 2180
- Joined: Fri Nov 16, 2007 9:45 pm
- MOULa KI#: 23335
- Location: South Georgia
- Contact:
Re: Plasma Python API
The descriptions are the same. They are called docstrings, and that is what dir() returns when called on python functions/classes/etc

- Agenotfound
- Posts: 189
- Joined: Mon Jun 29, 2009 7:15 am
- MOULa KI#: 0
Re: Plasma Python API
what I meant was that there is now a written description (in english) of the functions.
I know we are not supposed to post code from Cyan here but as they released it ... (edit my post if this is still wrong..)
this is what we had until now
(first lines of Plasma.py)
first line of Chogon's Plasma.py
so I was thinking this could help fill the gaps that remains concerning the exact use of some functions.
I know we are not supposed to post code from Cyan here but as they released it ... (edit my post if this is still wrong..)
this is what we had until now
(first lines of Plasma.py)
Code: Select all
# emacs-mode: -*- python-*-
def PtAcceptInviteInGame(friendName, inviteKey):
pass
def PtAmCCR():
pass
def PtAtTimeCallback(selfkey, time, id):
pass
def PtAttachObject(child, parent):
pass
def PtAvatarEnterAFK():
pass
def PtAvatarEnterLookingAtKI():
pass
first line of Chogon's Plasma.py
Code: Select all
def PtAcceptInviteInGame(friendName,inviteKey):
"""Sends a VaultTask to the server to perform the invite"""
pass
def PtAmCCR():
"""Returns true if local player is a CCR"""
pass
def PtAtTimeCallback(selfkey,time,id):
"""This will create a timer callback that will call OnTimer when complete
- 'selfkey' is the ptKey of the PythonFile component
- 'time' is how much time from now (in seconds) to call back
- 'id' is an integer id that will be returned in the OnTimer call"""
pass
def PtAttachObject(child,parent):
"""Attach child to parent based on ptKey or ptSceneobject
- childKey is the ptKey or ptSceneobject of the one being attached
- parentKey is the ptKey or ptSceneobject of the one being attached to
(both arguments must be ptKeys or ptSceneobjects, you cannot mix types)"""
pass
def PtAvatarEnterAFK():
"""Tells the local avatar to enter AwayFromKeyboard idle loop (netpropagated)"""
pass
so I was thinking this could help fill the gaps that remains concerning the exact use of some functions.

-
- Councilor of Technical Direction
- Posts: 2180
- Joined: Fri Nov 16, 2007 9:45 pm
- MOULa KI#: 23335
- Location: South Georgia
- Contact:
Re: Plasma Python API
You're missing my point. The wiki page and the new Plasma.py file contain the same information (the gaps you speak of are already filled); the wiki page is much more compact however. Except for MOUL specific functions, but those are not applicable at this point.

Re: Plasma Python API
I think what he was meaning is that the comments for the source code are there as opposed to there being no comments when decompiling the code from the pak.
Not that there is anything you didn't know already.
Not that there is anything you didn't know already.
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: Plasma Python API
Those are pretty much useless, especially when most of them say "hack, hack hack." I'd rather see more max files; we've never had those before, unlike the python.

-
- Deep Island Admin
- Posts: 2972
- Joined: Mon May 05, 2008 5:50 am
- MOULa KI#: 0
- Location: Germany
Re: Plasma Python API
Well, I still like to see the comments 
And true, the docstrings in the Plasma.py file are exactly the same information as what is on the wiki, except that the wiki is for POTS, while the code Cyan published is for MOUL.

And true, the docstrings in the Plasma.py file are exactly the same information as what is on the wiki, except that the wiki is for POTS, while the code Cyan published is for MOUL.
I prefer e-mails to "diafero arcor de" (after adding the at and the dot) over PMs.
"Many people's horizon is a circle with a radius of zero. They call it their point of view."
Deep Island Shard | Offline KI
"Many people's horizon is a circle with a radius of zero. They call it their point of view."
Deep Island Shard | Offline KI
- Zrax
- Posts: 206
- Joined: Fri Sep 28, 2007 5:19 pm
- MOULa KI#: 0
- Location: Waist-deep in a conecano
- Contact:
Re: Plasma Python API
Chacal wrote:Good job. Very clear.
I always wondered how "Function: PtAvatarSpawnNext() - Send the avatar to the next spawn point " works. How does it know what the "next" spawn point is? Does it keep a pointer to the last point you spawned at?
Yes, it keeps a global variable that gets incremented and wrapped back to zero if you run over the last spawn point... Hence why it's possible for PtAvatarSpawnNext to start at a spawn point other than the first if used in two different ages subsequently
