Modding Help Randomly Generated Guns with powerProjectiles

Discussion in 'Starbound Modding' started by Oberic, May 22, 2015.

  1. Oberic

    Oberic Spaceman Spiff

    Attempting to work on arm cannons with secondary charge-up attacks, that are randomly generated.
    They work almost perfectly (thanks to v6ooo's help!), except the basic charge shots are only alternate projectiles rather than more powerful ones.
    I have tried dozens upon dozens of things and types of code, and nothing will make the charge shots deal more damage or cost more energy. A LOT of stuff doesn't crash the game, but has no effect even though it works on non-random guns. It is rather annoying, I'd rather not make a ton of non-random guns to get the effect I want, I like randomgens more :p

    If I can get it to work, I won't need to rely on weird ammo types to simulate stronger attacks.

    Any ideas on how to fix this?
     
  2. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    Code:
     
    "projectile" : {
        "speed" : 80,
        "power" : 20,
        "powerCurve" : "damageMultiplier",
        "color" : [10, 255, 10]
      }, 
    'powerCurve' allows a multiplier for damage on weapons which have charge capability, I do so believe.

    You have to define the 'damageMultiplier' in another asset root of your mod although:

    /mods/(MOD_NAME)/leveling/(GUN_NAME).function


    Then in said function file define damageMultiplier:
    Code:
     
    {
      "damageMultiplier" : [ "linear", "clamp", [0, 1], [0.1, 1], [0.699, 1], [0.7, 3], [1.1, 5], [1.2, 5] ],
    } 
    This may or may not be accurate I'm basing this from knowledge I have collected by studying other people's mods. :)
     
  3. Oberic

    Oberic Spaceman Spiff

    That looks almost identical to busterTimeMultiplier. It doesn't work, and I've tried a LOT of ways to implement it. If it doesn't crash, it has no effect.
    the problem with randomly generated guns is that they hard-ignore the damage on projectiles because they use level, baseDps and stuff like that to calculate stats.

    I either need to try some absurd new things that nobody has done and hope I can make it work, or scrounge and scrounge until I find a way to apply a multiplier only to powerProjectiles fired from a gun with normal randomgen stats.... I think I thought of something I can try. I'll let this thread know if it works, I'll try in the morning.

    I'd prefer to use all vanilla projectiles for a version of this, that's why I need it to work.
     
  4. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

  5. v6ooo

    v6ooo Space Kumquat

    @Oberic , you should probably mention that spawning an projectile using actionOnReap works or someone is going to reply back with the same result.
    It is a weird workaround as it requires 1 extra projectile for every original projectile but it does work.

    Edit: @Inf_Wolf14 , that only works for regular guns. Generated guns do not seem to have the projectile property so you can't define powerCurve like you normally would.
    I, and probably Oberic too, have tried a lot of variations in hopes of finding something that would work but I don't think the developers have considered randomly generated weapons with charge attacks (yet) except for including powerProjectileTypes.

    Edit2: @Oberic , you should poke @metadept or @kyren and see if they have something similar to use for generated.

    Edit3: Reference material I've used, http://doc.playstarbound.com/stable/structStar_1_1Guns_1_1GunDefinition.html
     
    Last edited: May 22, 2015
    Inf_Wolf14 likes this.
  6. Oberic

    Oberic Spaceman Spiff

    Was hoping to avoid actionOnReap as it's a little messy.

    But I gotta make this work at least for chargedbustershot. Guess I'll do that. :)
     
  7. Oberic

    Oberic Spaceman Spiff

    I have learned a lot over the last ... day?

    I can now sort of do what I wanted to do. (and make some nifty custom projectiles perhaps)

    Atleast I can make the charge shots do more damage, but it's through the projectile using actionOnReap.
     

Share This Page