Help with Pseudo-Database of Information

I am hoping one of the geniuses on this forum can point in the right directions.

I like to play Counter-Strike, and one way to improve in the game is to use pre-designated grenades with specific lineups. I would like to make a wiki of these so I can remember them, and so they can be communicated to my friends who also play.

Each lineup would include some text discussing how to throw the grenade, with some pictures (pulled from imgur using .

I was thinking I would setup each lineup as a separate tiddler, with fields for the following:

  • Map
  • Type of Grenade (smoke, flag, frag, incendiary)
  • Difficulty of lineup
  • Location on Map

Ideally, each Tiddler would have some form of input (dropdown, text input, not sure?) to easily set these fields for each lineup. There would then be a “summary tiddler” with corresponding inputs that could be altered to filter the various tiddlers I want to display.

The idea is that if I want to play a map, I could set the four fields on the summary tiddler and the result would be transcluded (I think that is right word) so I could see all the individual lineups that could be used (if the field was not selected, then it would ignore that filter).

I’m new to TiddlyWiki, so I was hoping I could obtain some assistance with starting on this endeavor. Here are some things I think would cause issues:

  • How do I setup the filters on the summary tiddler?
  • How do I setup the inputs on the individual tiddlers such that they change the field variables?
  • How do I transclude the individual tiddlers without including the field inputs on the tiddlers?

Thank you so much in advance!

Yeah, this is a pretty basic use case.

I suggest using a viewtemplate that us applied to any tiddler tagged e.g grenade or lineup with something like the following:

title: viewtemplate/lineup
tag: $:/tags/ViewTemplate
text:
<$list filter='[is[current]tag[lineup]]'>
<$edit-text tag=input field="Map" placeholder="Map"/>

<$select field="Type of Grenade" default='smoke'>
<option>smoke</option>
...etc...
</$select>

...etc...
</$list>

A “viewtemplate” shows up in every tiddler but the listwidget with the filter ‘[is[current]tag[lineup]]’ ensures that the contents of that listwidget is only shown for tids tagged lineup

The above uses the EditTextWidget and the SelectWidget - two widgets well worth learning to use. In the former, the tag=input attribute makes the displayed “mini editor” be only one line high. You can use tag=textarea for multiline, see docs.

As for the summary:

title: Summary
text:
<$list filter='[all[tiddlers]tag[lineup]]'>
<h2><$link/></h2>
...basically same stuff as in the viewtemplate...
</$list>

(I didn’t test any of the above but it should give the idea.)

Not sure what you mean with “play a map” (I’m no gamer) but it doesn’t matter where you set the field values as they are transcluded both to show up (via the viewtemplate) in the tiddler (in which they are also stored), and also transcluded into the summary.

I’m probably missing some bits in your requests but hopefully this is a start. Feel welcome to ask more.

Thank you very much for the information!

I really like the use case / idea that you are looking for here. I’d like to break it down and simplify it a little more if I may.

1 - you want to create a set of tiddlers with specific fields - A, B, C, and D and then have individual instructions in the text field.

2 - you want a tiddler with some method such as dropdowns which would let you enter a choice in each field, and based on the combination you entered give you a list of the tiddlers that have that combination of fields.

Step one is pretty straight forward - you’re just creating tiddlers. The biggest challenge is making sure to maintain the integrity of the information entered - spelling being the usual mistake. Also, if I remember correctly, having spaces in the field could complicate matters.

Step 2 is the challenge.

The first thing I would do is just familiarize yourself with how to create lists using the list widget - what most would say is the core function of TiddlyWiki. Basically you are just figuring out how to use the list widget to make a list of the tidders with specific fields using the field filter operator.

Then you can move on to creating what is basically a simple UI with dropdowns like Mat was showing that then feeds those choices into a list widget using variables instead of directly typing the field names into the list widget.

Though these are pretty basic manuevers in TW I’m at the end of a 12 hour shift and its 0645 am here, so this is about as far as my brain can go. And being basic you have chosen a fantastic starting project. I did something similar with Dwarf Fortress and learned a lot!

These concepts are covered exhaustively in GrokTW. I can’ t recommend it enough.

Additionally you should check out Transclusion with Templates for the display of your information tiddler created in step 1. Keep in mind that the fields will not be displayed in the default view of the tiddler so you will use a template to display them if you want. This is also a nice intro to the concept of transclusion.

And check out the view widget. You will use this to control the output of the list in step 2 if you want more than just the title.

Again, Grok Tiddlywiki will really take you through these concepts. Try to write a bit of basic code with the list widget and then use that to ask specific questions. You’ll find that the vast majority of the questions here pertain to creating and manipulating lists.

Have fun!