Dynamic Book Template (version 2.1)

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

Re: Dynamic Book Template (version 2.1)

Postby D'Lanor » Fri Mar 07, 2008 1:58 am

andylegate wrote:Your right, it's a texture....more specifically, it points to the name of the image you used for your texture.

That is how PyPRP saves it in the Textures prp file. It does not look pretty but it does help if you need to find back the textures that were used.

Grogyan wrote:New problem, that I hope to clear up soon, I can't click on my journal to open it.

What I always forget with clickables is making them an Actor.
"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 2.1)

Postby Grogyan » Fri Mar 07, 2008 7:19 am

Nope that didn't work, i'll work on it late in the morning when I get some sleep
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 2.1)

Postby andylegate » Fri Mar 07, 2008 7:47 am

Just some suggestions from me to help you with your problem Grogyan:

Make sure that in Blender, you logic for your Journal says:

String Name:clickfileX (name of the BookGUI.py file)

The X on the Clickfile is needed.

In your python scripting, make sure that in the PageDefs.py file you made, you have the following:

Code: Select all
AgeBooks = {'andyjournal': ('<cover src="coverandyjournal"><margin right=32 left=32>', '<font size=12 face=Arial color=000000>', 0, 0),
'agejournal': ('<cover src="leather2"><margin right=32 left=32>', '<font size=12 face=Arial color=000000', 0, 0), 'jishinjournal': ('<cover src="jishincover"><margin right=32 left=32>', '<font size=12 face=Airal color=000000>', 0, 0), 'nynavevejournal': ('<cover src="nyncover"><margin right=32 left=32>', '<font size=12 face=Arial color=000000>', 0, 0), 'philipphjournal': ('<cover src="philipcov">', '', 0, 0)}


Each of these are the actual names you gave the object that is the journals in Blender. 'andyjournal' is the name I gave the object that is my journal in Blender.

Are you getting a click hot spot when you try, but nothing happens when you click? If that's true, then more than likely it's the scripting I just mentioned above that's wrong. Look at the Python log. If you don't see an error in the log, that's most likely it.

If you DON'T get a click hot spot when you move your mouse over the journal, then the problem is in Blender. Check the logic properties for the journal and make sure you have the ALCscript set up right too. Should look like this:

Code: Select all
andyjournal:
    quickscript:
        simpleclick:
            pythonfile: Zephyr_CoveBookGUI
            region: andyjournalreg


Where Region is the logic region I put around the journal, and pythonfile points to the BookGUI python file in the Age's pak file.

Hope this helps as I run into this all the time, and normally it's I forgot to do something, or named something wrong.
"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: Dynamic Book Template (version 2.1)

Postby boblishman » Fri Mar 07, 2008 7:54 am

and like D'Lanor says ...make sure your journal object is an actor

actor.jpg
actor.jpg (110.93 KiB) Viewed 5697 times
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: Dynamic Book Template (version 2.1)

Postby Grogyan » Fri Mar 07, 2008 4:06 pm

Thanks, i'll give it a go very soon, I have other regions to do first - today is going to be a very busy day :o :shock:
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 2.1)

Postby Grogyan » Sat Mar 08, 2008 12:12 am

I have gone through just about everything, and I only have a couple of hours left before I have to send Aloys my Shell.

The book model is named s119JournalBook logic property string clickfileX s119BookGUI.py
The Region is named s119JournalRgn logic property string type region
The main script is named s119BookGUI.py
The journal script is named s119Journals.py

The AlcScript is
Code: Select all
  s119Journals:
       quickscript:
            simpleclick:
                 pythonfile: s119BookGUI.py
                 region: s119JournalRgn



[edit] Changed to reflect the right way,

Still not able to click on it, or even open
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 2.1)

Postby Grogyan » Sat Mar 08, 2008 2:14 am

Update, I have sent Aloys my Shell with the non functional journal, if I can get it to work, i'll send a new version, maybe just in time for the RAD closing date March 9 @ 12:00 PST
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 2.1)

Postby boblishman » Sat Mar 08, 2008 6:52 am

have you checked that the object centre of your clickable is inside the region ... if not, use Mesh/Transform/CentreNew to make the object centre of your clickable in the centre of the object...
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: Dynamic Book Template (version 2.1)

Postby D'Lanor » Sat Mar 08, 2008 9:54 am

If you use alcscript you should not set the property on your clickable object. Perhaps using both properties and alcscript confuses PyPRP in this case. I have never used this clickfileX property and all my clickables work fine.
"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 2.1)

Postby andylegate » Sat Mar 08, 2008 12:50 pm

I use both, ALC and the logic and all my journals work fine.

BUT....hang on, he said; "Can't click on it, or open it."

I'm taking that as he isn't getting the click hot spot when he moves the mouse over the journal. That means the problem has got to be in Blender.

I would like to point out the following: He said the name of the model is s119JournalBook

But in the ALCscripting he has it listed as: s119JournalsBooks

That "s" on the in will screw things up.

Other than that, the script looks good. So the only other thing is what Boblishman said, you have to make sure that the book is well inside the click region. I had someone else with this problem, and it turned out his journal was on the floor, and he had his click region flush with the floor. I Z scaled his region, and BAM, it worked after that.
"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

PreviousNext

Return to Scripting

Who is online

Users browsing this forum: No registered users and 0 guests

cron