PDA

View Full Version : Advice - How to add something like a language slot



Varsuuk
February 16th, 2021, 01:03
I am on the main char tab and when a stat is altered, I do some DB updates etc to the dependent fields.

I am wondering how to approach this:
Depending on Int, the character gets X language slots (also for race) - is there a recommended way if I want to automate this to do it?

The Languages are basically CoreRPG's window_list (via MoreCore) and I know how to create an entry, but how do I trigger it?

Do I update some DB field and have that tab have a "onUpdate" handler which will do the job of inserting a new entry etc? Or is there some other comms mechanism to allow me to tell that control to add X "slots" when other stuff changes on char_main?

I put a pin in it for now. simply can manually add it - but I intend on trying to work it out eventually if no one has suggestions.


Off to (late) dinner - I'm all grumble-bellies...

Moon Wizard
February 16th, 2021, 04:34
It's up to you; but unless you're going to do some sort of character wizard to enforce character creation choices, I would just say that it is not automated. Also, people can add/remove whatever they want to the default language list on the default character sheet; so they could edit it anyways.

So my thoughts are: either you go full lock-down and only create entries to match Int; go full character creation and ignore edits; or just go non-automated.

Regards,
JPG

Varsuuk
February 16th, 2021, 08:16
Yeah, what I want to do is when rolling the char to create the entries for the "bonus languages" given to them based on int.

The question was HOW that get's down. Like, if I set Int to 15 and this gives him 5 languages, how do I programatically set/indicate this so the Notes tab can pick up the info and create the entries when it appears?

Not sure explaining self well here. Basically - if change X, how does that trigger Y new entries in Language list on ANOTHER tab in char sheet?

Trenloe
February 16th, 2021, 09:04
This is an interesting one. What happens if someone's intelligence is temporarily reduced, do they "forget" some of the languages they used to understand? What happens if someone gets an ability/magic item that allows them to understand more languages? Basically, be very careful with doing something automated like this, when people could change ability values on the fly and screw up their language list.

There are lots of things in character creation that are "do something now but don't auto update in future". I'd really avoid trying to automate something like this - you'll spend a lot of time on it and if you don't make something 100% accurate, or don't code in a way for people to manually change it, then there's not much point in doing it (IMO).

It's why I designed the chargen tracker when developing the Pathfinder Second Edition ruleset - so that the steps needed to create a character could be followed, with easy access buttons, but also to allow the various steps/abilities/feats/features being added to give textual feedback to the player as to what they need to do - in this case something along the lines of "Manually add 3 new languages. If your intelligence permanently changes at a later date, manually adjust languages as needed." You could write this information to the chat window (like 5E, 3.5E/Pathfinder 1e, etc. does), but that can result in the chat window becoming very congested if the GM is running a session 0 with everyone creating their characters at once, but this can work for messages around things like this.

Advice - only automate things that really need automating and that can calculate correctly as changes are made in future. If you're trying to automate most things you'll increase your work load massively, both now and in the future (support, maintenance, etc.), and will need to cater for the ability to correctly handle manual changes.

Varsuuk
February 16th, 2021, 19:15
I'll take that advice to hear Trenloe.

For now - will just toss the comment in Char that "Add # languages" and for races that automatically get "Elven" for example, regardless of int - I guess I will do the same.

In future, I'd be interested in looking at a "Chargen" even if this particular ruleset is not requiring it (simple) - but I like stuff like that :). - Trenloe, where might be a good example of it? Is it in the open part of PF2? are there other sample chargen if yours is in vault (I've never opened PF2 campaign)? Even if for another system (I only own built-ins, C&C, SW, DCC, D&D Core, not sure if others)

Varsuuk
February 16th, 2021, 19:17
Oh, and the above said, how WOULD you connect something like a change on one sheet affecting something displayed on another?

Seriously, this ENTIRE time, I've worked on ONE sheet plus a second one that just has "static info" - I never even thought about sharing info that is dependent on another field set in another tab. Does this method require DB onUpdate listeners as I suspect or are there other common ways?

I am definitely not doing it for Language - your comments make sense. But to know when it next comes up.

Trenloe
February 16th, 2021, 20:01
The PFRPG2 (Pathfinder Second Edition) ruleset is not in the vault - look for PFRPG2.pak in the rulesets directory.

The best way to do calculations is against database fields. You can use various DB event handlers to trigger when something changes in another part of the database, or you can trigger some central code to do calculations - most rulesets have a CharManager script that has various calculation functions - for example, calculating hit points when CON, character level, etc. change. The functions can be tied to a DB handler, or other areas that trigger with an update.