Hi,
I have some trouble finding the right way to set a field value based on the select chosen.
<$select tiddler='$:/wim/CampaignNow'>
actions='<$action-setfield $field="StartingIP" $tiddler="NewCharacter" $value={{{ [{!!IP Cost}] }}} />'
<$list filter='[tag[Campaign]]'>
<option><$view field='title'/></option>
</$list>
</$select>
<$tiddler tiddler={{$:/wim/CampaignNow}}>
{{!!IP Cost}}
</$tiddler>
note: the {{{ [{!!IP Cost}] }}} part is where i’m stuck.
after the select is a way to display the value.
That value needs to go to to {{NewCharacter!!StartingIP}}
The problem is that it comes from one of 5 other tiddlers, which is chosen by the $select.
Below the select is how I can find it outside of the select, the problem is finding that within the select, as the currentTiddler will probably not work in the actions action-setfield…
Maybe I am using too much indirection?
This does work:
<$button actions=<<set-campaign 0>>>
Vagabond
</$button> <$button actions=<<set-campaign 27>>>
Adventurer
</$button> <$button actions=<<set-campaign 54>>>
Heroic
</$button> <$button actions=<<set-campaign 81>>>
Epic
</$button> <$button actions=<<set-campaign 108>>>
Legendary
</$button> {{NewCharacter!!StartingIP}}
with
\define set-campaign(val)
<$action-setfield $tiddler="NewCharacter" $field="StartingIP" $value="$val$" />
\end
But it requires 5 buttons. Other selections may involve 18 or 55 or 100+ choices, so that is not really workable.
on https://aesirius-rpg.tiddlyhost.com/ the wiki can be found, with the tiddler in question Campaign Selection