Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple default campaign property types #221

Closed
Azhrei opened this issue Dec 27, 2018 · 13 comments
Closed

Add multiple default campaign property types #221

Azhrei opened this issue Dec 27, 2018 · 13 comments
Assignees
Labels
feature Adding functionality that adds value tested This issue has been QA tested by someone other than the developer.

Comments

@Azhrei
Copy link
Member

Azhrei commented Dec 27, 2018

Currently, MT starts with only a single set of campaign properties. Maybe there should be multiple that are predefined that map to the most common game systems. One for D&D 3.x, one for PF1E (includes CMB/CMD), one for GURPS, and so on. It would give new users a better starting point to add on their ow stuff.

@Azhrei Azhrei added feature Adding functionality that adds value up for grabs Minimal context and are well-suited for new contributors labels Dec 27, 2018
@emmebi
Copy link
Collaborator

emmebi commented Jan 19, 2020

Is there already a set of properties which can be copied/included?

@Phergus
Copy link
Contributor

Phergus commented Jan 19, 2020

There is. When MT starts up there are default token properties plus vision, light, states and a bar. I have never looked to see how those are created at startup. Maybe they are actually loaded from an xml file.

@emmebi
Copy link
Collaborator

emmebi commented Jan 20, 2020

After some digging (but no experimentation so far), I understand where this comes from. The following is an excerpt from initialize method in CampaignProperties.java

  private void initTokenTypeMap() {
    if (tokenTypeMap != null) {
      return;
    }
    tokenTypeMap = new HashMap<String, List<TokenProperty>>();

    List<TokenProperty> list = new ArrayList<TokenProperty>();
    list.add(new TokenProperty("Strength", "Str"));
    list.add(new TokenProperty("Dexterity", "Dex"));
   ...

The other default seems to be initialized in the same way. Suggested course of action:

  • we extract this stuff into a set of (xml ? ) files;
  • we modify the code to read the info from those files;
  • we provide alternative set of files for various game systems.

For the last point, I would need someone who can provide a set of properties for other gaming systems, if anyone already did that.

Anyway, I can work on this during the week, feel free to assign it to me (unless someone else is already working on it, of course)

@Phergus Phergus removed the up for grabs Minimal context and are well-suited for new contributors label Jan 20, 2020
@JamzTheMan
Copy link
Member

Let the arguing begin lol
Especially where it's popular now to use json inside a property to cover several "properties".

I guess the best we can do is pick "one" for a default.

Also, isn't there already a import/export for properties? I guess they is for well property toes though right?

@Phergus
Copy link
Contributor

Phergus commented Jan 20, 2020

I think that is pretty much what needs to be done. A decision about where the files will be stored is needed. The ones supplied with MapTool can be kept in the jar perhaps but if users want to add or modify their own it might be good to have them with the other resources under .maptool-rptools.

XML is probably the way to go for now as there is already code to import/export campaign properties.

@Phergus
Copy link
Contributor

Phergus commented Jan 20, 2020

@JamzTheMan My thought would be to focus on "basic" property definitions so that folks new to MapTool aren't immediately faced with arcane macro code just to input the property values. Perhaps each one could have a Game - Basic and a Game - Advanced assuming there is someone wanting to do the advanced.

@emmebi
Copy link
Collaborator

emmebi commented Jan 20, 2020

To be fair, I am mixing two different features here:

  • having more than one set of properties: this just means creating more sets initTokenTypeMap()
  • making the set of properties customizable/exportable: this implies storing them on the file system in some way.

I will make a first attempt at just adding more set of properties, and then I will see how I can work on the other.

@Phergus
Copy link
Contributor

Phergus commented Jan 20, 2020

Not sure I'm following you. Users can already have multiple sets of token properties. The goal here is to have predefined sets for other rule systems. My take is that they would be loadable and would not always been there in the Token Type list. That list reflects what is saved as part of the campaign file. In other words, they are the property types for tokens in the currently loaded campaign. A new list, that displays available Campaign Properties sets that can be imported would be nice.

Another thing. Right now you can't get rid of the Basic props. You can redefine them but the default property set for tokens is always Basic. So anyone playing a different system has to redefine Basic or else every token that is added has to have the correct property set given to it.

At the bottom of the Campaign Properties dialog are buttons to import and export the properties as an .mtprops file. So a method of saving and loaded is already in place. Note this isn't about just the Token properties but also sight, lights, states and bars.

@cwisniew
Copy link
Member

Thinking of (eventually) moving to a grander plan...

Do we want people to say "hey I am playing DnD5e, or hey I am playing Paranoia, or ..." select that and it comes up with a set of starter properties, states, light sources, campaign preferences for grid type, movement metric etc. It could even have some very basic "starter macros", eventually character sheets...

Not saying this issue has to address all of the above but we should at least do it in a way where it can be extended to do the above rather than thinking of it as "just export/import properties", as Jamz says we already have that.

The question then is are we expecting these to -- at least initially -- be hand created/edited files? If so I think storing then as JSON is a better bet than XML (or json with a bunch of .mts for macros or something similar).

The idea being you don't have to use these, but if you are new to MapTool then its at least is less you have to figure out.

@Phergus
Copy link
Contributor

Phergus commented Jan 21, 2020

As part of a move to a grander plan, then all of that. For right now, most of it but using mostly existing functionality.

What we have now wrapped up as Campaign Properties: Token Properties (one or more Types), Sight definitions, Light definitions, States (with any associated images), Bars (same) and Repositories.

If you save a Campaign, everything in the Campaign Properties dialog plus macros, maps, tokens and tables goes into the campaign file. If you export Campaign Properties then you just get what's defined in the Campaign Property dialog. This, to me, is the minimum level of support for a game system. What is needed are predefined Campaign Property files for those systems and a change to the Campaign Properties dialog that presents a list of available predefined ones plus the ability to choose a user created one. Currently this capability is already there with the Import/Export buttons but needs to be improved to be more obvious to the user. It's obviously bad when a developer isn't sure that the Import/Export buttons are for everything defined in the dialog.

As mentioned previously, any predefined Campaign Properties should just be there in a list to be selected. Once selected the user should be presented the option to bring in everything as defined or perhaps the user only wants the Token Properties and Sight definitions.

While it would certainly be nice if the Campaign Properties could be hand created/edited - and then I would certainly prefer JSON - I think that we already have the UI in place for editing/adding these properties and that will minimize the effort and risks of bad definitions. Remember that Campaign Properties includes States and Bars which usually require image assets. Hand editing and then bundling is going to be prone to errors.

@Azhrei
Copy link
Member Author

Azhrei commented Jan 22, 2020

As mentioned previously, any predefined Campaign Properties should just be there in a list to be selected. Once selected the user should be presented the option to bring in everything as defined or perhaps the user only wants the Token Properties and Sight definitions.

There's code in the repo now that starts on this. I had a plan to implement the ability to load/save anything stored within MapTool using a single UI. It presents a JTree with top-level components (like Campaign, Tokens, and Maps), and then each top-level element has subelements.

I don't remember how far I got with it.😐 My plan was to implement a checkbox for every item in the tree so that entire branches could be easily selected. Then the user would click Export to see everything selected dumped to a single file. On import, the tree would display only what was in the file, with any empty branches of the tree greyed out.

emmebi added a commit to emmebi/maptool that referenced this issue Jan 26, 2020
emmebi added a commit to emmebi/maptool that referenced this issue Feb 1, 2020
- the new files are copied in the .maptools-{vendor}/campaignsProps dir during installation
- the property files are shown without the extension

Refers to RPTools#221
emmebi added a commit to emmebi/maptool that referenced this issue Feb 1, 2020
@Phergus Phergus added the documentation needed Missing, out-of-date or bad documentation label Feb 1, 2020
@Phergus
Copy link
Contributor

Phergus commented Feb 6, 2020

Code from #1213 provides for the ability to select and import one or more predefined
Screenshot 2020-02-06 10 58 38

The list is created from the list of files in: C:\Users\username\.maptool-rptools\campaignProps.

This directory is populated initially by those found in the repo under:
maptool\src\main\resources\net\rptools\maptool\model\campaignProps

@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Mar 3, 2020
@Phergus
Copy link
Contributor

Phergus commented Mar 3, 2020

The functionality is in place and working. Folks with knowledge of the listed system will need to update those placeholder campaign properties.

Note this is currently undocumented.

Any further work can be done on separate tickets.

@Phergus Phergus closed this as completed Mar 3, 2020
@Phergus Phergus removed the documentation needed Missing, out-of-date or bad documentation label Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding functionality that adds value tested This issue has been QA tested by someone other than the developer.
Projects
None yet
Development

No branches or pull requests

5 participants