Extra Menu Page?


I’m quite out of practice with programming, so there may well be an obvious way to do exactly this that I haven’t yet put together; I appreciate your patience.

My idea is, in essence, creating a duplicate of the Skills or even Inventory section of the Menu. From there, I’d like to rework that duplicate section to serve as a way of tracking your relationship with various NPCs (rather than what the duplicate page originally kept track of)– hence my initially thinking that the Skills section might be a good starting point, since conventional relationship values mechanics tend to note ‘You’re This Close To [The Next Heart]’ or what have you!

Unfortunately, I’m stumbling on how I’d execute that first part! Would it be a matter of making a new YAML file and basically copying the code in the pre-existing [Let’s Say Skills] YAML file with substitutions of Relationships for Skills and then adding a Relationships section to the main config file to direct it? It being that easy felt naive of me, so I got into the narrat-engine and started looking at the src component .vue and config .ts files…which quickly had me realizing I was punching above my weight class and should ask for help before I start copy-pasting wily-nily and break the whole thing. C:

Thank you!

Yeah it’s definitely not that easy, but it’s possible with the plugin system. The skills/inventory sections of the menu are just pieces of UI, but they need to plug into data. The yaml files are just config files for the features, but well the engine needs to know how to use them. Creating new yaml files wouldn’t do anything, yaml is just to store settings, it’s not code.

The way most things work in narrat is that there are data stores more or less separated for each feature. Those stores keep track of data, and also can generate the save data, and reload it when you load a save. So each feature is split into its own logical area.

Then, the actual .Vue code (which is basically the UI code) mostly just displays data from those data stores, and interacts with them if needed.

So to add a relationship feature, you’d want:

  • A new UI component to display relationships (which yes would be similar to skills or something, but obviously would need different logic and layout still)
  • A data store to manage the actual data for it
  • Some new narrat commands for game scripts to interact with that new system

The plugin system can do all those things, because plugins can:

  • Add new data stores
  • Register new tabs in the menu, with their own custom UI component
  • Add new narrat commands.

The best example is the simple counter plugin example, which is a plugin that does all those things but in a very simple way. It:

  • Adds a counter-store that stores data about a counter
  • Adds a counter UI which displays the counter
  • Adds a custom command to increase the counter, so that narrat scripts can interact with it.

So it’s definitely doable, but you’d need to know how to write the code and UI for it to add the feature, which is probably more complex than what you want. It’s definitely not a matter of just copy pasting the skills system (though it would be a good source of inspiration for writing UI and data store, if you feel like trying).

Possible alternatives:

  • Just have relationships as HUD stats numbers that would be displayed by that existing system on the top of the screen
  • Manage relationships in your scripts yourself, and present them to the player in text somehow, by maybe having a button that makes them be printed out
  • have some way to see them in your game displaying it in the viewport by creating sprites and text. Relatedly, the spoon survival game I made uses sprites to display a basic sims-like mood UI, which is a similar problem. It’s a bit of work but it’s doable within the existing narrat systems without needing to add new features to the engine
1 Like

Also, a relationships feature is something that could make sense as a built-in narrat feature, since many games might want to use it…

So I might think of implementing one in the near future if I get around to it


This is all very good to know! I’m probably just gonna make everything that I would want to split out items for my jam MVP but I’ll definitely want to split things out more later.

(On a related note, is there a way to quickly change the “Skills”/“Items” designations?)