0 users browsing Suggestion Box. | 1 guest  
Main » Suggestion Box » Loot Tables » New reply
Alert
You are about to bump an old thread. This is usually a very bad idea. Please think about what you are about to do before you press the Post button.
New reply
Post help

Presentation

[b]…[/b] — bold type
[i]…[/i] — italic
[u]…[/u] — underlined
[s]…[/s] — strikethrough
[code]…[/code] — code block
[spoiler]…[/spoiler] — spoiler block
[spoiler=…]…[/spoiler]
[source]…[/source] — colorcoded block, assuming C#
[source=…]…[/source] — colorcoded block, specific language[which?]

Links

[img]http://…[/img] — insert image
[url]http://…[/url]
[url=http://…]…[/url]
>>… — link to post by ID
[user=##] — link to user's profile by ID

Quotations

[quote]…[/quote] — untitled quote
[quote=…]…[/quote] — "Posted by …"
[quote="…" id="…"]…[/quote] — ""Post by …" with link by post ID

Embeds


Most plain HTML also allowed.
Thread review
Kawa All it really needs now is a way to set colors on items that support them.
PillowShout Much shorter and much cleaner. I'm definitely liking how this is coming together. ;)
Kawa GetLoot split up, Character.ApplyCostume redone to use the results. Much shorter now. Short is good.
Kawa I was thinking of taking the <code>type="baker"</code> part and replacing that with a <code><filter></code> element. That way, we can query for all <i>NPC Clothing</i> -- GetLoots'll then return a baker's costume <i>and</i> any other clothing sets, which can then be distributed.

If we sort the more specific stuff such as a baker's costume at the top of the file and the less specific stuff such as typical mens clothing further down, like with the scene data, GetLoot's returned list will have the costume as [0], for trivial distribution.
PillowShout Yeah, that sounds like it should work just fine. I had always intended that multliple loot sets could be combined and given to an entity, so this looks like the start of a good system for that. I guess we just need a standard way to differentiate the different types of sets so that they end up in the right places.
Kawa Considering the following: split up GetLoot into GetRandomLoot and GetLoots. One returns all lootsets that match the type, target, and filters, and the other picks one at random.

Then, to create a villager and their personal containers, call GetLoots. Pick one out from the results and give that to the NPC, then put some of the rest in their wardrobe and such.

Also, keep separate lootsets for clothing, tools, and weapons. If a villager has a wardrobe, get multiple clothing sets as above. If not, get only one. Same deal with chests and weapon racks or whatnot. That way, for a house with two inhabitants, two beds, two wardrobes, and one chest, there'd be two clothing lootsets worn, N clothing sets stored in their respective wardrobes, two tool sets carried, and N tool and other item sets in the chest.

Sound good?
PillowShout Looks nice! Definitely going to have some fun playing around with this. :awsum:
Kawa This is now a thing.

Calling WorldGen.GetLoot(string target, string type) returns a list of tokens that can be directly added to a container or a character's inventory, like the now obsoleted InventoryItem.RollContainer(Character owner, string type) does, using the following data:
<pre>
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE loot [
<!ELEMENT loot (lootset+)>
<!ELEMENT lootset (filter|oneof|someof)+>
<!ELEMENT filter EMPTY>
<!ELEMENT oneof (#PCDATA)>
<!ELEMENT someof (#PCDATA)>
<!ATTLIST lootset
target CDATA #REQUIRED
type CDATA #REQUIRED
>
<!ATTLIST filter
key CDATA #REQUIRED
value CDATA #REQUIRED
>
<!ATTLIST someof
min CDATA #REQUIRED
max CDATA #REQUIRED
>
]>
<!--
for sets:
* "directitem" -> item with that ID
* "@token" -> any random item with that token
* "@tokenA+tokenB" -> any random item with those tokens
* "@tokenA-tokenB" -> any random item with tokenA but NOT tokenB
* "@tokenA+tokenB-tokenC" -> any random item with tokenA and B but not C
* "@-token" -> any random item AT ALL that does not have that token
separate with "," result is trimmed.
-->
<loot>
<lootset target="container" type="dungeon_chest">
<!-- Contains: ONE small weapon, large weapon, or rare weapon, TWO to FIVE food items, and ONE to THREE potions, all random. -->
<oneof>@smallweapon, @largeweapon, @rareweapon</oneof>
<someof min="2" max="5">@food</someof>
<someof min="1" max="3">@potion</someof>
</lootset>
<lootset target="vendor" type="baker">
<someof min="10" max="10">@baked</someof>
</lootset>
<lootset target="vendor" type="greengrocer">
<someof min="10" max="10">@fruit</someof>
</lootset>
<lootset target="npc" type="arms">
<filter key="board" value="wild" />
<filter key="culture" value="seradevar" />
<!-- either a small or large blade. -->
<oneof>@smallweapon+blade, @largeweapon+blade</oneof>
</lootset>
</loot>
</pre>
Many but not all items have been marked to allow this.
Kawa Saving this page for later study.
PillowShout So I had an idea. What if rather than using hardcoded loot sets to fill things like chests and arm wild NPCs, we used a loot table to populate their inventories? I know this is already done to some extent with the costumes, so I'm sure it's something you've at least considered, but I wanted to come up with a system that we could use to cover all items and objects in the game rather than just clothing on characters.


Here's a small mock-up of what I was thinking:

<lootset target="container" type="chest">
   <oneof> whip, knife, dagger </oneof>
   <someof min="2" max="5"> bagel, apple, bread_loaf, bacon, sweetroll, croissant </someof>
   <allof> water_flask, water_flask </allof>
</lootset>

Alternatively this could also be done with tokenization like the costumes are, so I guess it's just a matter of preference or ease.

Another advantage of using a system that's a little more generic is that we could create separate loot sets for wild and town based NPCs that are indifferent to body type.


<lootset target="NPC" type="town">
   <oneof> club, pitchfork, shovel </oneof>
</lootset>

<lootset target="NPC" type="wild">
   <oneof> dagger, short_sword, whip </oneof>
</lootset>


One last way that loot tables can really add some interesting diversity is through the use of filters. For instance, you could filter based on the possession of certain flag tokens, or just by gender, race or culture. Alternatively, you could also filter by region:


<lootset target="container" type="wardrobe">
   <filter type="location" name="biome" value="Tundra" />
   <someof min="1" max="3"> parka, wool_scarf, wool_mittens </someof>
</lootset>

<lootset target="container" type="wardrobe">
   <filter type="location" name="biome" value="Desert" />
   <someof min="1" max="3"> silk_scarf, cotton_blouse, sandals </someof>
</lootset>

Anyway, these are just some ideas. I'm sure you could come up with some better syntax, but I wanted to give you some idea of what we could do with a system like this. Let me know what you think!
Main » Suggestion Box » Loot Tables » New reply