#Trying to make weapon abilities, first attempts.

22 messages · Page 1 of 1 (latest)

rare tusk
#

It's as the title says, I am trying to make a mod that aims to bring some tiered staves and wands to the game since by default, there's not much to choose from. What I wanted to get started with was to make an ability that, once triggered, will cause an explosion at the cursors position. Kind of like the force cage ability that the ferozium staff has, only with a singular explosion that deals damage.

The thing is, I'm not new to coding at all but I have zero experience with lua or actively making weapon abilities for the game. And since I don't plan to make huge mods, I also don't know how deeply I want to dive into lua.

Either way, how should I start at all? I'm quite at a loss on how to get started.

abstract grail
rare tusk
#

that is legit it? lol

abstract grail
#

this is good if you only need it on a single weapon. if you want to put it on more you should make an ability file for it

abstract grail
rare tusk
#

yeah I was planning to make more weapons access that skill tbh

#

so how would I go about making a weapon ability file?

abstract grail
#

find one you like in the vanilla assets and copy it. open it and change its name, then patch /items/buildscripts/weaponabilities.config so it knows like, "Oh, when a weapon has blinkexplosion as the ability, I should grab the data at /items/active/weapons/melee/abilities/generic/blinkexplosion/blinkexplosion.weaponability"

#

make sure to prefix or suffix your item ID, ability name, and the item and ability files! this significantly reduces the chances of mod conflicts. all you need to do is put some kind of unique thing before or after the name, such as streema_tier1staff instead of just tier1staff

#

you can also make the prefix based on the mod rather than your name, such as tieredstavesmod_tier1staff

#

assuming you copied the force cage weapon ability, all you need to change is the type, name, and projectileType

rare tusk
#

I see, I'll try that in a bit. Should be alright if I post here tomorrow again after I tinkered around a bit?

#

aight, I gave it a quick go because I can't wait

#
  "itemName" : "woodenstaff",
  "price" : 200,
  "maxStack" : 1,
  "level" : 1,
  "rarity" : "Common",
  "description" : "A rustic staff made by tearing the perfect twig off a tree.",
  "shortdescription" : "Wooden Staff",
  "category" : "staff",
  "twoHanded" : true,
  "itemTags" : ["weapon","staff"],
  "tooltipKind" : "staff",

  "animation" : "/items/active/weapons/staff/staff.animation",
  "animationParts" : {
    "staff" : "woodenstaff.png",
    "stone" : "",
    "chargeEffect" : "staffglow.png"
  },
  
  "animationCustom" : {
    "lights" : {
      "glow" : {
        "color" : [0, 0, 0],
        "animationOffset" : [2.125, -10.25]
      }
    },

    "sounds" : {
      "physicalactivate" : ["/sfx/npc/boss/cultistboss_recharge.ogg"],
      "zoneactivate" : ["/sfx/melee/giantsword_charge_full.ogg"]
    }
  },

  "inventoryIcon" : "woodenstaff.png",

  "scripts" : ["/items/active/weapons/staff/staff.lua"],

  "stances" : {
    "idle" : {
      "armRotation" : -90,
      "weaponRotation" : 0,
      "twoHanded" : false,

      "allowRotate" : false,
      "allowFlip" : true
    },
    "charge" : {
      "duration" : 1.4,
      "armRotation" : 20,
      "weaponRotation" : -20,
      "twoHanded" : true,

      "allowRotate" : false,
      "allowFlip" : true
    },
    "charged" : {
      "armRotation" : 20,
      "weaponRotation" : -20,
      "twoHanded" : true,

      "allowRotate" : false,
      "allowFlip" : true
    },
    "discharge" : {
      "duration" : 0.5,
      "armRotation" : -10,
      "weaponRotation" : -50,
      "twoHanded" : true,

      "allowRotate" : true,
      "allowFlip" : true
    },
    "cooldown" : {
      "duration" : 0.5,
      "armRotation" : -45,
      "weaponRotation" : 0,
      "twoHanded" : true,

      "allowRotate" : false,
      "allowFlip" : true
    }
  },

  "elementalType" : "physical",
    
  "primaryAbilityType" : "forcecage",
  "primaryAbility" : {
    "name" : "Magic Blast",
    "maxCastRange" : 40,
    "energyUsage" : 0.75,
    "energyCost" : 10,
    "projectileDelayFirst" : 0.5,
    "projectileDelayEach" : 0.00,
    "projectileDistance" : 1,
    "projectileCount" : 8,
    
    "projectileParameters" : {
      "speed" : 0,
      "baseDamage" : 30
    },

    "stances" : {
      "idle" : {
        "weaponOffset" : [-0.125, -0.5]
      },
      "charge" : {
        "weaponOffset" : [0.125, 0.75]
      },
      "charged" : {
        "weaponOffset" : [0.125, 0.75]
      },
      "discharge" : {
        "weaponOffset" : [0.125, 0.75]
      },
      "cooldown" : {
        "weaponOffset" : [0, -0.25]
      }
    }
  },

  "altAbilityType" : "forcecage",

  "builder" : "/items/buildscripts/buildunrandweapon.lua"
}

This is basically the entirety of the weapon rn

#

I tried going with a projectiletype, like the doomgrenade one but when I did, the game crashed on me KEKW

abstract grail
#

it might not work too well if both ability slots have force cage but who knows

#

it might work

rare tusk
#

ah, works now. I've forgot the ""

#

I guess I gotta get used to that KEKW

rare tusk
#

alright! that'll do!

#

thanks a lot dorime

abstract grail