socket woes

not the socket firing
15 Replies
Calego
Calego4y ago
Some of the basics You have sockets: true in your manifest?
Daniel Thorp
Daniel ThorpOP4y ago
No lol But, I'm not working inside my module, just using the console
Calego
Calego4y ago
Foundry VTT Community Wiki
Getting Started with Package Development
Some common hurdles facing new Package Developers
Calego
Calego4y ago
Ok, well the socket needs your module registered to be a valid scope I think Which means setting that in manifest and restarting foundry
Daniel Thorp
Daniel ThorpOP4y ago
How does scope work? Do I need to change it to scs.phaseChanged?
Calego
Calego4y ago
You can probably use 'world' to play around Ahhhh, hmmm Good question Hold on let me check confetti
Daniel Thorp
Daniel ThorpOP4y ago
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
Calego
Calego4y ago
Has to be 'module.MODULE_ID' I think
Calego
Calego4y ago
(it's not helpful to say 'lol just use socketlib' whoops) Oh good we linked to vance
Daniel Thorp
Daniel ThorpOP4y ago
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 It's easier
Calego
Calego4y ago
Hijacking settings is legit
Daniel Thorp
Daniel ThorpOP4y ago
game.settings.set("scs", "currentPhase", val);
Hooks.on("updateSetting", setting => {
if (setting.data.key === "scs.currentPhase" && !game.user.isGM) {
// Do something for player clients
};
});
game.settings.set("scs", "currentPhase", val);
Hooks.on("updateSetting", setting => {
if (setting.data.key === "scs.currentPhase" && !game.user.isGM) {
// Do something for player clients
};
});
Calego
Calego4y ago
You can put this on the settings' onChange instead of using the hook if you want That's how I do in GM screen
Daniel Thorp
Daniel ThorpOP4y ago
I don't have access to the same variables there
Want results from more Discord servers?
Add your server