Page 1 of 1

Clicking on a object to view it.

PostPosted: Fri Nov 30, 2007 4:25 pm
by andylegate
Okay, got a question here. I dithered about whether to put this under Builders or Programmers, since it's Scripting I'm talking about, but this is something Builders will want to know (IF anyone has a good answer :D )

Okay, I've been through how to make a Journal. Great tutorial by the way. Mine works and looks great.

Now, I'd like it so that an avie can click on a single page of something and call it up, just like the Relto pages, Sharper's papers on his desk in Teledahn, etc, etc.

At first I was thinking that it would be just like making a journal (and for the Blender part, that's what I've done. I can't see it being anything other than making the object, then making it clickable, and then making a clickable area).
However, when I got to the scripting part, I gave pause.

Two problems: One is the tutorial says, and I quote:

"if you want to add a new journal in you only need to duplicate your python code and change only what is needed."


Well that's about as helpful as a face full of mud. Do I simply add lines to the original def?

if (ObjectMsg.value == 'The_Object_Name'):
uam.showBook('<img scr="picture of object" align=center resize=no>', self.key)

or do I copy the whole def statement all over again? (that "self.key" has me bugged).

Next problem was, while I was thinking hard about this, I noticed something: uam.showBook.

Won't that bring up the faded journal pages with my image in the center? Is there another command, like uam.showdarnthing or something else? I'd much rather just have the picture, paper, whatever show up, and not a whole book!

Any help out there? I saw this question asked on another post, but nobody answered about it.

Re: Clicking on a object to view it.

PostPosted: Sat Dec 01, 2007 1:04 am
by Trylon
Ehm, I totally have to get into programming again to really answer your post :)

Just so we're clear - unfortunately books are the only way to show pictures at the moment.
Another thing is that the python scripting is complex (too complex :P)

I'm not sure what the self.key is exactly, but I think it only links the book to the object.
As far as I can tell you you can just copy that statement set you put up.

One word of warning though - it's better not to use the uam functions. Simply said, it's deprecated, and not maintained, and only available (legacy) in ULM.
So it can't be played by people not using ULM.

Re: Clicking on a object to view it.

PostPosted: Sat Dec 01, 2007 4:37 am
by Aloys
andylegate wrote:Okay, I've been through how to make a Journal. Great tutorial by the way. Mine works and looks great.

Thanks, it wasn't easy to put it together, glad it's of help..

Trylon wrote:One word of warning though - it's better not to use the uam functions. Simply said, it's deprecated, and not maintained, and only available (legacy) in ULM.

Yeah, it's an old tutorial, but I'm not into programming enough to dwelve into ULM functions again and update it.. :(

it can't be played by people not using ULM.

But it works for people who still use UAM (yeah I'm pretty some still do)
Is there a way at all to make a journal without requiring to the UAM or ULM API?

Re: Clicking on a object to view it.

PostPosted: Sat Dec 01, 2007 6:07 am
by andylegate
Heheheh, I gave up and just left the items sitting there. Here is what happened:

First I tried just making copies of the lines:

if (ObjectMsg.value == 'The_Object_Name'):
uam.showBook('<img scr="picture of object" align=center resize=no>', self.key)
if (ObjectMsg.value == 'paper2'):
uam.showBook('<img scr="pic_paper2" align=center resize=no>', self.key)
if (ObjectMsg.value == 'paper3'):
uam.showBook('<img scr="pic_paper3" align=center resize=no>', self.key)

But PlasmaShop gave me a syntax error. So, as that self.key was bugging me, I changed it to this:


if (ObjectMsg.value == 'The_Object_Name'):
uam.showBook('<img scr="picture of object" align=center resize=no>')
if (ObjectMsg.value == 'paper2'):
uam.showBook('<img scr="pic_paper2" align=center resize=no>')
if (ObjectMsg.value == 'paper3'):
uam.showBook('<img scr="pic_paper3" align=center resize=no>', self.key)

And PlasmaShop compiled the file just fine! Yay! I did a little Dance Of Happiness, proclaiming myself Real Smart.

Then when I loaded up my age, I waked over and clicked on one of the objects........and crashed back to the desktop!

Oooooookay, so I'm not as smart as I thought I was... :oops:

I just made the objects unclickable and removed the coding that I added. Everything went back to normal, including the Journal. :D I'll mess with it later (hopefully I hear something from someone that actually KNOWS about the script, hehehehe, unlike me!)