Modding Help Gathering Requirements for quests

Discussion in 'Starbound Modding' started by AmazonValkyrie, Jan 31, 2016.

  1. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    For my Viera mod, I had hoped to omit the standard flashlight altogether from their starter treasure pool. In doing so, players could not complete that quest. I tried to make a change to the gathering requirements for the Viera to require the lantern, and not the flashlight to complete the quest. This ended up causing all races to require the lantern to complete the quest. My question is, might there be a way to set up the gathering requirements to be either items? I.E. flashlight or the Viera lantern. I'm not even sure if I can make a completely custom tutorial quest template to take it's place, as this quest is triggered upon enabling the teleporter on the ship. I checked to see if I could find any example of such, even in the recipes, but I'm coming up dry and was hoping that someone else might know of a solution, or a way to set up the quest template to allow either item to complete the quest. Thanks in advance for any advice given!
     
  2. lazarus78

    lazarus78 The Waste of Time

    That quest is going to be do e away with. In fact, all but the ship upgrade quests are being done away with.

    For the time being you could just patch that quest to have no requirement at all.
     
    AmazonValkyrie likes this.
  3. Dunto

    Dunto Guest

    Looking in assets/quests/outpost/old/phase1optional/humanscientist1.questtemplate:
    Code:
      "gatherRequirements" : {
        "tags" : {
          "bug" : {
            "count" : 1,
            "consume" : true
          }
        }
      }
    It looks like you can simply require any item with a specific tag. I did a bit of testing and you can add an "itemTags" list to any item, so I added a special tag to the flashlight and the mininglantern so either one will complete the quest objective. See the attached sample mod (only works on avian since I had to patch the starter quest list and I was lazy :p).

    I can't speak to whether or not any quests will be around as I haven't heard anything one way or the other, but I don't follow the Nightly development very closely so I likely wouldn't have heard about it anyways.
     

    Attached Files:

    lazarus78 and AmazonValkyrie like this.
  4. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    Oh my gosh, thank goodness for that lol.
    Oh wow, thank you for this! I've been trying to figure this out for ages, so I really appreciate your help :) What I did notice however is that this causes the mission to auto-complete upon accepting it, before retrieving the items from the ship's hold, but it's a minor issue though! Do you mind if I adopt your code to fix the issue with my mod?
     
  5. Dunto

    Dunto Guest

    Really? I tested it with the flashlight and mininglantern and it worked as expected (you do get the quest as soon as your new character enters the world, but it shouldn't complete immediately).
    Not at all. It's nothing special, just a slightly modified version of what's already in the game assets.
     
  6. lazarus78

    lazarus78 The Waste of Time

    My way would trigger an auto complete. Misplaced reply maybe?
     
  7. AmazonValkyrie

    AmazonValkyrie Spaceman Spiff

    No, it was in response to Dunto's fix. When I checked out the Dunto's testmod, it worked as specified where the quest displays right from the start for the Avian, but when I applied the code to my custom race tutorial quest template patch file, the quest wasn't triggering for me at all for some reason. I'm not sure what might've conflicted with it, but I had already updated my lantern with the proper itemTag, so I fiddled with the Dunto's code and changed a portion of it from:

    Code:
    [
      {"op" : "remove", "path" : "/scriptConfig/gatherRequirements/items"},
      {"op" : "add", "path" : "/scriptConfig/gatherRequirements/tags",
      "value" : {
      "personallightsource": {
      "count": 1,
      "consume": false
      }
      }
      }
    ]
    
    
    to this:

    Code:
    [
        { "op" : "replace",
            "path" : "/text",
            "value" : "I should first ^green;check the ship's locker^white;. I hope I have an in-tact ^orange;light source ^white;on board to take with me. I should find ample ^orange;supplies ^white;too."
        },
        { "op" : "replace",
            "path" : "/completionText",
            "value" : "Thank goodness, this still emits light! The ^orange;torches^white; and ^orange;armaments^white; will come in handy too. ^green;Let's see what we can find on the planet below."
        },
        {"op" : "remove", "path" : "/scriptConfig/gatherRequirements/items"},
        {"op" : "add", "path" : "/scriptConfig/gatherRequirements/itemTags",
            "value" : {
                "personallightsource": {
                    "count": 1,
                    "consume": false
                }
            }
        }
    ]
    This change causes it to work for my custom race, but they don't receive the quest until the usual trigger time (once the teleporter is enabled), but it auto completes once I accept it, even though I don't have the items in my character's inventory. What matters though, is that it works, and I'm very pleased that it does ^_^ Thank you again, Dunto!
     

Share This Page