Making A Store

Making A Store by Silver

The docs said “making a store is very much like making the player inventory,” and they were correct. However, they didn’t spell out the steps there and so I thought I would.

Normally, when making a Thief mission, you need to specify a Marker (fnord::Marker[-36]), which you name “StartingPoint.” To give items to Garrett at the beginning of the level, you set the starting point to “contain” those items. If you know how to do that, the rest is super-easy.

Make two more Markers. Name one “Store” and the other “LoadoutCache,” though it probably doesn’t matter what they’re named.

Go to the Store Marker and add the property “Inventory::Store,” and when the pop-up window comes up, check the box and hit OK. You should see a property that says “Store: TRUE.”

Go to the Loadout Cache Marker and add the property “S::Scripts,” and when the pop-up window comes up, write “LoadoutCache” (no spaces) into the first (“Script0”) field. Leave the other fields alone and hit OK. You should see a property called “Scripts: {LoadoutCache;;;;FALSE}.”

Here’s what happens before the mission starts:

  • The items contained by “StartingPoint” appear on the left side of the store.
  • The items contained by “Store” appear on the right side of the store, available for purchase.
  • The items contained by “LoadoutCache” get inserted into your inventory after you buy everything.
  • Any loot you had when you exit the store mysteriously vaporizes.

If your mission is the first mission of a sequence (or the only mission), you need to give the player some starting capital. Just link some loot to the “StartingPoint” marker. If your mission is a later mission in a sequence, you will automagically have whatever loot you had at the end of the last mission. Whether or not this behavior is controllable, I don’t know. I do know that if you link loot to the starting point of a latter game in the sequence, you get that as a bonus, above and beyond what you got from the last level.

Apparently, if you put an item in the store that doesn’t have the “Inventory::Purchase Price” property, you can get the item for free. Don’t bother with that, and just make sure to have the “Inventory::Purchase Price” on any item you put in the store. If you make new items, like “tip” scrolls, you’ll also need to add textual descriptions – as far as I know, you’ll need to copy strings\english\OBJDESCS.STR and OBJNAMES.STR from “strings.crf” and then append your descriptions to the lists – otherwise all the “regular” objects won’t have descriptions and names. Be sure to include the files in a “strings\english” folder in the zip file you make for Thief Loader (you ARE using Thief Loader, right?!). OBJDESCS.STR appears to be keyed by the “Inventory::Long Description” property, and OBJNAMES.STR appears to be keyed by the “Inventory::Object Name” property. [NOTE: I need to update this paragraph. The instructions I gave apparently are only useful if you want to do multi-lingual support, and bad things happen if you don’t provide all three language files or something. The descriptions can also be set in properties, but I need to look up which properties those go in].

Crystals and Arrows: the docs say you need to give the player “crystals” (Physical::Tulz::Crystal) to give him things like water arrows and whatnot. Turns out you really want to give him Physical::Projectile type objects. I had weird interactions when I tried to put water crystals on Garrett, in the loadout cache, or in the store. When I put them in the loadout cache, the ability to pick up other items was frozen. I think this was some weird effect where it was trying to execute the “crystal” script and got hung because I hadn’t just picked the crystal up. When I put crystals in the store, the mission kept telling me it was “complete” no matter what I did. I also had weird interactions with water arrows when I put them both on the start point and in the loadout cache. Instead of stacking, it seemed that the loadout cache was replacing the ones I started with. Though I still had crystals around then, so those might’ve been the culprit. My suggestion would be to only put arrows in the StartingPoint and Store, and only put basic things like the blackjack and compass in the LoadoutCache. And always use the actual weapon types for crystal arrows: put the crystals in the world, and the resultant arrows in the store/inventory/loadout.

Even in the mission “Escape!,” where Garrett is robbed of everything he owns, he still has a compass. This is a hint. ALWAYS ALWAYS ALWAYS link “Physical::Tulz::Compass::Compass2[-3853]” to the LoadoutCache (or the StartingPoint if you’re not using a store). You’re just evil if you don’t.

Don’t forget to remove the “no_loadout” from your strings\missflag.str if you make a store. Also note that you will NOT see the store running the mission from Dromed. You must exit and actually “play” Thief to get to the store. For testing, then, I suggest you give yourself all the items you’re thinking of putting in the store, then make sure to keep track that you didn’t need ALL of them, and link many of the items to the store as the last step before “release.”

I made a couple test missions to demonstrate the store/money-carry-over effect. They’re really dirt simple. I made the objective “get the horn” so it was different from “get the loot,” so I could pick any amount of loot up before going back and grabbing the horn, so I’d have different numbers to make sure they carried over right. Anyway. They’re in THIS 141K ZIP. It’s even “Thief Loader” compatible (which is to say, I stuck them in a zip file. woo.).

As to “why” have a store. I dunno. I just like ’em. I think the idea is to give people options on what kind of equipping style they prefer to use, and to give them a hint what might be necessary (thanks, Chrysta). Make sure to not give the player enough money to buy everything, or else it’s a pointless exercise.

I hope this helped. Perhaps it was a bit obvious, though.


By the by: if you can tell me why the second mission in my test keeps telling me “mission complete” when I haven’t grabbed the horn, I’d appreciate it. It might be similar to the “water crystal” problem I had before. Or sometimes it seems to do that if you have unlinked objects that aren’t somewhere grabbable, or something weird. I dunno.


About this entry