This tutorial covers all the variations of how to place loot, randomly, and in footlockers.
Please Note that all Thievery base files like ThieveryMod.u and ThieveryObjects.u should be loaded.Placing Loot
This is a fairly simple procedure. Go to Actor->Decoration->ThieveryObject>ThObjectSwag-> and add the loot of your choice to the game. Note that any ThieveryObject can be made into loot, not just ThObjectSwag.
Loot placed in this fashion will always exist in single and multiplayer, where you left it.
If you bring up the loot objects properties, expand the ThieveryObject section. The following items are of relevance:bCanPickup - This allows the player to physically be able to pick up the object.
It is useful for multiplayer games when the location of the loot randomly shifts around from place to place. This encourages the player to explore and helps keep the map fresh and interesting.
Random Loot - Method 1: ThLootDestroyer
This is the simplest way of having random loot on your level. You fill your level up with excess loot and then the ThLootDestroyer will randomly delete a portion of your items, thus leaving a random selection.
The ThLootDestroyer can be found under Actor->Info->TInfo. Simply place one on the map and fill out its properties as desired:
Random Loot - Method 2: TLootDispenser
These classes are used to randomly spawn loot items only. Look under Actor->Info->TInfo, there you will find TLootDispenser and TLootDispenserLocation.
Random Loot - Method 3: ThLootSpawners
This method allows you to randomly place a precise selection of objects at precise locations. This also supports spawning pickups and other non-loot items. There are 3 actors that help you place random items around your maps. They are all subclasses of Info.ThieveryMod.ThLootSpawnerMaster
These two are used in unison. First place a ThLootSpawnerMaster somewhere on your level (the location is irrelevant) and bring up its properties. You can place up to 64 classes of item in the LootList. Also fill out the SlaveTag with a unique name.
Now, create ThLootSpawnSlaves everywhere you want the items to appear, and set their Tag to the unique name set in the master's SlaveTag.
When the game starts, the items in the loot list of the master will be randomly distributed throughout the slave locations. Only one item can appear at each location, and if you have more locations than items, some locations will be empty.
Remember it doesn't have to be loot you're spawning, these can be used to randomly place a key or something at different locations around your map.
Please note, the items are MEANT to fall to the nearest surface when the game starts, but sometimes they end up floating. If this is the case you have to move teh ThLootSpawnerSlave down to match the surface. This can be quite hassle. Sometimes it helps to set the slave to DrawType DT_Mesh and set the mesh to that of the item you are randomly placing, that way you can line it up perfectly.
You can also set bItemHidden on the spawners, the resulting items will be hidden, floating and non-solid (for use with ThObjectFootlockers).
You can set ItemInheritsTag, the resulting spawned item will inherit this tag, useful for various triggers, ThObjectFootlockers and suchlike. There is also ItemInheritsEvent, which will set the spawned item's Event, useful if you want the item to trigger something when picked up.
Finally, there is bUseSlaveRotationForItem, which causes the spawned item to take on the rotation of the slave that spawned it. Useful for keys and other upright meshes.
This actor is used to spawn a single item on your maps. Simply place one of these actors where you wish the item to go. Bring up the item's properties and you will see under ThLootSpawnerSingle, the entry LootList.
Put as many classes of items as you like in the loot list (up to a maximum of 16). They can be any type of actor, so this can be used to spawn objects other than loot.
When the game starts, one of these will randomly be picked and spawned in this place.Advanced Stuff: Custom Items
Okay, so say you want to use a ThLootSpawnerMaster and a bunch of ThLootSpawnerSlaves to place a key to the Secret Room Full of Treasure and Chocolate. There's a problem in that the spawners create instances of a particular class with their default variables, so how do you set the key to have the correct keyTag to open that room, as you can't edit its properties?
You create a custom class.
Find your key of choice in the actor hierarchy, and create a new subclass, giving it an appropriate name (e.g. ThPickupSilverKeyToChocolateRoom) and putting it inside your MyLevel package. Now you can edit the default properties of that class, changing its keyTag, HUDName, anything you like.
Now set the ThLootSpawnerMaster to create one of these and hey presto, one of your customised keys pops out. Lovely.
Placing Items in FootLockers
This is a lockable chest which can contain items.
When the chest is opened, the player will automatically frob any items with the matching ItemTag. So to give the appearance of loot inside the chest:
Place the footlocker somewhere.
Place some loot nearby/inside the chest, make sure it is set to bHidden so the player cannot frob it directly.
Set the loot's Event->Tag to a unique word (e.g. LootInLocker1).
Set the footlocker's ItemTag to match.
Et voila! When the player frobs the chest, it'll open, they'll automatically frob the loot (no matter where it is) and pick it up
You can make the chest locked, setting the keytag to match the key which will open it (see the doors document for more info). You can also make it pickable, setting the difficulty of the lock.
Using ThObjectFootLockers with ThLootSpawners
ThLootSpawners create instances of a particular class, with the default settings, so how do you set the item's tag so it can be linked to a footlocker? and how do you stop it falling?
A couple of new properties in the ThLootSpawners:
bItemHidden - makes the item bHidden, floating in the air invisibly and non-solid where it's spawned.
ItemInheritsTag - the spawned item will inherit this tag
For a ThLootSpawnerSingle
Place the loot spawner, set it's loot, set bItemHidden, give the ItemInheritsTag a unique name.
Place the footlocker, set the ItemTag to the unique name. Et voila!
Place your footlockers and give them each unique ItemTags. Place the master loot spawner, setting the loot, etc. Place the slaves, setting bItemHidden and the ItemInheritsTag to match the ItemTags of the corresponding chests.
So that's it, you can have items randomly appearing in lockers too.