Plasma Python API

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.
diafero
Deep Island Admin
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
MOULa KI#: 0
Location: Germany

Re: Plasma Python API

Post by diafero »

As I said, this list is automatically generated - and unfortunately, I found no way to get the parameters of a function/method inside Python. Cyan always listed them in the description though. I don't feel like copying >2000 parameter lists manually from the Plasma.py file...
However, if we assume that this "Params" list provided by Cyan is correct (and no "Params:" means that no parameters can be passed to the function), I could adapt the script to parse it and print it in a readable way.
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
diafero
Deep Island Admin
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
MOULa KI#: 0
Location: Germany

Re: Plasma Python API

Post by diafero »

I changed the script to beautify the parameters list. The wiki page is now the actual output of the script, no manual search'n'replace was done.

That format you suggested, Hoikas, would make the page even longer than it is now, and I'm not sure whether that adds to readability. Plus, the way the script works, it can not sort the entries, it just prints them in the order it gets from the "dir" function. Since we have only two classes with properties, it's not worth thinking too much about those.
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
Tsar Hoikas
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

Post by Tsar Hoikas »

This is good. All it really needs now are section divisions. I can go through and add those... Eventually >.>
Image
diafero
Deep Island Admin
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
MOULa KI#: 0
Location: Germany

Re: Plasma Python API

Post by diafero »

The problem is that in theory, a class can contain another class, so I can't just make a class "===classname===". But no need for you to do that manually, I think I found a solution: Make the number of "=" signs depend on the indention. Then it would look right even with subclasses. Expect the update today or tomorrow.
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
Tsar Hoikas
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

Post by Tsar Hoikas »

I didn't think about that >.> Though I don't remember anywhere in the Plasma module that uses subclasses. You solution sounds good though (I don't have to do anything :P).
Image
diafero
Deep Island Admin
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
MOULa KI#: 0
Location: Germany

Re: Plasma Python API

Post by diafero »

No, Plasma doesn't use it, true. I already heavily adapted the script, but at least I want to be sure I don't miss anything - who knows what someone might run this script on one day... :lol:

You solution sounds good though (I don't have to do anything :P).
I knew you were going to like it :D
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
diafero
Deep Island Admin
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
MOULa KI#: 0
Location: Germany

Re: Plasma Python API

Post by diafero »

Ok, I updated the site. Does anyone know how to indent the bullets without these strange double-bullets at the beginning?
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
User avatar
Chacal
Posts: 2515
Joined: Tue Nov 06, 2007 2:45 pm
MOULa KI#: 0
Location: Quebec, Canada

Re: Plasma Python API

Post by Chacal »

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?
Chacal


"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
Tsar Hoikas
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

Post by Tsar Hoikas »

diafero wrote:Ok, I updated the site. Does anyone know how to indent the bullets without these strange double-bullets at the beginning?


I don't think MediaWiki expects you to start off with "**". You could surround single bullets (one asterisk) inside a blockquote. I think the page looks good with a double header (== Class == whereas you were using === Class ===) and single bullets. I see the effect you were going for though; MediaWiki is just being a pain.
Image
diafero
Deep Island Admin
Posts: 2972
Joined: Mon May 05, 2008 5:50 am
MOULa KI#: 0
Location: Germany

Re: Plasma Python API

Post by diafero »

I wanted the bullet points to be indented... and I deliberately used 3rd-level headers because level 2 captions get this additional horizontal line and are way bigger, so the page gets longer and longer...
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
Post Reply

Return to “Scripting”