How to add a readable content in my mod ?

+
How to add a readable content in my mod ?

Hi, I'm trying to add some written documents in my mods quest, such as notice board contracts, books and letters. I don't have a clue about how to do it.
Looking at notice boards in the original games told me they were containers whe the player collects some entity with a tag, but how do I link it to an actual text?
 
Hi,
adding readable content e.g. book or letter is quite complicated.
I don't know if there is difference, how game handles book instance or letter instance (e.g. sell-able, equip-able, ... etc),
so for you be best to experiment with this - or better, if you know, how handles it.

How to create book:
1) Save work and close editor
2) go to witcher instalation path and to /data/items/
3) edit def_item_books.xml - i hope you know how - check the content, its quite simple; REMEMBER YOUR BOOK NAME (e.g. "my book"); and save
4) open your editor and open strings db editor - its upwards panel with your project - it is slow, will load for a while and say "red editor, red strings" in pop up window and will load to new standalone window
5) Select tab "add/modify string", select "string key" in drop down menu
6)write your book name e.g. "my book" to "string key/id" and click "find" - at the bottom it will say something like "string was not found and will be created".
7) write book title to "string value" text box e.g. "my awesome book"
8) click buttom bellow to save it
(after save, string editor may reload if you switch tabs, so be patient. I think it will regenerate whole database again. On my old laptop, it took about 30 seconds or so.)
9) Same as you added title of your book, add content of your book as <name of book>_entry e.g. "my book_entry"

BOOM - your book and text for it is created.

How to make your book as graphical object on map, pickable:
1) create new entity template in your project
2) change its class to CContainer
3) add mesh component and link desired mesh
4) add inventory component
5) go to inventory tab, click "+"
6) select category as defined in xml, define values, set initializer to uniform, and select your book from drop down.
7) add interaction component, sets its action to container, define friendly name. e.g. "pick book"
8) save and place to scene
9) start your project and test

BOOM - you should be able to pick book to your inventory and read it.

There are 2 problems i still encounter - book does not have icon in inventory; and interaction still shows, even if book has been looted already.
Dont know how to fix this.

But gl hf.

You are right about notice boards, they are like containers - if you have still problems with this, i can look into it.
Not sure if letters are books, only with different icons, or totally independant objects.

If you have any problems, try to ask again :)

 
Hey, thank you so much for your answer. Unfortunately, it doesn't work as well as planned :p

To create book (yeah, letters are books like everybody else, with a different mesh):
" 5) Select tab "add/modify string", select "string key" in drop down menu" -> "String key" doesn't appear in the dropdown menu. There is Line Text, Name, comment, description, etc. But no "string key". I tried with Name and Line Text, both seem to have the same result.

How to make the book as graphical object to pick-up:
" 6) select category as defined in xml, define values, set initializer to uniform, and select your book from drop down." -> And that's where the book doesn't appear in the dropdown. I checked I did use the right category ("book") that is used in the xml file, but something doesn't work.

It works for errands, though. They can successfully be linked to notice board's inventory... at least when you play in the editor, which show that you have the right contracts in the notice board, but doesn't display the strings (it also does that to vanilla contract, so it isn't a problem so far).
But once you cooked the file and try to open it from the game engine, the notice board appears empty. It only displays vanilla contracts but not custom made ones. Something must be lost during the cooking, is there 2 different string DB for editor and the main game?


 
Hi,
try following in order:

1) Save work, close editor
2) check again xml - check if there is your book, check if it has "about the same attributes" as other books, check if xml is valid in some online validator, check the name of xml is the same as original one
(It required admin rights for me, so i couldn't save - needed to save to desktop - delete original and copy new one)
3) open editor (it reloads database automatically) and try to find your book again in inventory tab

First step is to be able to see book here.
Once you see it, the other problem with book text :
- If you don't have "string key" option in drop down, search in database for string of some book,
e.g. "book of poetry" - it should find "Dandelion's book of poetry" and "Dandelion's book of poetry_entry"
- check types of these entries and use same ones for your book.

El_Cam;n9377651 said:
It works for errands, though. They can successfully be linked to notice board's inventory... at least when you play in the editor, which show that you have the right contracts in the notice board, but doesn't display the strings (it also does that to vanilla contract, so it isn't a problem so far). But once you cooked the file and try to open it from the game engine, the notice board appears empty. It only displays vanilla contracts but not custom made ones. Something must be lost during the cooking, is there 2 different string DB for editor and the main game?
I would bet that if it cannot find notice string, it would not include it while cooking, so that's why you might see empty notice board; ... or some other configuration.
I think that there is this string db, and there are also localized files e.g. something like "en0.w2strings" somewhere in witcher 2 installation path. Don't know about these - try to search string db for different languages, but i think i haven't seen them.

If you have problem that you can't see any string, even from original books/notices, .etc - try to verify,repair,re-install witcher game and/or editor.
 
Top Bottom