Modding Help Item Prerequisites?

Discussion in 'Starbound Modding' started by FryoKnight, Jul 6, 2017.

  1. FryoKnight

    FryoKnight Scruffy Nerf-Herder

    Hello there, I as wondering if there is a way to make it that certain items are not available in the shop unless you had picked up a certain item before hand?
    I was thinking about making a mod where you could buy a farmable source for certain resources, but only shows up after you picked up the original item. Aka, Farmable Geode only after picking up a Geode beforehand.

    Does anyone know how to do such a thing, if possible?
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    You have 2 options.
    Easy Option

    Make the shop a crafting table - and just use the recipe unlock system

    Hard Option.

    Use Universe flags to set state - after each unlock. Having the shop check the flag to determine which contents to add.
    This does require some decent knowledge of lua.
     
    Cyel and bk3k like this.
  3. bk3k

    bk3k Oxygen Tank

    Probably this needs some elaboration.
    I assume you mean(for example)
    Code:
      "items" : [
        { "item" : { "name" : "erchiuseye" }, "prerequisiteQuest" : "human_mission1" },
        { "item" : { "name" : "ixodoomclaw" }, "prerequisiteQuest" : "floran_mission2" },
        { "item" : { "name" : "kluexstaff" }, "prerequisiteQuest" : "avian_mission2" },
        { "item" : { "name" : "dragonhead" }, "prerequisiteQuest" : "glitch_mission2" },
        { "item" : { "name" : "soluskatana" }, "prerequisiteQuest" : "hylotl_mission2" },
        { "item" : { "name" : "miniknoglauncher" }, "prerequisiteQuest" : "apex_mission2" }
      ]
    
    But possibly you mean adding
    Code:
    "learnBlueprintsOnPickup" : [  "something2" ]
    
    to "something1"

    I recently made a script to make the whole vending thing a little nicer, and I suppose I could bake in support for universe flags as conditions too. But that would only be helpful in selecting what inventory is appropriate, not in setting the flag. And I'm not sure this is the best option (my opinion) because one character setting the universe flag sets it for all the characters. So new characters could get stuff they shouldn't have just because a more advanced character unlocked it.

    I think quest locking is the best way. You could do something like clone "museumcurator1" or similar fetch quests, substitute finding a geode(or whatever). That sort of thing.
     
    Cyel and The | Suit like this.
  4. FryoKnight

    FryoKnight Scruffy Nerf-Herder

    Well, that sounds decent and all, but I really don't want to -add- a new shop, but just add content to the existing shops. I did already know about the "prerequisiteQuest" tag, but I was hoping that there was something like that for Items that wasn't "requiredItems" (which mean you have to have the item on person for it to show).

    And thank you bk3k for the example/explanation.


    As for the difficulty, I am a quick learner. I just need to see an example of what you are talking about.
    And lua is not too hard for me, as I already learned a good portion of it from back when I played Minecraft with the mod Computercraft (which uses lua for it ingame coding).


    I could set it up where it is tied to certain quests, though I honestly want to avoid that if at all possible. I haven't quite figured out how to make custom quests yet, and I want to avoid adding new structures/NPC if possible to make it alittle more Multiplayer friendly.
     
    Last edited: Jul 7, 2017
  5. The | Suit

    The | Suit Agent S. Forum Moderator

    Not really sure how advanced or Simple Minecraft is. So I can't comment on it.
    Though you will need to know Lua language in a proficient enough manner.

    You can see the outpost of basic checks that need to be done for Universe flags.
    That is how the shops appear in the game.

    Look for quests tied to shops - and the quest script in how to setup the flag.
    Then the furniture shop script to see how it checks for the flag.

    Finally how to populate a store with Lua - the furniture shop or bk3k script.
     

Share This Page