Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Log Messages #686

Closed
MathieuLoutre opened this issue May 12, 2020 · 3 comments
Closed

Custom Log Messages #686

MathieuLoutre opened this issue May 12, 2020 · 3 comments
Labels

Comments

@MathieuLoutre
Copy link
Contributor

The built in log is great but only logs the moves made. Some moves have random consequences (following a dice roll for instance) but there's now way to know that as it's calculated by the game and not sent from the client.

Is there a way to modify the log associated to a move and add whether it's been successful or not, or add arbitrary data to it?

Right now, I have to build in my own log to display to the players what's happened but would love to leverage the existing one.

@nicolodavis
Copy link
Member

nicolodavis commented May 21, 2020

There used to be a mechanism to add arbitrary payloads to log messages but I think it got lost after we migrated to a new plugin architecture. Do you think something like this would be helpful?

move: (G, ctx) => {
  G.roll = ctx.random.D6();
  ctx.log.custom({ roll: G.roll });  // gets added to the log message for this move
}

@nicolodavis nicolodavis changed the title Log random-based outcome Custom Log Messages May 21, 2020
@MathieuLoutre
Copy link
Contributor Author

Yes! That would be amazing. Arbitrary payloads feel like the right approach. Is this something I could help with in terms of PR? (not sure when I'll have the time but if you have a pointer for where I could start, I'd happily take a look)

@delucis
Copy link
Member

delucis commented Dec 13, 2020

Done in #865

@delucis delucis closed this as completed Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants