Modding Help Replacing the Status effect of a custom weapon

Discussion in 'Starbound Modding' started by ManaUser, Apr 23, 2017.

  1. ManaUser

    ManaUser Cosmic Narwhal

    So like many before me, I'm trying my hand at making server-friendly custom items, weapons, etc. I think I've got the hang of the basics, but I've hit a snag. What I'd really like to do is change the type/element of a certain weapon. Currently fire, want to make it ice. I can change the actual damage type, but it appears that instead of replacing burning with frozen, it gets both. Which isn't right so... Here's basically how I have it set up:

    Code:
    "parameters": {
       "primaryAbility": {
          "projectileParameters": {
             "damageKind": "iceplasma",
             "lightColor": [40, 110, 230],
             "statusEffects": [ "frostslow" ]
          }
       }
    }
    That's abbreviated of course. Since it's long, I won't post the entire thing unless someone asks me to.

    So... Yeah. I zap something with that and it take frost (blue) damage like I want, but if not killed it gets both the frostslow effect and the burning effect from the base item. Any ideas how to solve this?

    P.S. lightColor is misbehaving are well. I suspect it's no coincidence that these are both array [] type properties.
     
  2. Cyel

    Cyel Scruffy Nerf-Herder

    I think you're adding a status effect to the primary ability, while the actual weapon's elemental type has to be changed on the "elementalType" parameter?
     
  3. ManaUser

    ManaUser Cosmic Narwhal

    Thanks for the idea, but I tried that already (I probably I should have mentioned that).

    And my problem isn't the element as such—It does do ice damage—it's that I can't get the burning debuff to go away. As best I can tell, causeing Burning is a property of the projectile. But setting a new own only seems to add to, not replace that.
     
  4. Sparklink

    Sparklink Ketchup Robot

    Patching it may work to replace the fire effect with only ice, it "op" : "replace", "path" . If that does not work could you please let us know what weapon you are trying to alter?
     
  5. ManaUser

    ManaUser Cosmic Narwhal

    ::Sigh:: Sometimes it seems like the more details I give in a question like this, the less likely I am to get a relevant answer because people get stuck on things that don't actually have anything to do with the question. But I guess I have to admit I don't really have the skill yet to ask the right question so I'll just have to take my chances.

    OK, first of all I'm trying to make this kind of custom item, (i.e. /spawnitem type stuff although I'm using StarCheat rather than /spawnitem per se). That's what I meant by "server-friendly custom items".

    So first of all, does patching even apply in this context? I think it does not, but if it does could you direct me to an example of how it's done?

    Anyway the item I'm trying to modify is a Daragonhead Pistol. And like I said, it seems to me the problem is that projectileParameters can't overwrite/replace an array. More than anything else, I'm hoping someone experienced can confirm or refute that idea.
     
    Last edited: Apr 24, 2017
  6. Cyel

    Cyel Scruffy Nerf-Herder

    Well you didn't gave many details, I don't see how you can expect people to give a relevant answer when they're missing parts of the puzzle

    It indeed doesn't apply here

    Seems like it's the case;

    One workaround you could use is to change the fired projectiles to something that don't have a statusEffect. For example, here I'm using processing to change the weak shot's color (it's not a perfect match but I was lazy), and replaced dragonfirelarge with plasma2, which is quite similar:
    Code:
        "chargeLevels": [
        {
            "time" : 0,
            "energyCost" : 5,
            "cooldown" : 0.1,
            "projectileType" : "dragonfiresmall",
            "inaccuracy" : 0.008,
            "baseDamage" : 1.5,
            "fireSound" : "fire",
            "projectileParameters": {
              "lightColor" : [40, 110, 230],
              "damageKind" : "iceplasma",
              "processing": "?hueshift=90"
            }
          },
          {
            "time": 1.0,
            "energyCost": 40,
            "cooldown": 0.5,
            "projectileType": "plasma2",
            "projectileParameters": {
              "statusEffects": ["frostslow"],
              "knockback" : 40,
              "emitters": ["iceplasma", "smoke", "flames"]
            },
            "inaccuracy": 0,
            "baseDamage": 9,
            "fireSound": "fire2"
          }
        ]

    [​IMG]
    (as you noticed those parameters can't apparently override the default settings, so the "lightColor" stays the same for the weak shot, it's pretty noticable at night compared to the charged shot, y'could probably replace it with another projectile)

    edit: added knockback, gif is outdated but ahwell
     
    Last edited: Apr 24, 2017
  7. ManaUser

    ManaUser Cosmic Narwhal

    Very helpful answer. Thank you. Guess I need to be a little more trusting. :)

    One more question though, you said "parameters can't apparently override the default settings". Is that in fact true for everything? Or only arrays like I was thinking? Because using the original dragonfire projectiles (which have a pre-set damagekind of fireplasma) changing it to iceplasma seemed to work fine. But maybe there's a more complicated interaction going on than I understand.
     
  8. Cyel

    Cyel Scruffy Nerf-Herder

    Yeah, seems to be true for everything; my first idea to work around the issue was to use invisibleprojectile and dump the entire dragonfire projectiles' config in projectileConfig, which mostly worked, except that it didn't overwrote the "image" value (which is a string type), so I ended up with invisible projectiles. So from what I've tested it's how it works, but maybe there's a "overwrite" setting somewhere

    I'm not really familiar with all that stuff but are you sure damageKind actually changed / changed anything?

    Edit: seems that yes, damageKind as indeed overwritting the projectile's settings. Maybe it's on a case-by-case basis then? The projectileParameters are applied by the engine, so no real way to check
     
    Last edited: Apr 24, 2017
  9. ManaUser

    ManaUser Cosmic Narwhal

    Obviously more experimentation is requires. Wish me luck.
     

Share This Page