javierriveracastro / betteroll-swade

A Better Rolls port for SWADE
GNU General Public License v3.0
16 stars 32 forks source link

Global Actions API #518

Closed brunocalado closed 1 year ago

brunocalado commented 1 year ago

Great new feature!!!

I'm trying to set some ga with it.

But, it's not working. Can you help?

image

Hooks.once('init', () => {
  const BETTER_ROLLS_SWPF = [
    {
      id: "DESPERATE_ATTACK-2", 
      name: "Desperate Attack +2", 
      button_name: "Desperate Attack +2",
      skillMod: 2, 
      dmgMod: -2, 
      dmgOverride: "",
      and_selector: [{
          selector_type: "skill", 
          selector_value: "fighting"
        },
        {
          selector_type:"item_type", 
          selector_value: "weapon"
        }],
      group: "Savage Pathfinder"
    }  
  ];

  game.brsw.add_actions(BETTER_ROLLS_SWPF);
}); // END HOOKS
javierriveracastro commented 1 year ago

You are doing it to soon. Actions are initialized in the "ready" Hook that is called after "init".

Even then you should probably do something to be sure that br2 is ready before adding actions.

And please ping me in Discord for help, don't open an issue unless it is something that should be added to the TODO list. I mean if it is a bug, it is probably a documentation one.

brunocalado commented 1 year ago

I'll pr an update to the docs. tks

brunocalado commented 1 year ago

I can't edit docs anymore.

brunocalado commented 1 year ago

I used to have an edit button.

javierriveracastro commented 1 year ago

I know. This is why moving to a wiki was bad idea. But moving back is probably a lot of work.

javierriveracastro commented 1 year ago

You should be able to change the wiki now editing the files in code/docs (https://github.com/javierriveracastro/betteroll-swade/tree/version_2/docs).