Dynamic Book Template (version 3.0)

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

Re: Dynamic Book Template (version 3.0)

Postby Sophia » Fri May 09, 2008 9:22 pm

Robert The Rebuilder wrote:Here's some rough steps to get you going. [Note to self and others: there really should be a Wiki tutorial on this!]

To create a click region:
- Choose Scripts->Add->PyPRP, then choose "Add a (Generic) Logic Region". It will appear in layer 2.
- Select it, then move it to the place where the avatar will be standing when they attempt to click on the object
- Scale it so that it can encompass an avatar and the object that is clickable, then hit Ctrl-A to apply scale and rotation into the vertices
- Rename the object to something meaningful (e.g. MyClickRegion)
- On the Logic panel, click on Bounds, then set it to "Convex Hull Polytope"
- Click the Actor button on the Logic panel

To make an object clickable:
- Select the object
- On the Logic panel, click on Bounds, then set it to "Convex Hull Polytope"
- Click the Actor button on the Logic panel
- Add the following AlcScript entry:

Code: Select all
ObjectName:
    physical:
        pinned: true
    quickscript:
        simpleclick:
            pythonfile: myPythonFile
            region: MyClickRegion

But change "ObjectName" to your object's name, "myPythonFile" to the name of your python file, and "MyClickRegion" to the name of your click region.


I am trying to follow this tutorial, I got most of it, except for the last part (Add the following AlcScript entry"

Could anybody please explain where and how to add this? Thanks :) I am learning :)
Sophia
 
Posts: 93
Joined: Sat Feb 09, 2008 3:53 pm

Re: Dynamic Book Template (version 3.0)

Postby Grogyan » Fri May 09, 2008 10:36 pm

Sure

move you mouse cursor to the edge of any of the windows in Blender till the point at which the cursor changes.
Right click your mouse button and select "Split area" and drag the edge to suit your needs
At the bottom left hand corner of that window (or upper left hand corner) you'll see an icon, left click on that
Select "text editor",
Along the menu bar you'll find a sub menu when you left click on it,
Just select from the sub menu AlcScript and drag the scroll bar on the left hand side of the text editor all the way to the top,

This is the area in which you physically type in your AlcScript

word of caution, be sure to double check your indentations, as the script is very finicky about it
Better to have loved and lost than never to have loved at all
User avatar
Grogyan
 
Posts: 1203
Joined: Thu Oct 11, 2007 1:27 am

Re: Dynamic Book Template (version 3.0)

Postby Sophia » Sat May 10, 2008 7:30 am

Thanks Groyan! I did as you said, but somehow I can't find "AlcScript" in the list. In the submenus I only see "text" and "init" (I added that one), as well as "Mesh editing", "Object editing" and "Script constraint". Did I forget something somewhere?
Sophia
 
Posts: 93
Joined: Sat Feb 09, 2008 3:53 pm

Re: Dynamic Book Template (version 3.0)

Postby D'Lanor » Sat May 10, 2008 7:38 am

You forgot to create a book. In the Scripts menu > Add > PyPRP > Create New Book
"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: Dynamic Book Template (version 3.0)

Postby Sophia » Sat May 10, 2008 7:54 am

:) D'l :)

Wish it were that easy, lol. No, I created all the basics, book, spawn point etc, I have been looking at my *cough* age in Uru CC already.
Sophia
 
Posts: 93
Joined: Sat Feb 09, 2008 3:53 pm

Re: Dynamic Book Template (version 3.0)

Postby D'Lanor » Sat May 10, 2008 8:04 am

In that case AlcScript should be there. I don't know why you cannot see it then. Try the button that says "Browse existing choices or add new". The book entries are somewhat hidden if you haven't used them before.
"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: Dynamic Book Template (version 3.0)

Postby Sophia » Sat May 10, 2008 9:13 am

Aaaah, after some investigation I found the answer. :D I installed the original Alcugs code (version 0.5) of PyPRP and I just found out it might have been a tiny bit outdated, lol. I installed the latest version 1.3.1 and all is well now, my apologies for the misunderstanding! Now... let me see if I can get my book to work :geek:
Sophia
 
Posts: 93
Joined: Sat Feb 09, 2008 3:53 pm

Re: Dynamic Book Template (version 3.0)

Postby Sophia » Sun May 11, 2008 9:36 pm

Sorry about the double post, I thought of sending a PM but figured others might struggle as well and need the same answer.

I created a simple age called "MyFirstAge" (nothing more than a plane really)
Added a box, named it Journal. Gave it properties "Convex Hull Polytope" and "Actor"
Added a general (logic) region, named it "ClickJournal", gave it too properties "Convex Hull Polytope" and "Actor"
Added the following to the AlcScript:

Code: Select all
# Make journal clickable
Journal:
    physical:
        pinned: true
    quickscript:
        simpleclick:
            pythonfile: MyFirstAge
            region: ClickJournal


Using the 3 .py files, only changed *YourAge* by MyFirstAge and *YourTexture* with MyFirstAgeJournalCover (did not add .jpg), touched nothing else
created a .pak file using UruPython (no errors either)

I converted my age and I got no errors, and when I visit it, it certainly shows the book as clickable. Yet, when I click it, nothing happens. So once again I need help :oops:
Sophia
 
Posts: 93
Joined: Sat Feb 09, 2008 3:53 pm

Re: Dynamic Book Template (version 3.0)

Postby D'Lanor » Mon May 12, 2008 12:47 am

The line ageBooks = ['Journal01', 'Journal02'] should contain the name of your book (clickable object).
"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: Dynamic Book Template (version 3.0)

Postby Sophia » Thu May 22, 2008 3:43 pm

Oh I'm forgetting my manners, I completely forgot to say it works now, thanks for your help D'l.
Sophia
 
Posts: 93
Joined: Sat Feb 09, 2008 3:53 pm

Previous

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron