Thanks for the fast answers !
Some builders use the packages zdialog or zzdialog to parameterize conversations, but I don’t know whether they help to identify the action taken.
These packages seems interesting, i’ll take a look into it !
My simplest solution is to have generic action taken scripts plot1, plot2… which set a local int on the PC before calling another script with the switch logic. The latter can contain different sections based on the NPC tag, so if n is the largest number of action taken branches in any conversation, the module only requires (n + 1) scripts.
This is what I am doing at the moment, but since I have a lot of branches, I still have a lot of scripts. I was hoping there was a solution to bring this n + 1 count to just 1 for the whole conversation. If there is not, I’ll have to reduce my number of branches dramatically.
Another solution is to take advantage of the fact that the journal updates before the Action Taken script runs. If you have a dummy journal with a null name and many entries, setting a different journal entry on each Action Taken branch allows you to use the same script on each branch. The script needs read the journal entry, delete it, then switch on that value. One journal suffices for the entire module. The only downside is a spurious log message saying that the journal has updated, when it hasn’t - but players quickly learn to ignore that.
I don’t think i understand and it feels like a hack, so i don’t think i’m desperate enough to follow that path yet
You can also make a dozen of generic action scripts, i.e.
action_script_20 and have each of them check for a corresponding string variable set on the creature which somehow describes what to do / what to check (you’ll need to write a small parser). Or those scripts could even reference a part of the same variable (i.e.
| -delimited). They can also alter the variable(s) for a dynamic system, probably most useful for modules with larger number of smaller conversations.
I have only 1 PC interacting with 1 placeable object through a conversation. The placeable object allow the PC to add / remove item properties to a chosen item.
The branches look like this :
But since there are a lot of types / subtypes with each a lot a values, this can lead to a gigantic amount of branches.
One solution to reduce the number of branches is by reducing the choices to adding +1 and removing -1, but that prevent the user from passing from a +4 to a +20 directly (and vice versas).
To avoid having 171 scripts, you can break the conversation into sub-conversation (assuming players won’t be jumping between their internal nodes).
I don’t think i can do that, since the PC can go back and forth between all the nodes.