AlcScript and Python for dummies?

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

AlcScript and Python for dummies?

Postby Tinuviel » Fri Aug 22, 2008 4:13 pm

Do anyone know if there is somewhere I can read and learn about alcScript and Python that is written in a language for dummies?
I really want to learn this, but I lack so much of the basics that I can't even get the tutorials at the wiki to work. :shock:

The tutorial of the sitting mod claims to be very simple, so I thought I would go with that as a start and try to understand how it is done. But I get only errors when exporting. And that tutorial is more or less just copy and paste.... And I have no idea how to atack this lack of knowledge of mine and find information, because I do not know what I should know! And it takes so much time searching for information when I do not know exactly what I am looking for. Like to day, when I looked at the tutorials for How to save object animation states. In the tutorial it says I have to make a sdl file. And I had no idea how to do that. So I did a search for sdl and looked through almost 19 pages of post before I found out I could use plasmaShop. ( :roll: I'm stupid, i know)
«Borders? I have never seen one, but I have heard they exist in the minds of some people.»
(Thor Heyerdahl)
Tinuviel
 
Posts: 106
Joined: Wed Feb 06, 2008 10:17 am

Re: AlcScript and Python for dummies?

Postby Godot » Fri Aug 22, 2008 4:40 pm

Wikibooks has a good Python tutorial

http://en.wikibooks.org/wiki/Python
Godot
 
Posts: 50
Joined: Sun Jan 06, 2008 10:15 am
Location: North East

Re: AlcScript and Python for dummies?

Postby Tinuviel » Sat Aug 23, 2008 1:23 am

Thanks, Godot. Looks a bit like what I need, exept for the dummies part:-)
«Borders? I have never seen one, but I have heard they exist in the minds of some people.»
(Thor Heyerdahl)
Tinuviel
 
Posts: 106
Joined: Wed Feb 06, 2008 10:17 am

Re: AlcScript and Python for dummies?

Postby D'Lanor » Sat Aug 23, 2008 2:36 am

There is a book Python for dummies which you can buy for example at Amazon.

AlcScript is PyPRP specific though so you will not find any documentation elsewhere. There is no full feature documentation even for non-dummies. And if there was it would be difficult to keep the documentation up to date since Alcscript is still under development. It is modified constantly while new features are being added to PyPRP.

So for now all we have are examples on the wiki and small snippets posted on the forum. I know it is frustrating but that is what we all have to cope with, dummy or no dummy.

The wiki btw is a joint effort. Every member of this forum can modify it (use your forum login for the wiki). So if you find something lacking in the instructions feel free to add the missing information.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: AlcScript and Python for dummies?

Postby andylegate » Sat Aug 23, 2008 4:37 am

You'll also find people on here quite helpful when it comes to ALCscripting, and sometimes that's the best way to go about it: post here.

Specifically, if you're trying to do something and you get export errors, or it's not working when you link in (what ever "it" is), then come here to the forum, post what it is you're trying to do. But also you need to post the following so we can help you:

A copy of your script: trying making this a screen shot. A screen shot will show us if you have improper spacing or indents on your scripting (something that get's just about all of us from time to time, and ends up being the problem).

What the error a problem is! There have been many people that have hollered for help, but we can't because they won't tell us what is happening or what is wrong. Just that they have a "problem".

Oh, and don't be afraid to post that you didn't understand the help or explinations. No one is going to think you're stupid or anything like that. As D'Lanor said, it's frustrating some times to not just you, or new people, but all of us.

But we'll keep helping until we get your problem solved.
"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: AlcScript and Python for dummies?

Postby Metabasalt1 » Sat Aug 23, 2008 6:51 pm

There are so many cool tricks that I see in the ages posted on the ULM, that I would like to see the blender files as to how they did it. D'Lanor's template for writing linking books and journals is good, but formidable for the noobie. I have uploaded all my files for Dragon's tooth and Ordovician ages including blender and uncompiled python files to:
http://www.mediafire.com/?sharekey=0c4d ... afed45d69e
Download LINKINGFOSSILWORKS8_23_08.
It shows a simple click code in the Alcscript and a relatively simple python code for linking between two ages.
Metabasalt
Metabasalt1
 
Posts: 68
Joined: Fri Apr 25, 2008 6:03 pm

Re: AlcScript and Python for dummies?

Postby Tinuviel » Sun Aug 24, 2008 5:43 am

It is so nice of you to help me :) I have started to read up on Python on the wiki that Godot linked to. And I begin to have a small grasp of how it works. And I did manage to make my avatar sit on a bench. Small typing error on my part… and I learned not to use Ctrl-A after I had rotated the bench to face the right y-direction. :D
I have also looked more on D’Lanors Saving Object animation states and I have a few questions if anyone would like to help.

1. At the top of the code D’Lanor has this:
SWDoorButton:
Animation:
- Name: SWdoorbuttonclick
Where does SWdoorbuttonclik come from? Is it something he names in his script or is it an object from blender?
It is the same under Door1. He has something called DoorOpen and further down I find DoorOpen1. What is the difference between them?

2. If I understand correct, I need to follow Robert’s tutorial to make my button clickable. And I managed to do that, and in the prosess made two .py files: on simple called myage.py and one for the button to be clickable. But I can’t find Robert's needed Alcscript in D’Lanors tutorial. Has he just left it out because it’s so obvious? Or has he made the object clickable without using the pythonfile Robert mentions?
I also noticed that in Robert example we have to make the clickable object convex hull polytype and the same for the clickable region. But when I look at the example of the animated door blender file, the region do not have bounds and the button is set to static triangle mesh. Why the difference?

3. D’Lanor mentions the avatar animation. What does that do? And do I need to create a separate alcscript for that or is it included in D’Lanors script?

4. What does the empty do and why do I need it?

5. I have made one SDL file and called it tower2.sdl and in it I have this:

STATEDESC tower2SDL
{
VERSION 1
VAR BOOL DoorSDL[1] DEFAULT=0
}
What is the correct spacing between the words? And shall I delete Version 1?
«Borders? I have never seen one, but I have heard they exist in the minds of some people.»
(Thor Heyerdahl)
Tinuviel
 
Posts: 106
Joined: Wed Feb 06, 2008 10:17 am

Re: AlcScript and Python for dummies?

Postby D'Lanor » Sun Aug 24, 2008 6:43 am

Tinuviel wrote:1. At the top of the code D’Lanor has this:
SWDoorButton:
Animation:
- Name: SWdoorbuttonclick
Where does SWdoorbuttonclik come from? Is it something he names in his script or is it an object from blender?
It is the same under Door1. He has something called DoorOpen and further down I find DoorOpen1. What is the difference between them?

First of all, most of the code is bob's. I added the pythonfilemods needed to save the state and split up his single responder in two separate responders.

The names don't come from anywhere. You make them up. Then you reference them in other sections of your AlcScript.

Tinuviel wrote:2. If I understand correct, I need to follow Robert’s tutorial to make my button clickable. And I managed to do that, and in the prosess made two .py files: on simple called myage.py and one for the button to be clickable. But I can’t find Robert's needed Alcscript in D’Lanors tutorial. Has he just left it out because it’s so obvious? Or has he made the object clickable without using the pythonfile Robert mentions?
I also noticed that in Robert example we have to make the clickable object convex hull polytype and the same for the clickable region. But when I look at the example of the animated door blender file, the region do not have bounds and the button is set to static triangle mesh. Why the difference?

You only need the very first section of the clickable object wiki called "Preparing the object". The rest is about the simple clickable quickscript which we are not using for the animation state.

Tinuviel wrote:3. D’Lanor mentions the avatar animation. What does that do? And do I need to create a separate alcscript for that or is it included in D’Lanors script?

You do not really need an avatar animation but the example assumes that you are using one. If you simply leave out the avatar section that script will fail. I think it would go too far to explain that right now.

Tinuviel wrote:4. What does the empty do and why do I need it?

It is the point where the avatar animation starts. It needs a starting point.

Tinuviel wrote:5. I have made one SDL file and called it tower2.sdl and in it I have this:

Code: Select all
STATEDESC tower2
{
    VERSION 1
    VAR BOOL    DoorSDL[1]     DEFAULT=0
}

What is the correct spacing between the words? And shall I delete Version 1?

Spacing looks ok (within code tags). STATEDESC name should be tower2. Without SDL (see above). Do not delete VERSION 1.


btw, a state animation quickscript will be included in the next PyPRP release to make this easier. You can grab it from the trunk for now. See instructions in this post.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: AlcScript and Python for dummies?

Postby Tinuviel » Sun Aug 24, 2008 9:36 am

Thanks for the help, D'Lanor!
I have looked at your Animation Quickscript and tried to use that one. And more questions comes off course :)

1. Where do I install the prp.quickscript.py? What I have done so far is too add it to my age.pak file. Is that correct?

2. I have looked at what Zirrus had posted when he had problems and written almost the same i my script. (see attatched file) but my button is not clickable. Is something missing from my script? When I look at my log the last line says: __init__tower2 v.1
Attachments
script.jpg
My script
script.jpg (77.12 KiB) Viewed 5798 times
«Borders? I have never seen one, but I have heard they exist in the minds of some people.»
(Thor Heyerdahl)
Tinuviel
 
Posts: 106
Joined: Wed Feb 06, 2008 10:17 am

Re: AlcScript and Python for dummies?

Postby D'Lanor » Sun Aug 24, 2008 10:12 am

Tinuviel wrote:Thanks for the help, D'Lanor!
I have looked at your Animation Quickscript and tried to use that one. And more questions comes off course :)

1. Where do I install the prp.quickscript.py? What I have done so far is too add it to my age.pak file. Is that correct?

2. I have looked at what Zirrus had posted when he had problems and written almost the same i my script. (see attatched file) but my button is not clickable. Is something missing from my script? When I look at my log the last line says: __init__tower2 v.1


You have to install prp_QuickScripts.py into your Blender scripts folder and overwrite the existing file. Try that first and if your button is still not clickable then maybe you missed something from the "Preparing the object" section.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Next

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron