Need help, trap that slows

Hi everyone, im currently working on a mod and i want to make a trap that also slows the enemy when hit. I tried using the slow from the quiver. And the trap makes one attack. I should be able to make it work by just editing json files.
I tried copying and editing the slow arrow ability that is given in the equipment_swap part of the quiver. I made my own alias for that file in the manifest(just like the quiver has an alias to the ability) and placed it in the equipment component of the [trapname]_weapon.json file, but it doesnt work.

Anyone have some advise on how i can apply this “buff” to the trap?

Time for some guesswork :sunglasses:
If you want to stick strictly to json, the only 2 ways I see to inflict a buff from an entity is through a ranged projectile or a consumable.

Here’s the meat of it in slow_arrow_skill.json

   "entity_data": {
      "stonehearth:buffs": {
         "inflictable_debuffs": {
            "infection": {
               "uri": "stonehearth:buffs:archer:slowing_arrow",
               "chance": 1
            }
         }
      }
   }

I would assume that if we were to add that to the trap itself, any interaction would inflict the buff, so whoever places it would get that buff as well, but I could be completely wrong. Assuming that is true, my thought process is

  • Make another projectile entity based on the arrow, and use an empty .qb file. Use the slowing_arrow buff, or create your own.
  • Add ranged paramaters to the [trapname]_weapon.json stonehearth:combat:weapon_data{}

Additions could go something like this:

[trapname]_weapon.json

  "stonehearth:combat:weapon_data": {
     "base_damage": 50,
     "reach": 1.5
     "base_ranged_damage": 0,
     "range": 1,
     "projectile_speed": 30,
     "projectile_uri": "[newProjectileURI]",
     "projectile_start_offset": { "x": 0, "y": 2.3, "z": 0 },
     "projectile_end_offset": { "x": 0, "y": 2.3, "z": 0 }
  },
  "stonehearth:combat:ranged_attacks": [
     {
        "name": "shoot",
        "effect": "shoot",   <- Might be able to remove so there's no animation
        "active_frame": 20,
        "cooldown": 0,
        "priority": 0
     }
  ]

[trapname].json

 "mixins": [
    "stonehearth:mixins:siege_turret"
 ]
 "components": {
    "stonehearth:siege_weapon": {  <-
       "max_uses": 1               <-- Might not need
    },                             <-
    "stonehearth:equipment": {
       "items": [
          "URI you set for [trapname]_weapons.json"
       ]
    },
    "sensor_list": {
       "sensors": {
          "sight": {
             "type": "sensor",
             "radius": 2
          }
       }
    }
 }

In theory it might work… :smirk:

1 Like

thank you so much!

I only needed to add this to the [trap]_weapon.json:

after that it worked. and it did not affec t my own hearthlings

Yeah, I definitely overthought that one. Obviously if it was put in the weapon file, it wouldn’t affect a hearthling placing it lol. I either need sleep or coffee.

1 Like

when in doubt, go with coffee :coffee: :wink:

1 Like