player.config, The problem with

Discussion in 'Starbound Modding' started by Xuhybrid, Dec 8, 2013.

  1. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Having made a couple of mods of my own now, its easy to see the problem with player.config. We cannot necessarily distribute a copy of this file because it will be out of date at some point and other mods may be installed. Every other part of this game is modular, in that you can add a new file and the game scans and adds everything on startup. This is clever design, and something ive used in MVC frameworks for PHP for several years now as my job.

    In order for us to distribute new items to our mod users, we need a way to add new recipes to at least the 'defaultBlueprints'. It would also be incredibly useful if we could add a new 'tier4' or 'techupgrade40' for our own blueprint lists. I was initially doing this for my Tech Bypass to unlock all techs, but it is a bit odd when you have your mod user copying and pasting that list into their player.config file themself. I changed it to be a 'learnBlueprintsOnPickup' style of learning the tech so i only had to add one line to player.config.

    Im sure i could elaborate on particular systems you can put in place, but i have confidence that i won't need to.
     
  2. Platoonsgt1

    Platoonsgt1 Big Damn Hero

    Yeah, I see what you're talking about.
    It would be great if the upgrade tiers were moved to separate files so that each file would contain only 1 tier, although this may interact strangely with the race-specific tiers, or any new tiers which are designed to be race-specific.

    Then again, this would still require modification of existing files to add new recipes to existing tiers, it would almost be better to have the tiers named in one file, and the items themselves adding themselves to the tiers. Unfortunately, this solution would instead have the problem that the tier names themselves would be difficult to modify, as they would all be contained in a single file.

    There's no easy solution, the only all round solution I could think of, is that items would have a tier name in their recipe file, and if a tier is unlocked, all recipes are searched for that name, unlocking those recipes. The tiers wouldn't be mentioned in the content files outside of the items which make up the tiers, and unlock them. This poses it's own problems though, where tiers become difficult to manage, as their contents would be strewn throughout the content files.
     
    SquarelyCircle likes this.
  3. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    That's a good idea, although it does add a lot of bulk to each of these files. Actually thats probably a non-issue so never mind. Take recipes for example, they have a property that determines whether its in a 'craftingtable' or a 'roboticcraftingtable' and so on. This kind of system would allow us to add new files and even new tiers dynamically. It would basically be a category or group that you could refer to in the .celestial file types.

    Code:
    {
      "sectorUnlock" : "beta",
      "tierRecipesUnlock" : "tier2",
      "unlockMessage" : "Starmap Updated. New data has been uploaded to your ships navigation systems. Select the beta sector from the top of the navigator when in galaxy view to advance."
    }
    
     
    SquarelyCircle likes this.
  4. cavelurker

    cavelurker Space Spelunker

    I second this idea, adding new mods would be a lot easier for players if they didn't have to edit any lines in files by hand.
     
    SquarelyCircle likes this.
  5. Whitey

    Whitey Poptop Tamer

    My understanding is that when you're modding, you can add the mod in another folder rather than editing the vanilla files anyway (best practice). I believe you can add the player.config in here too when you load this folder with assets, right?
     
  6. aMannus

    aMannus Space Kumquat

    I wasted the last 4 hours trying to do the exact same. I saw the tech upgrades say it unlocked the "tier2" thing, and decided to make my own tech upgrade unlocking my own recipes, basically only adding one line to the player.config. Turns out, those tiers are defined in the player.config, right here:

    "level31" : [
    { "item" : "durasteelbar" },
    { "item" : "tier4chair" },
    { "item" : "tier4door" },
    { "item" : "tier4light" },
    { "item" : "tier4switch" },
    { "item" : "tier4bed" },
    { "item" : "techupgrade32" }
    ],

    So basically, using a tech upgrade only scatters the one line needed to unlock the custom tech upgrade and the lines where you're making your own 'tier unlock' further down in the player.config.

    Me and some others had this discussion as well in the Mod Overview thread thingy, and someone said you can have a seperate file for a furnace recipe. This allows you to make a custom item with a furnace recipe (like 1 dirt for your item) that teaches the player all the neccesary recipes through "learn blueprint on pickup". Still, this is such a cheesy method of circumventing this and I wholeheartidly agree this should be done better.

    A specific player.config for every mod will fix this, as we could actually create our own 'tier unlocks' in those files, and add the 'learn this blueprint immediately' recipes as well. Effectively giving modders full control about wether blueprints should be available immediately or after acquiring/picking up/using a certain item.


    Also, I'm currently testing if having a player.config file in your own mod folder actually does load both files. If this is the case, we can already realise the above by simply placing the player.config in our own mod folders. This'll require a good bit of time for testing before I can say this for sure though.
     
    Voidnaut likes this.
  7. EvilEngineer

    EvilEngineer Starship Captain

    While I was looking through a number of files to build my mod I did come across a line for learning a recipe upon pickup of an item. EX:
    Code:
    {
      "itemName" : "bone",
      "rarity" : "Common",
      "inventoryIcon" : "bone.png",
      "description" : "It's a bone.",
      "shortdescription" : "Bone",
      "learnBlueprintsOnPickup" : [
        "bonematerial"
      ]
    }
     
  8. aMannus

    aMannus Space Kumquat

    That in itself doesn't eliminate editing ANY of the core files. All it allows it making a custom furnace recipe, making a custom item with that and binding the pickup recipes with that item. Still doesn't feel right at all for me.
     
  9. Herdo

    Herdo Pangalactic Porcupine


    You do not need to distribute your player.config file, there is a much easier way.

    http://community.playstarbound.com/...roper-way-to-install-mods.41929/#post-1425317

    This entire function is in place so that you don't have to alter the player.config file.
     
  10. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

  11. NightmareX91

    NightmareX91 Phantasmal Quasar

  12. aMannus

    aMannus Space Kumquat

    Which is pretty much 99% of the mods.
     
  13. Herdo

    Herdo Pangalactic Porcupine

    You need to modify the player.config file, but that doesn't mean you need to have the mod downloaded modify their player.config file.

    I assumed the complaint here was having to tell people "now go into player.config and add these lines".

    You don't need to do that with this method.
     
  14. SethKipz

    SethKipz Aquatic Astronaut

    If you want to have more than one mod that adds new recipes you do.
     
  15. Matterialize

    Matterialize Scruffy Nerf-Herder

    I bet someone clever enough could write a program that looks for player.config files in all specified directories (assets and preferably "mods", I really hope the community adopts that), compares the contents of each one to the vanilla player.config, and then recompiles it to include any extra lines added by other mods. Maybe a similar patcher for bootstrap.config. Basically, a program that can activate and deactive mods with a single click. Although, I don't know a thing about coding and I have no idea how difficult this would be to do.

    Also, I'm pretty sure this same issue affects treasure pools as well.
     
  16. Xuhybrid

    Xuhybrid Scruffy Nerf-Herder

    Yeah im keeping my eye out for the a modloader that does that. There are a couple in the works.
     
  17. Vagrant0

    Vagrant0 Void-Bound Voyager

    From what i can tell, there are a few ways to address this issue. First is having a dedicated folder to overrides as explained here:
    http://community.playstarbound.com/index.php?threads/the-proper-way-to-install-mods.41929/
    While this means that only one altered version of player.config can exist, aside from recipes, there aren't many reasons why you'd need to make changes to this file that aren't very easy to do manually (races).

    For the sake of recipes, there may be other options, such as making the blueprint be learned after acquiring a base material for that item like:
    There may be other ways to force learning of a blueprint, such as attaching it to a quest, item usage, or other event. There is more than 1 way to add in new stuff, all you need is some sort of hook.
     
  18. Toast_Storm

    Toast_Storm Space Penguin Leader

    The most recent idea that I had regarding this is: quests, if a simple quest could be implemented with the reward being an item from the mod, that would then unlock all required crafting recipes, you wouldn't have to alter the config or craft something with a furnace or fireplace. Currently seeing how viable this is.
     
  19. Matterialize

    Matterialize Scruffy Nerf-Herder

    The tricky thing is that all of those methods still require you to edit one of the vanilla assets and overwrite the original one with your own version, which may end up clashing with other mods that edit the same file.

    If only we could change something to allow recipe discovery conditions to be added to the recipe file itself, rather than just in player.config. Let us specify in that file that this is a recipe unlocked for all races at the start, or for humans at the crafting bench in Tier 2, or whatever.
     
  20. Vagrant0

    Vagrant0 Void-Bound Voyager

    That is always the trick, finding an open hook which already exists in the game.

    At current, the most open answer would be to have something that works like a furnace or refinery which can take in an item and convert it to another item based on recipe, but without requiring the player to have learned the blueprint. It's more involving, but can potentially work for those cases when you need to add recipes from a larger group of items.

    But yes, it is a challenge. Hopefully there will be more options in the future. I'm still digging through the game files though, so something may come up.
     

Share This Page