The Noob hits Python!

Help bring our custom Ages to life! Share tips and tricks, as well as code samples with other developers.

The Noob hits Python!

Postby J'Kla » Tue Dec 09, 2008 7:17 am

Ok the time has come for me to try and make a Journal and I have been thrashing about in the Wiki like the proverbial "Crash Test Dummy"

As an ultra basic start point I thought Use the Wiki page "Creating a Python File" hell one page how bad can it be. :)

I am doing fine up to the point where it says "Choose File -> Save, then browse to the Python/src" due to a misplaced click it had already saved as the default name god knows where and I had to go through "Save as" to find it.

Ok I proceed to the next point "Now you can add bits of Python code to the appropriate place in your new Python file" (This is a massive insight I'm a noob throw me a bone show me a dummy comment anything :?

Ok I figure this is a Python stub so there so it should be ok to dump it as is I should be able to go back later and add something once I know what I am looking at.

So I save again I haven't changed anything but what the hell It won't harm to save it.

What do you know next point is "Save the file again so far so good(ish)

"Add the Python file to your PAK file." Yep no problem located the PAK dialog in Plasma Shop tried add files button browsed to the saved file and selected it.

This is where I hit the wall the stub file has an error on line 8 it asks for "self.id <insert ID here>" WHAT ID? it won't save without compileing and it won't compile without a self id

I can get this to compile by entering a random 8 digit number in place of , <insert ID here>.

I have also been looking for something specific to writing journals this was my original story the Walker Project I did with D'Lanor. I found his three template files so I printed myself some hard copy and every time I am feeling insomniactic I pick them up and within 5 minutes my brain turns to soup and I fall asleep.

From what I have gathered you add these to your PAK file with suitable file name changes class name and texture name changes within or do I have to add them as code into my created python file?
User avatar
J'Kla
 
Posts: 1003
Joined: Wed Feb 20, 2008 3:16 pm
Location: Geordieland UK

Re: The Noob hits Python!

Postby J'Kla » Tue Dec 09, 2008 7:29 am

Dot just threw me this link

http://www.guildofmaintainers.org/Forum ... =77&t=1087

Andy wrote a tutorial over at GoMA lets see how it goes it does mention D'Lanors templates and <insert ID here> I will report back later
User avatar
J'Kla
 
Posts: 1003
Joined: Wed Feb 20, 2008 3:16 pm
Location: Geordieland UK

Re: The Noob hits Python!

Postby andylegate » Fri Dec 12, 2008 5:56 am

The ID number is basically like a serial number.

You could really just put any number in there, but it might help to put a number you understand. Like if one day you're looking at the python file, trying to figure out what Age it's for (because it may not be named something that tells you that, or what it does ).

So what is recommended is that you create a unique number, using your sequence number from the AGe that the python file is for.

For example, Camp Bravo has a sequence number of 5102.

So for a unique ID number for a python file for it, I put in 5102, and I add a 3 digit unique number: 001.

So all together, the ID number for that python file is: 5102001

That's all that is. You could type in 123456789 and it would work just fine.
"I'm still trying to find the plKey for Crud!"
Image
Blender Age Creation Tutorials
3DS Max Age Creation Tutorials
User avatar
andylegate
 
Posts: 2348
Joined: Mon Oct 01, 2007 7:47 am

Re: The Noob hits Python!

Postby boblishman » Fri Dec 12, 2008 6:55 am

I know this may sound obvious, but just remember that each seperate python file you create must have a difference (unique) number ... so all the python files in a pak have different numbers ... the system Andy refers to above is the best way to go ... and then just increase each new python file's number by 1 ...
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: The Noob hits Python!

Postby J'Kla » Fri Dec 12, 2008 12:15 pm

One of those things that's fairly easy to explain and understand once you know about it.

One of the reasons it's always useful to run a tutorial past a noob at least once :D
User avatar
J'Kla
 
Posts: 1003
Joined: Wed Feb 20, 2008 3:16 pm
Location: Geordieland UK

Re: The Noob hits Python!

Postby Dot » Fri Dec 12, 2008 1:42 pm

That's why the tutorials over on GoMa are first done as forum posts so that people can ask questions and iron out any misunderstandings -- just as Jamey has been doing with the very same tutorial. Then the tutorials themselves are revised where necessary.
User avatar
Dot
 
Posts: 172
Joined: Thu Feb 07, 2008 10:13 am


Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron