I've been using
this really good combat system for an rpg that I'm working on. In the log passage here, once you click on a different action, the previous text disappears and is replaced.
Is there a way to modify this system to retain all the text from all the actions the player uses? (New text resulting from previous actions simply get appended to the log)
This system uses Harlowe, but I was hoping to see if the modification I want is possible in Sugarcube (already converted the current system to Sugarcube on my end).
Thank you!
Comments
a. You didn't supply an example of your converted version of that Harlowe based code, so I am going to assume that your version looks and works the same as mine does.
b. You don't state which version of SugarCube you are using, so I will assume it is the one that comes with Twine 2.x
You can use an array to accumulated each action generated by the existing code in the Log passage and then display the contents of that array as the log text.
1. Initialise the $actions array in the Ready passage, you should add something like the following just before the <<goto>> macro.
2. Add the current action to the $actions array the display its contents.
The following code replaces the current contents of the Log passage, you should also add a nobr passage tag to the passage.
And this works like a charm, thank you very much!