Modding Help Spawn a procedurally generated item

Discussion in 'Starbound Modding' started by kik4444, Dec 12, 2013.

  1. kik4444

    kik4444 Existential Complex

    How exactly do you spawn a procedurally generated item? For example I want to spawn a generated legendary assault rifle, but simply writing "lelgendaryassaultrifle" gives you a generic item. so what exactly do you write to make it spawn? Note: this is for using them with smelting copper ore for example. It's a bit different from making them spawn from the tutorial.
     
  2. NightmareX91

    NightmareX91 Phantasmal Quasar

    That's a pretty good question. I do believe the "output" works just like the reward system does, except it's structured better. Try something like:
    Code:
    "output" : {
        "item" : "generatedgun",
        "count" : 1,
        "definition" : "legendaryassaultrifle"
      },
    
    This is purely from the top of my head, so it might not work. I'd imagine it would be something similar to this, anyway.
     
  3. kik4444

    kik4444 Existential Complex

    Nope, that gives you a generic item
     
  4. ejh1990

    ejh1990 Phantasmal Quasar

    It was close. Try:

    Code:
    [ "generatedgun", 1, { "definition" : "legendaryrocketlauncher" } ]
    ... as an item. :)

    Replacing the generatedgun with the parent weapon, and legendaryrocketlauncher with the sub-type weapon.

    I've not tried it in the context of an output, but I tried setting it for the starter locker and it worked properly. One random rocket launcher, no generic item.
     
  5. kik4444

    kik4444 Existential Complex

    I actually tried something similar to that a bit earlier. Writing it like that just makes it refuse to smelt the ore.
    EDIT: After abandoning the tutorial quests, is there a way to reset them without doing anything to your character or ship?
     
  6. ejh1990

    ejh1990 Phantasmal Quasar

    There is another format that's different again (from the recipes list in player.config -- worth a shot).

    Code:
    "item" : "generatedshield", "count" : 1, "data" : { "definition" : "startershield", "level" : 1 }
    As for the mission thing, not as far I know. Although this might be worth keeping an eye on if you haven't seen it already:

    http://community.playstarbound.com/...eb-based-save-file-editor.46344/#post-1481462
     
    NerArth and Chieron like this.
  7. NightmareX91

    NightmareX91 Phantasmal Quasar

    Go in your universe folder and delete playerQuests.db
     
  8. kik4444

    kik4444 Existential Complex

    Ok, I tried making the tutorial method like this -

    {
    "id" : "apextutorial.gearup",
    "title" : "^#9be3d6;On The Run.",
    "text" : "The Miniknog has crushed the Apex rebellion. You have escaped with your life intact by hijacking a Miniknog ship. The ship has run out of fuel in orbit of an unknown planet. Before setting out in search of fuel, ^green;search your ship's storage for a ^pink;matter manipulator^white;. Press ^green;E ^white;to interact with objects.",
    "completionText" : "Well done! The matter manipulator allows you to manipulate almost anything in the gameworld.",
    "conditions" : [
    { "kind" : "gather", "item" : [ "beamaxe", 1] }
    ],
    "moneyRange" : [10, 10],
    "rewards" : [
    [ [ "beamaxe", 1],
    [ "generatedgun", 1, { "definition" : "legendaryrocketlauncher" } ] ]
    ],
    "planetMode" : "none",
    "questDungeons" : [ ],
    "followUp" : "tutorial2.gearup"
    }


    but that still gives me a generic item
     
    Last edited: Dec 13, 2013
  9. kik4444

    kik4444 Existential Complex

    Bump any ideas?
     
  10. tifel100

    tifel100 Void-Bound Voyager

    You can reset your quests by going into Starbound/universe/playerQuests.db

    Your problem might be that the item data was saved, so the one you're seeing isn't actually what you made.
    So try resetting quests and try again.

    If problem persist, post again.
     
  11. kik4444

    kik4444 Existential Complex

    I also posted something similar in the easy way to spawn items topic, but directly pasting the one they gave me, makes the game fail to load the save.
     
  12. Aigis

    Aigis Tentacle Wrangler

  13. Chieron

    Chieron Void-Bound Voyager

    It worked! You've singlehandedly rescued my next mod!
     
    NerArth likes this.
  14. ejh1990

    ejh1990 Phantasmal Quasar

    Well... I'd call it blindly taking a stab in the dark. :p

    But I am glad that it fixed whatever you needed it to fix. :)
     
    NerArth and Chieron like this.
  15. NerArth

    NerArth Pangalactic Porcupine

    THANK YOU ejh1990. Seriously, I was looking for a way for nearly half the afternoon. Chieron is right, as you've also singlehandedly saved my mod!
     

Share This Page