socket woes

Aarcanist8/31/2021
not the socket firing
CCalego8/31/2021
Some of the basics
CCalego8/31/2021
You have sockets: true in your manifest?
Aarcanist8/31/2021
No lol
Aarcanist8/31/2021
But, I'm not working inside my module, just using the console
CCalego8/31/2021
Ok, well the socket needs your module registered to be a valid scope I think
CCalego8/31/2021
Which means setting that in manifest and restarting foundry
Aarcanist8/31/2021
How does scope work?
Aarcanist8/31/2021
Do I need to change it to scs.phaseChanged?
CCalego8/31/2021
You can probably use 'world' to play around
CCalego8/31/2021
Ahhhh, hmmm
CCalego8/31/2021
Good question
CCalego8/31/2021
Hold on let me check confetti
Aarcanist8/31/2021
I searched the wiki and couldn't find that. I even kind of remembered seeing it before, but I doubted myself since it didn't show up
CCalego8/31/2021
Has to be 'module.MODULE_ID' I think
Aarcanist8/31/2021
CCalego8/31/2021
(it's not helpful to say 'lol just use socketlib' whoops)
CCalego8/31/2021
Oh good we linked to vance
Aarcanist8/31/2021
I think it's a bit complicated to use sockets for what I'm doing since I just remembered my trick with high-jacking the settings update hook
Aarcanist8/31/2021
It's easier
CCalego8/31/2021
Hijacking settings is legit
Aarcanist8/31/2021
game.settings.set("scs", "currentPhase", val);
Hooks.on("updateSetting", setting => {
  if (setting.data.key === "scs.currentPhase" && !game.user.isGM) {
    // Do something for player clients
  };
});
CCalego8/31/2021
You can put this on the settings' onChange instead of using the hook if you want
CCalego8/31/2021
That's how I do in GM screen
Aarcanist8/31/2021
I don't have access to the same variables there