Modding Help How to make fist weapon send out projectiles?

Discussion in 'Starbound Modding' started by Lazy Joe, Apr 12, 2017.

  1. Lazy Joe

    Lazy Joe Scruffy Nerf-Herder

    The new activeitem format from 1.0 is still giving me a hard time.
    Can't even spawn a spear with 0.1 firetime without getting perfect generic item. Alot of things which used to be possible simply through editing the item's json are hard to figure out now, if not, even plain impossible to do without having to involve lua.
    But I'm not a coder, and I miss the old format which even makes it possible for someone like me who has zero coding knowledge to just grab some items and reverse engineer with help of starcheat, creating fun drawables to share/mess with friends.

    With that said, I'm looking for people who is willing to teach me the basic about activeitem, it has too many lua features in it, the "builder" "scripts", all tied to lua. Can't simply edit the activeitem file and be done with it.
     
  2. soldierfast90

    soldierfast90 Pangalactic Porcupine

    I'll see what I can do to help but your assumptions on lua-based items are wholly wrong on so many levels man.

    The builder scripts are in NO WAY tied to how the actual weapon will work, the builders are literally just builders, without materials they can't work (terrible analogy I know). That's where the "activeitem" file comes in, that's where the nitty gritty stuff of weapon stats and stuff comes from.

    Now judging by what you've been trying to use, you were using an activeitem file for "generated" weapons which would have it's builder "/items/buildscripts/buildweapon.lua". This is purely for randomly generated ones which require it's own files for every piece. I assume you want a "unique" weapon so the first thing you'll want to do is remove every line of code below said builder line and rename "buildweapon.lua" to "buildunrandweapon.lua". This means that the game will recognise it not as a randomly generated one but as a singular weapon so that it can simply take a single sprite image rather than multiple. For the last line of code add an "}" to "seal" the code so it doesn't end up dying.

    After that, you'll now have a set for a "unique" weapon. From there you should be able to recognise and modify other parts like names, animation, dps and all other cool stuff.

    Also, when it comes to "Re-Pathing" the scripts/sprite path, mind you that the game checks ALL files and "starts" from there. So if your item was in a mod folder, you don't need put in the WHOLE path, just put the path starting from the mod folder i.e /items [or other file inside said mod folder]/[another file]/[add as many until it leads the file, then specify the actual file].

    Activeitem files and similar do not need a direct repath. It's also important that the top line with "itemName" has the name next to it renamed into something that DOESN'T match any other itemNames. So example is this "itemName" : "NAMEHERE". The first quoted word determines how Starbound will read the file, so if it read itemName, it defines an id for the item. The colon seperates the itemName code and "NAMEHERE" determines the id of the item file. Simply put, Left of colon is what Starbound reads to determine WHAT that line of code is, Right of colon is the "output".

    ALSO, description means description. Shortdescription means title.

    It would be wise to study how the json activeitem files are structured, look at how they work and how it's arranged. Good website for testing json as a whole is here: http://helmet.kafuka.org/sbmods/json/
    Bk3k told me about this one.

    Hope I helped in someway or other.

    As for fists firing projectiles? I think it's just a matter of combining a gun code ONTO a fist weapon base.
     
    Last edited: Apr 12, 2017
  3. Lazy Joe

    Lazy Joe Scruffy Nerf-Herder

    I think that's what i missed. Gonna try it later and hope everything will go smoothly from there.

    Before 1.0 hit I had bunch of weapons which were based on some of my favorite anime or manga characters. Some of them are just purely for bullshitting around, like I made the 3 egyptian god cards from yu-gi-oh, with moving drawables. Most others were some kind of fist weapons. Punches that send out all sort of projectiles, and with help of actionOnReap, alot of things can be done if one has enough creativity and inspirations.

    Couple more things i might come back to you with:

    1) The game seems to recognize different parts of a weapon, like "handle", "blade"... I haven't even started to take a good look at them yet, but i was wondering how does the game even know which part is attached to which part. I assume this is gonna be a ton of work when drawables are also involved.
    By tinkering with fist weapons i realized they are basically melee weapons without "handle", and the punch projectile are actually just png pictures and the damage hitbox is specified extra. Which was my problem, cos i realized i can use any picture there is in the assets, but it will not be "real" projectile, it will not fly further from my fist.

    2) ActionOnReap, can i still do that...? An aquaintance of mine who is quite a good modder (goes to your ship without being in your party that kind of level) told me that i can still do them in the projectile files. Haven't tried yet, but wont that makes it incompatible for multiplayer? Won't my friend crash if i use a weapon infront of him, because he lacks the projectile file?

    3) Gaining buff while holding a weapon. Did a bit searching, apparently it's not possible anymore without having to do lua? Anything that related to lua is too hot for me to touch.
     
    Last edited: Apr 12, 2017
  4. soldierfast90

    soldierfast90 Pangalactic Porcupine

    For weapons with singular sprites or a single "part" leave the "handle" field empty with "", except the line with "blade" : "[name of png in same folder as activeitem]" for swords/melee,
    Guns have "middle" instead of "blade" and 2 other parts, "barrel" and "butt", which are useless for unique weapons, but don't remove seemingly redundant lines.

    ActionOnReap, Never saw how it worked since I never worked with that yet.

    As for gaining buffs? That's maybe possible.

    I'm not sure about gaining status effects while HOLDING something. I don't think so however as inputting this line of code only applies to armour. If you want, you can try inputting this code
    Code:
      "level" : 4,
      "leveledStatusEffects" : [
        {
          "levelFunction" : "standardArmorLevelPowerMultiplierMultiplier",
          "stat" : "powerMultiplier",
          "baseMultiplier" : 1.25
        },
        {
          "levelFunction" : "standardArmorLevelProtectionMultiplier",
          "stat" : "protection",
          "amount" : 0.5
        },
        {
          "levelFunction" : "standardArmorLevelMaxEnergyMultiplier",
          "stat" : "maxEnergy",
          "amount" : 5
        },
        {
          "levelFunction" : "standardArmorLevelMaxHealthMultiplier",
          "stat" : "maxHealth",
          "amount" : 5
        }
      ],
    This is just armour effects, but "levelfunction" determines things for armour-based stats. Removing levelFunction means you can change the "stat" to a status effect instead of things like listed. Source for this code is the tier 4 durasteel armour set. Maybe you could try to shove that code somewhere in the weapon file and see what happens.

    Maybe bk3k would like to pop in and help.


    AS FOR PROJECTILES, yeah It would definitely crash. Crash back to your ship anyways. So yeah, if you add in anything that isn't "connected" to the game, it'll just, not exist. In short, if you made a new projectile file, noone else would see it unless you made it a mod.
     
  5. Lazy Joe

    Lazy Joe Scruffy Nerf-Herder

    1) Yep, I am aware of gaining permanent buffs from wearing vanities and armors, i can also add new buffs to objects such as beds, they all haven't changed much from before 1.0
    But I mean just weapons, gaining buffs while holding/using one, the old format used to allow that.

    2) ActionOnReap is used for projectiles, and could be added to the old item format. It basically decides what happens if a projectile "dies". The most basic stuff one can do with that is to make a projectile give birth to a new projectile, and of course you can change a bunch of parameters. One can even spawn texts, or items. I used to have a kitchen knife that spawn one random food item each time i swing it. I used to have a fist weapon that sends out slash which bounces through entire room and finishes every monster off that it touches. The fun one can have with help of actionOnReap can't even be described with words.
    1.0 felt like someone broke into my house and switched my windows PC with a Mac, everything is so strange and different, and I'm just sitting in front of it, trying to figure out how the basic stuff work and fail hard at it.
     
  6. soldierfast90

    soldierfast90 Pangalactic Porcupine

    Oh yeah nvm I checked my own mod what ActionOnReap does, silly of me to forget especially when I have 6 custom projectiles. Yeah same thing with custom projectiles, if nobody else has it, it won't exist without some weird things happening.

    Just checked and compared differences in how the json is structured in the current version and SB Enraged Koala (Yes I have the data from Enraged Koala) and for projectiles that involve explosions or effects, it remains the same as how it was structured. For spawning in items it's changed slightly

    It used to be this (OLD Lava ballon as an example):
    Code:
      "actionOnReap" : [ { "action" : "liquid", "liquidId" : 3, "quantity" : 1000 } ],
    Now it's slightly changed (Same, lava ballon CURRENT):
    Code:
      "actionOnReap" : [
        {
          "action" : "liquid",
          "liquid" : "lava", "quantity" : 3
        },
        {
          "action" : "sound",
          "options" : [ "/sfx/projectiles/acid_hit.ogg" ]
        }
      ],
    For spawning, I 'd say just replace "Liquid" with item (both lines) and replace "lava" with the item wanted and obviously quantity is quantity. Never tested it myself but whatevs. Below that is the sound, which isn't required but it's there anyways.

    As for buffs, Yeah I still don't know how buffs work by just holding it.

    Really all I can do at the moment.

    ALSO, just realised that the old lava balloon projectile apparently spawned in 1000 lava when it hit something. Must've been like releasing hell.
     
    Last edited: Apr 13, 2017
  7. Lazy Joe

    Lazy Joe Scruffy Nerf-Herder

    Yeah, I think the syntax of the codes didnt change. But i meant the ability to include them into an item file.

    Sure i can just switch out the "lava" part and change it to something else i can use, but that means i am making a customized projectile, which will not be valid for my friends, that's what i want to avoid.

    I still have all my old stuff backed up through starcheat, as json files.
    In the old format, you also have those "idle" "windup" "fire" part, you could simply add "statusEffects":[bla bla bla...] and that will do the trick. Apparently doesnt work in activeitem format.

    Thanks for you input though, you certainly helped me advance a big step by pointing out the builder thing.
     
  8. soldierfast90

    soldierfast90 Pangalactic Porcupine

    Yeah all I can do. Pretty much you should just make a mod yourself, it would be easier for your friends and yourself just to mess around with custom stuff.
     

Share This Page