Modding Help Broadsword spawned projectiles(like Star Cleaver)

Discussion in 'Starbound Modding' started by draiza, Jun 3, 2017.

  1. draiza

    draiza Big Damn Hero

    I want to readd Star Cleaver and other beta projectile-spawning weapons to the game. How can I spawn projectiles when attacking? Is that still possible or I must edit broadsword.lua? I am not strong in scripting.
     
  2. Campaigner

    Campaigner Giant Laser Beams

    I actually had a hard time figuring this very same thing out. I was able to recreate Star Cleaver in my mod after hours of struggling a while ago, and here's how I did it;

    1. Create your ".activeitem" file in a folder you can easily find the path to. This is your weapon. Sprite it, stat it, and save.
    2. Create a folder for your projectile.
    3. Create your ".projectile" file. Do what you need to make it work like you want it to. Test it with a gun to see if it works before progressing.
    4. Create a folder for your weapon ability.
    5. Create your ".weaponability" file. I duplicated the traveling slash files, and edited them from there.
    6. Under ""ability", change the Name to what you want shown on the weapon, and "type" to what the game will recognize.
    6. Under "sounds", give every line the sound you want it to have.
    7. Under "sounds", create a line for "physicalTravelSlash" : [ "/sfx/---" ], where --- is the sfx you want it to use.
    8. For every "projectileType" instance, make sure it says your projectille's "name" at the start of your .projectile file.
    9. Create a folder named "items", and create another folder inside named "buildscripts"
    10. In the buildscripts folder, create a file named "weaponabilities.config.patch". It must be a PATCH file, not a Text Document.
    11. Open the "weaponabilities.config.patch" file in your choice of text editor, and add the following code, exluding lines with //;
    Code:
    [
      {
      "op": "add",
      "path": "/x",
       // path refers to the name that the game's inner workings recognize the file as.
       // You can use your .weaponability's filename or type name, or even some random words.
      "value": "x"
       // value is the EXACT folder path to your .weaponability, ending with your .weaponability's filename and file extension.
       // example; "/items/active/mod ability/modability.weaponability"
      }
    ]
    
    12. In your ".activeitem" file, set the "altAbilityType" line to say your ".weaponability" type.
    13. Spawn the item in the game and test it.

    It's as simple as that! I've supplied an example, so you can fiddle with it based on how I set it up. I did things SLIGHTLY differently based on how my weapon is built, but it works just like a default broadsword. Use "/spawnitem mod_example_sword" to see my lovely example weapon that fires a single gravity-enabled exploding pig. As a bonus, I added one that fires multiple exploding pigs, "/spawnitem mod_example_sword2". Go over the contents of the mod, and it'll be surprisingly simple on how to recreate this sort of thing.

    Good luck making your own Star Cleaver, and any other projectile weapons you may be making! Sorry if my explanation sucks, I'm not a very good teacher.
     

    Attached Files:

    bk3k likes this.
  3. draiza

    draiza Big Damn Hero

    Thanks a lot!
     
  4. draiza

    draiza Big Damn Hero

    I have a problem with creating a sword lol! Before I have created some energy swords, i was able to create swords too. But now I can't create any new sword or gun! I copied your example swords to my mod folder too - it's doesn't work! If I create new mod folder only with my sword and ability it doesn't works too. Sorry for my stupid brains, please help!
     

Share This Page