Display Chapter Title

Avatar
muffelbrot90
10 Posts
Posted Sep 12, 2011
Hey!

I used the search function but didn't find a solution for my problem. I want to display a chapter title at a certain point of the map. To see what I mean, click the video below and jump to 2:48!

http://www.youtube.com/watch?v=43CL70JT4bY

Thanks a lot!

Advertisement
Registered users don’t see ads! Register now!
Avatar
iWork925
1,080 Posts
Posted Sep 12, 2011
Replied 3 minutes later
img

game_text

Avatar
muffelbrot90
10 Posts
Posted Sep 12, 2011
Replied 1 hour later
I had that idea by myself. But how do I change the font size?
Avatar
ChickenMobile
2,460 Posts
Posted Sep 12, 2011
Replied 4 hours later
There are multiple entities you can use to make text appear on the screen, the easiest being game_text and the most customisable being an env_message. The text for an env_message is defined inside titles.txt which is located in your Portal2/scripts folder. This is also where the Chapters titles should be listed. Also look at portal2/resource/portal2_english.txt for the chapters.
Remember: env_message uses titles.txt to display a title instead of typing in the text you want inside the text keyvalue.

If you are creating a mod and want it to appear like a genuine chapter, try looking at this page: http://developer.valvesoftware.com/wiki ... o_your_mod
Decompiling is also the key -> the chapter titles are displayed through the sp_transition_list.nut which make the chapter titles look the way they do.

I will fiddle around with this later to see if I can get it to work.

===================================================================================================
EDIT: Getting this to work is relatively easy, and doesn't involve adding anything into titles.txt or portal2_english.txt or creating another .cfg for your new chapter like you usually would do. It just involves a script and a couple of entities in game. Luckily for you I made an example right here: portal2.7zWhen you publish your map remember to include the script by packing it into the .bsp or by creating a vpk.

Attachments
portal2.7z
0.00 MB 62 downloads
Avatar
muffelbrot90
10 Posts
Posted Sep 14, 2011
Replied 1 day later
Hey, thank you for the help!

But i think this is quite complicated. My Current Project is a short campaign including only four maps. The chapter title would be displayed only once - at the beginning as campaign title. I don't think this is worth the effort.

Avatar
ChickenMobile
2,460 Posts
Posted Sep 14, 2011
Replied 22 minutes later

muffelbrot90 wrote:
Hey, thank you for the help!

But i think this is quite complicated. My Current Project is a short campaign including only four maps. The chapter title would be displayed only once - at the beginning as campaign title. I don't think this is worth the effort.

How isn't it worth the effort when I have done the work for you?

Avatar
iWork925
1,080 Posts
Posted Sep 14, 2011
Replied 6 hours later

muffelbrot90 wrote:
Hey, thank you for the help!

But i think this is quite complicated. My Current Project is a short campaign including only four maps. The chapter title would be displayed only once - at the beginning as campaign title. I don't think this is worth the effort.

If its worth doing, its worth doing properly.

Avatar
Spam Nugget
492 Posts
Posted Sep 15, 2011
Replied 14 hours later
wow, this is pretty damn good. Thanks, chickenmobile.
Avatar
ChickenMobile
2,460 Posts
Posted Sep 15, 2011
Replied 10 minutes later

Spam Nugget wrote:
wow, this is pretty damn good. Thanks, chickenmobile.

No problem.

muffelbrot90 - learn from this!

Avatar
Vordwann
767 Posts
Posted Oct 21, 2011
Replied 1 month later
You can also go into map properties, where there is a Title text field...
Avatar
beecake
484 Posts
Posted Oct 21, 2011
Replied 28 minutes later
I dont understand the titles.txt. What do i have to write to have it display, lets say, "level 1" in a level called "map 1"? This is just an example for my understanding, please :smile:
Advertisement
Registered users don’t see ads! Register now!
Avatar
ChickenMobile
2,460 Posts
Posted Oct 21, 2011
Replied 6 hours later

beecake wrote:
I dont understand the titles.txt. What do i have to write to have it display, lets say, "level 1" in a level called "map 1"? This is just an example for my understanding, please :smile:

You do not need titles.txt. If you read my post above you would have known that. All you need is the script running/supplement the script through console commands (point_servercommand / logic_auto) AND a couple of game_texts in your map.> Vordwann wrote:

You can also go into map properties, where there is a Title text field...

Does it actually display the title chapter without putting all the extra info into titles.txt and others?