This chapter deals with getting the text resources organized so we can begin scripting. You may not have ever used a text resource before, but you should have, and guess what, you are going to now.
Looking over the list of tutorials, I see that not much has ever been said about text resources. One of the few things that I did find was where Brian's tutorial said that we wouldn't ever actually use them much except maybe if you wanted to translate your game into other languages. He was definitely a little short sighted on that aspect, Text Resources are VERY important primarily because they can help to preserve your heap space memory. I don't know if you've ever gotten one while playing a Sierra game, but if you begin to make a game of any size at all, it won't take long before you begin encountering it in your own game. The best plan, is to manage your resources from the beginning. Anyway, we will be making use of the text resources, not only for heap concerns, but because they will actually ease some of your scripting.
Using SCI Companion, begin by selecting the "New Texts" Icon in the Explorer Toolbar.
After clicking on it, the Text Editor will pop open.
Clicking on the <Click to add new text> will highlight it allowing you to enter whatever text statements that you would like. These are the same statements that you would be using Print or Display for normally in your rooms scripts. Instead you are just putting them here. After you have typed in your statement, press enter on your keyboard before going to any other SCI Companion screen, it won't remember what you typed if you don't hit return. Now, with a few lines typed in, click on the save icon and select a resource number to save it as.
In order to use the text resource that you created, you will still use Print or Display just as you normally would, except now instead of using quotation marks and entering the text, you will just reference the resource number and the line number. You did notice that all of the lines you entered were numbered right. So now, your Print statements will look something like this
OK, that sums up your quick little tutorial on how to make a text resource, now it's time to put it into action.
We are going to be using two text resources for the inventory room. The first one, number it 500, is going to hold all of the inventory item's descriptions. The ones that Chapter 18 of the Volume I tutorial had us placing in the main script and I said not to. Now just like with the cursors, the row numbers of the texts need to correspond with the number that the item was defined as. So Item Cash, defined as 1, uses cursor 1, and also text resource 500 line 1. Are you starting to see a pattern forming here. We are going to use line 0 for a response of clicking on an item with itself, just because we don't have any other use for it, no point in wasting it.
Open up a new text resource and let's begin.
That is all we need out of this text for this tutorial, save it as number 500. As a side note, notice line 1, the reference to inventory item 1, the cash description's text includes a variable. That variable is going to get changed into the totalcash we added to the mainscript later on by the Print statement. I just wanted you to notice that it was possible to do that using text resources.
Now, it's time to create the other text resource we need in the inventory room, may as well number it 501 just to keep the two close. This resource is going to include all of the text which isn't a description of an item, for instance the help messages, maybe a funny line or two about trying to combine two incombinable items, or even to let them know that items were combined successfully. Technically all of this stuff could have gone into resource 500 but that would throw off the high tech numbering system which quite honestly means that we would have to do a lot more work later when we attempt to script in other items. So I put this stuff in 501 to save myself trouble later, and I'm expecting you to also.
All right, that is that, we now have the two text resources for the point and click inventory room. Remember 500 holds descriptions for when an item is Looked at, and 501 is basically for everything else that you might want to Print to the screen while the user is in the inventory room.
That sums up the creation of the Inventory's Text resources!
< Previous: Chapter 2 - Ordering the Cursors Next: Chapter 4 - Inventory Views >Top
You can help keep The Sierra Help Pages and its affiliates alive by helping to defray some of the costs of hosting this site. If it has been of help to you, please consider contributing to help keep it online.Thank you.
The Sierra Help Pages | Sierra Game Help | Walkthroughs | Hints, Tips & Spoilers | Utilities | Links | SHP Forums | Search
© 2013 to present The Sierra Help Pages. All rights reserved. All Sierra games, artwork and music © Sierra.