Hi,
I have run into the following problem.
I have species that may hate/like/be neutral towards each other with -3 fierce hatred, 0 = neutral and 3 = worshiped.
This is stored in a field with the species name.
So the attitude towards Duks by Draeks is stored in {{R-Draek!!R-Duks}}.
I want to list those relationships in order, starting with fierce hatred.
The problem here that a given race may or may not have fierce hatred towards another species.
So ideally I would like to skip the fierce hatred line if no such relationship is present.
I tried to solve this with a fierce hatred text that should only appear with the first[1] operator and not with the rest[1] operator.
That failed because when matching the species with an if statement, every species was in effect the first one.
Next I tried changing the hatred text to empty after the first one. This failed because after the let went out of scope the old text returned. This might work with a global variable, but I try to avoid those.
Lastly I tried using a seperate if to detect the presence, print the text and then list the species. this failed because without a list I could not detect if the -3 was present or not.
Conceptually it should be easy but it is proving hard to implement.
Any ideas how I can solve this? current code below.
<$let oldcurrentTiddler=<<currentTiddler>> Fierce="have Fierce Hatred towards " >
The <$text text={{{ [{!!title}removeprefix[R-]] }}} />
<<Fierce>>
<$list filter= "[tag[Species]]">
<% if [<oldcurrentTiddler>get{!!title}match[-3]] %>
<$text text={{{ [{!!title}removeprefix[R-]] }}}/>
<% endif %>
</$list>
</$let>