The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing "Diary" section into something useful (Maps)
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#1
Information  Changing "Diary" section into something useful (Maps)

This quick little guide is a suggestion if you'd like to make use of the "Diary" section of the journal without adding just plain old diary pages. In the original game, the diaries worked pretty well, but for custom stories, they easily get redundant because they're so much like regular notes. Here are a few things you can do about it!


This works for MODS as well as CUSTOM STORIES.


Take advantage of the customized background
[Image: tAetUl3.png]

This can be used for many things. I'm going to show you how you can make cool looking in-game maps for your story. You can of course make anything else you'd like, for example easter egg photos or art or such.

Let's start by changing the whole DIARY section of the journal to our own section. Open your extra_english.lang file and create an entry like this one within your Journal category.

PHP Code: (Select All)
<Entry Name="Diaries">MAPS</Entry

The entry must be named Diaries and I recommend you make the text upper case, because that's how it is originally. This will now change your journal to display MAPS instead of DIARIES when you press J. While we're at it, let's also add the entry for the diary itself.

PHP Code: (Select All)
<Entry Name="Diary_MapMachine_Name1">Map of Machine Room</Entry>
<
Entry Name="Diary_MapMachine_Text1"></Entry

Notice how I left the Text blank. You don't want text over your image, but you can have a title. Edit the MapMachine to whatever you want to use.

The next part includes giving the player a diary note that displays the map. There are two ways you can give them the note. Editor and script. Both require a little work. But before we do that, let's make sure we've prepared our custom background image file.

Creating the image

I use Photoshop for creating images, but a free alternative is Gimp. I'm gonna let you take care of how to aquire your image :P

The primary background does not need a pow² resolution. In other words, just make it a suitable size of around 500x500 pixels. You can add some if you'd like, but if it exceeds it, it might underlap the title and close button, which is ugly.
Export the image as Targa (.tga). DON'T FORGET to add an alpha channel, or else the transparency won't work around the edges!

Also, when naming the file, name it <yourfile>_large.tga. This is because you need 2 images. Once you're done, resize another copy to 20x20 pixels. Export it just the same, this time naming it <yourfile>_icon.tga.

My files look like this:

Spoiler below!
machineroom_map_large.tga
[Image: nPCYwAk.png]

machineroom_map_icon.tga
[Image: fGItunl.png]

Now we have the images. Place them in custom_stories\<yourstory>\graphics\journal.

Editor

In order to get your custom background to work on the diary note item itself, you need to create a new entity for it. This is because the background is baked into it. You won't need to do this if you're using the script method.

PS: Narration is locked on the diary note. This means that if you do not add a voice file in the lang entry, the item will instantly jump to the journal as you pick it up without giving the player any preview. Take a look at the optional details below.

Open the Model Editor and find diary_paper01.ent. Go to Settings > User Defined Variables and at the bottom you'll find ImageFile. Change that to the name of your own file EXCLUDING _large.tga. If you named yours map1_large.tga, then only write map1 into the box. Once you're done, go to Save as and name it something else (for example map_machineroom or something).

Remember that when using custom entities in your custom story, you need to keep the .ent file in the entities folder in order to use them in the Level Editor. This does not apply to the game itself though, so copy the file to custom_stories\<yourstory>\entities when you're gonna give the story to someone else.

Once you're done, simply add the item to your map with the Level Editor. Go on the Entity tab and add the entry for the title in the DiaryText box.

Script

If you do not want to make a custom entity, you can use the script. There is a simple line that does all the work for you.

PHP Code: (Select All)
AddDiary(stringasNameAndTextEntrystringasImage); 

Just enter the lang entry and the image name (excluding _large again). This will give them the map right away. The only difference is that they won't know they got it unless you make it obvious. Those details can be added manually.

Extra optional details

Spoiler below!
If you want to fix some mentions of "diary" in the game, add these to your lang:

Journal category:

PHP Code: (Select All)
<Entry Name="DiariesEmpty">No maps are available!</Entry

Outside the Journal category:

PHP Code: (Select All)
<CATEGORY Name="Actions">
    <
Entry Name="RecentTextTooltip">Brings up most recently read text (note or map).</Entry>
</
CATEGORY

If you have the diary item in your level and do not use any voice files in the lang, you can simulate the PickUp effect of any item instead. On the Entity tab of the diary note at the bottom, is the callback. Write something there (for example MapMsg), then add this to your script file:

PHP Code: (Select All)
void MapMsg(string &in asItemint iDiaryIdx)
{
    
SetMessage("Message""PickUpMap"3);
    
GiveHint("maphint""Hints""HintPickMap", -1);


Also add this to your .lang file:

PHP Code: (Select All)
<CATEGORY Name="Message">
    <
Entry Name="PickUpMap">Picked up Map</Entry>
</
CATEGORY>

<
CATEGORY Name="Hints">
    <
Entry Name="HintPickMap">You have picked up a mapTo view your mapsopen the journal ($ButJournal) and click on maps.</Entry>
</
CATEGORY

This will add a pickup message as well as a hint for the map, making it easier for the player to know what's going on. This applies to both editor and script methods.



I think that's everything. This obviously turned out way longer than I thought. Hopefully I didn't forget anything, but if you have anything to add, just tell me ^^

Thanks for checking it out! Heh, took me a few hours to write.

(This post was last modified: 06-01-2015, 09:35 AM by Mudbill.)
04-07-2014, 08:34 PM
Find


Messages In This Thread
Changing "Diary" section into something useful (Maps) - by Mudbill - 04-07-2014, 08:34 PM



Users browsing this thread: 1 Guest(s)