Is the Code for My Age Available?

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.
Jennifer_P
Posts: 729
Joined: Fri Sep 28, 2007 10:54 pm

Re: Is the Code for My Age Available?

Post by Jennifer_P »

Whoopsy--guess I shouldn't have skimmed the details there, thanks for catching me. Ah, and instructions right in your tutorial too. Perfecto!
User avatar
Trylon
Posts: 1446
Joined: Fri Sep 28, 2007 11:08 pm
MOULa KI#: 0
Location: Gone from Uru

Re: Is the Code for My Age Available?

Post by Trylon »

PyPRP 101:

First, a prp file is basically a large array of objects. PyPRP can assemble and disassemble these lists.
PyPRP also has a large number of classes for each object in a prp file.
These classes share the same behaviour for a large part:

Code: Select all

### PSEUDOCODE ###
class plClassName:
    def __init__(self,name,type=0x0006): # the 0x0006 is an example object type nr, these are different for each object
        #initializes the object by inserting default variables
   
    def read(self,stream):
        # Read in the object-specific data into variables

    def write(self,stream):
        # Write out the variables into object-specific data

    def export_obj(self,obj): # form can vary
        # Reads in blender data from the blender object (the obj variable) and fills in the prp objectg fields based on that data
   
    def import_obj(self,obj): # form can vary
        # Reads in the prp-specific variables, and uses them to set the correct settings on the blender objects


Note, that this is only basic structure, not all classes have export/import functions, as sometimes variables are set or read externally.

Pyprp has a resource manager that manages creation of each object, and makes them findable. That one also handles storage and reading.

Another function of pyprp's resource manager is to handle basic blender interpretation. From the code in the export function in the resource manager, the objects are made, or object creation is delegated.
It basically follows a list of all blender objects, and created prp objects according to different settings on the blender objects.


Hope this helps...
One day I ran through the cleft for the fiftieth time, and found that uru held no peace for me anymore.
Jennifer_P
Posts: 729
Joined: Fri Sep 28, 2007 10:54 pm

Re: Is the Code for My Age Available?

Post by Jennifer_P »

Well, I understand about 95% more about PyPRP than I knew before reading your post, Trylon. :) I'll certainly have a use for some of this information in my explanation of the files underlying the Age, although some of it is over my head at the moment I'm afraid. Heh, I'd ask you to explain, but I have a feeling that it might result in a kind of recursive effect where I have more and more questions the more you expand my limited knowledge. And I wouldn't want to pester you too much with questions when I haven't even looked for the answers myself. :geek:
And Chacal, I got UruFun and PYPRPExplorer downloaded and opened up the .sum, .age, and .fni files plus those human unreadable .prp files. It was pretty interesting seeing all the internal structure behind the GUIs--sort of like dissecting a frog or something. :D Thanks for posting that tutorial. :)
User avatar
Chacal
Posts: 2515
Joined: Tue Nov 06, 2007 2:45 pm
MOULa KI#: 0
Location: Quebec, Canada

Re: Is the Code for My Age Available?

Post by Chacal »

Good!
After you complete your assignment I'll tell you about a nifty feature of prpExplorer, a kind of sugarcoating.
Chacal


"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
Jennifer_P
Posts: 729
Joined: Fri Sep 28, 2007 10:54 pm

Re: Is the Code for My Age Available?

Post by Jennifer_P »

Ooooh... :)
User avatar
Zrax
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
MOULa KI#: 0
Location: Waist-deep in a conecano
Contact:

Re: Is the Code for My Age Available?

Post by Zrax »

Not meaning to toot my own horn or anything, but PlasmaShop really is a lot more powerful and useful than UruFun (and supports more file formats and games) ;). And with regards to the PRP documentation, Cyan asked us a long time ago to stop posting that information out in the public, so although the COBBS docs are horribly outdated (and in some cases, horribly wrong/incomplete/unhelpful/etc), all of our newer stuff is held private among the major tool devs right now.
User avatar
Grogyan
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am
MOULa KI#: 0

Re: Is the Code for My Age Available?

Post by Grogyan »

Its a great program Zrax, any idea about any upgrades to it?

I also use urupython 3.1 to decompile scripts back to .py after PlasmaShop.
Show Spoiler
Better to have loved and lost than never to have loved at all
User avatar
Chacal
Posts: 2515
Joined: Tue Nov 06, 2007 2:45 pm
MOULa KI#: 0
Location: Quebec, Canada

Re: Is the Code for My Age Available?

Post by Chacal »

Yes, Plasmashop is a great tool.
Chacal


"The weak can never forgive. Forgiveness is an attribute of the strong."
-- Mahatma Gandhi
User avatar
Zrax
Posts: 206
Joined: Fri Sep 28, 2007 5:19 pm
MOULa KI#: 0
Location: Waist-deep in a conecano
Contact:

Re: Is the Code for My Age Available?

Post by Zrax »

Grogyan wrote:Its a great program Zrax, any idea about any upgrades to it?


Well, as I mentioned in the last release a week or so ago, I still need to finish the Hex Isle support (It's supported, but I need to add stuff like the syntax highlighting for .hex and .fx files -- and maybe even eventually a level editor of sorts)... If you have ideas beyond that, I'm always open to them :). Oh, and PlasmaShop will actually decompyle python as well as compyling it -- that seems to be the most "accidentally hidden" feature about it, I've noticed :\. Perhaps I'll find a way to fix that in a future update too ;).
User avatar
Robert The Rebuilder
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
MOULa KI#: 1299
Location: Virginia, US

Re: Is the Code for My Age Available?

Post by Robert The Rebuilder »

Hello, Zrax!

I use PlasmaShop quite a bit. One feature I'd like to see is line numbers in the Python editor, which is very handy when the Plasma logs cite an error at a specific line. If line numbers are too difficult to do, then having a "jump-to-line" option would be just as useful. Of course, it would be great to have both features - but then, I'm being greedy!

Keep up the great work - looking forward to changing my avatar to Osmo! :-)
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
Post Reply

Return to “Scripting”