Cooldowns? how are they measured?

I want to create more divesity in weapons. But for that i need to know in what the cooldowns are measured. I suspect it is like frames but how many go in 1 second for them xD.

and the active_frame is the time of the animation right?

thanks in advance!

anyone any idea?

1 Like

Thanks for asking and for thinking of making more weapons! Can you describe exactly what you’re trying to do?

Adding @linda and @albert so other eyes are on this :slight_smile:

The part i am asking about is located in the weapon_name.json

  "stonehearth:combat:ranged_attacks": [
     {
        "name": "archer_1h_shoot",
        "effect": "archer_1h_shoot",
        "active_frame": 60,
        "cooldown": 200,
        "priority": 0
     }

In what are the cooldown measured? I have seen that the special abillity of a footman for instance has a 4000 cooldown.
And about the active_frame I assume that is the duration of the animation. Am i correct?
This is the current stats of the longbow i created and i wanted it so that it does a lot increased damage and range but have a slower fire rate and i found out that increasing the active frame alone did not do enough so i added a cooldown but i have no clue how much of a cooldown i gave it.

whole longbow.json
{
   "mixins": "stonehearth:mixins:item_properties",
   "type": "entity",
   "components": {
      "model_variants": {
         "default": {
            "models": [
               "file(longbow_equipped.qb)"
            ]
         }
      },
      "stonehearth:entity_forms": {
         "iconic_form": "file(longbow_iconic.json)"
      },
      "stonehearth:equipment_piece": {
         "slot": "mainhand",
         "render_type": "attach_to_bone",
         "postures": [
            "stonehearth:combat",
            "stonehearth:patrol"
         ],
         "ilevel": 40,
         "roles": "archer_job",
         "required_job_level": 5,
         "equip_effect": "stonehearth:effects:weapon_level_up"
      }
   },
   "entity_data": {
      "stonehearth:combat:weapon_data": {
         "base_damage": 52,
         "base_ranged_damage": 52,
         "range": 45,
         "projectile_speed": 50,
         "projectile_uri": "stonehearth:weapons:arrow"
      },
      "stonehearth:combat:ranged_attacks": [
         {
            "name": "archer_1h_shoot",
            "effect": "archer_1h_shoot",
            "active_frame": 60,
            "cooldown": 200,
            "priority": 0
         }
      ],
      "stonehearth:combat:idle:ready": {
         "name": "archer_1h_idle"
      },
      "stonehearth:net_worth": {
         "value_in_gold": 70,
         "rarity": "common",
         "shop_info": {
            "buyable": true,
            "sellable": true,
            "shopkeeper_level": 3,
            "shopkeeper_type": "caravan"
         }
      },
      "stonehearth:catalog": {
         "display_name": "i18n(yangarmoury:entities.weapons.longbow.display_name)",
         "description": "i18n(yangarmoury:entities.weapons.longbow.description)",
         "icon": "file(longbow.png)",
         "category": "weapons",
         "material_tags": "wood ranged_weapon stockpile_weapon"
      }
   }
}

Thanks for helping me ^¢^

Some of the dev streams should have the info you need, though good luck finding the right one in all those hundreds of hours of video :stuck_out_tongue: .

Anyway, given the big numbers for cooldowns, I would assume they are measured in milliseconds. I also wonder if the active_frame bit tells the game which frame of the animation does the damage (or launches a missile in this case). Not tested it though, but it shouldn’t be hard to test in that case.

Haha yea finding that would be a hell to do so xD

I rather think it is in frames then mili seconds cause i know for sure the cooldown of the cleave of the footman is longer then 4 seconds xD. If it is counted in fames and it the animations would be 60 frames a second the cooldown would be about 67 seconds and that sounds more realistic.

Yea thats why i am asking about the active frame cause i dont know exactly what it is for.

@Yangzhoui Cooldowns are measured in milliseconds at game speed 1.

The active frame is the frame number (at 30 frames/s) where the action is considered to have taken effect (i.e.the sword hits the target, the arrow is released, the shield can block an attack). Unless you’re authoring animations, you generally wouldn’t change the active frame.

2 Likes