Korman and Journals - how to add images?

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

Korman and Journals - how to add images?

Postby ametist » Mon Jun 08, 2020 11:14 pm

Adding journals to my age Tiam was very simple with Korman, I created a book object, wrote the text in blender text editor, added the journal modifier to the book object, filled it in and 'tada'! In game the book popped up when clicked :) . So good so far.

But I made a little mistake (of course :lol: ), I didn't check the settings, or I didn't read the instructions properly, so when Tiam was put onto DI, the book popped up closed. I had not provided a book cover image so the default cover was shown.
Ok, easy fix, I just changed the 'Display Settings' in the modifier to 'Open'.

Now I want to add images and when I read the tutorial it says:
When adding each image to your journal, be sure to use its name as it appears in the Image Library list. For example, if you add an image named GUI_Note.png to the library, it will be finalized as GUI_Note.hsm. Therefore, the source attribute of the image tag in your journal must use this name (e.g., <img src="GUI_Note.hsm"> ) and not the original filename, GUI_Note.png.


So how do I do that in a blender text file? Can I just copy a ….PageDef.py and paste it into blender text editor?

The same question applies to fonts- it seems I cant change the font used in blender text editor(I have searched in user prefernces with no luck) - I would like to use another font in the journals.
User avatar
ametist
 
Posts: 300
Joined: Fri Dec 28, 2007 6:55 am

Re: Korman and Journals - how to add images?

Postby Doobes » Tue Jun 09, 2020 2:53 pm

Looking at your post again, I've shortened this post a bit for clarity. :D

From what I can see, you just need an image library mod for journal covers and photos so they all export uniformly with the .hsm extension. If something doesn't appear properly like your cover, it's most likely because the game is looking for something different for its extension (I've run into it many times :P ).

One of these babies should do the trick, with your cover and picture image files added in:
Image
KI #s: MOULa - 6302, Minkata - 35287, Gehn - 14291,
TOC - 82340, DI - 44387
Image
User avatar
Doobes
 
Posts: 201
Joined: Thu Aug 07, 2008 6:08 pm
Location: Savannah, GA, USA

Re: Korman and Journals - how to add images?

Postby ametist » Tue Jun 09, 2020 11:17 pm

Thanks Doobes, yes, you have a lot of books in your ages :) .

When I use the 'easy way', described in the korman tutorial, I shall write the journal text in blender text editor and then 'tell' the journal modifier to pick that text file. Which it does, no problem there. But I can not add images with this method, I have tested the image library modifier, there is no way for me to add that source tag in the simple text file. But it seems to me you use the 'old way', because you have this nice font? Do you use python nodes to add your journals/books - like this?

.
Attachments
JournalPyNode.jpg
JournalPyNode.jpg (69.03 KiB) Viewed 255 times
User avatar
ametist
 
Posts: 300
Joined: Fri Dec 28, 2007 6:55 am

Re: Korman and Journals - how to add images?

Postby Tsar Hoikas » Wed Jun 10, 2020 11:37 am

ametist wrote:When I use the 'easy way', described in the korman tutorial, I shall write the journal text in blender text editor and then 'tell' the journal modifier to pick that text file. Which it does, no problem there. But I can not add images with this method, I have tested the image library modifier, there is no way for me to add that source tag in the simple text file. But it seems to me you use the 'old way', because you have this nice font? Do you use python nodes to add your journals/books - like this?


I'm not sure I understand "there is not way for me to add that source tag" -- you type in <img src=ImageNameHere.hsm>. It will only display as that text in Blender, but it should appear as an image in Uru. Please correct me if I have misunderstood the problem.

I would advise against trying to use Python nodes to make your journals. The methods used in PotS and MOUL are different, so you would have to set up different journal nodes for each engine. The journal mod does this for you :)
Image
User avatar
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2028
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Korman and Journals - how to add images?

Postby ametist » Thu Jun 11, 2020 4:26 am

Tsar Hoikas wrote:I'm not sure I understand "there is not way for me to add that source tag" -- you type in <img src=ImageNameHere.hsm>. It will only display as that text in Blender, but it should appear as an image in Uru. Please correct me if I have misunderstood the problem.


No, you did not, that was me expressing myself badly. I meant I have tried and tried, placing that on a single line, directly after some other text etc etc, and no image was visible on the page. But I found the issue today! I wanted to add this .png with some sketches on. It came to me that I hadn't tried a .jpg so I did, and that worked!
When that worked I also got along to add code for changing the font so this: <font size=24 face=Michelle color=000000> made me happy. :)

Now, that was Part1 - fixed :lol: on to Part 2:

The image is stretched in the book - is it possible to fix that in some way? In this screenshot I have the journal mod to scale the height of the book to 80%, but as you see the image is a bit stretched anyway.

Tsar Hoikas wrote:I would advise against trying to use Python nodes to make your journals. The methods used in PotS and MOUL are different, so you would have to set up different journal nodes for each engine. The journal mod does this for you :)


Yes, the journal mod is great, so easy to use compared to the old way! I'm glad I do not have to use Python nodes for this ;)
Attachments
StretchedImg.jpg
StretchedImg.jpg (65.45 KiB) Viewed 220 times
cuts.jpg
cuts.jpg (24.35 KiB) Viewed 220 times
User avatar
ametist
 
Posts: 300
Joined: Fri Dec 28, 2007 6:55 am

Re: Korman and Journals - how to add images?

Postby Tsar Hoikas » Thu Jun 11, 2020 12:20 pm

I think using <img src=whatev resize=no> should do the trick on the resizing. You can also use pos=x,y and align=[left|center|right] to help place the image.
Image
User avatar
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2028
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Korman and Journals - how to add images?

Postby ametist » Fri Jun 12, 2020 7:22 am

Nice, thanks! I will test that. :)
User avatar
ametist
 
Posts: 300
Joined: Fri Dec 28, 2007 6:55 am

Re: Korman and Journals - how to add images?

Postby Doobes » Fri Jun 12, 2020 9:07 am

Tsar Hoikas wrote:I would advise against trying to use Python nodes to make your journals. The methods used in PotS and MOUL are different, so you would have to set up different journal nodes for each engine. The journal mod does this for you :)


I concur with our benevolent Tsar. :) The journal node tree is outdated and superseded by the newer journal mod. I can confirm that the mod works when exporting for both MOUL and PotS-based shards (if the latter has Offline KI).
KI #s: MOULa - 6302, Minkata - 35287, Gehn - 14291,
TOC - 82340, DI - 44387
Image
User avatar
Doobes
 
Posts: 201
Joined: Thu Aug 07, 2008 6:08 pm
Location: Savannah, GA, USA


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest