Is there any way to change the message that's displayed when you use an item?

Let’s say I want to change the message that’s displayed when you eat food, or use a drug. Is there any way that could be jsoned out from iuse.cpp?

Just the purely cosmetic message that’s displayed when something is used. I’d appreciate it for flavor text.

Unfortunately the iuse function that prints something relies on a lot of if functions, even for eating. I can’t say it’d be easy jsoning it.

Though I’m really not an experienced coder, to be fair!

I know changing the actual behind the scenes effects of items would be hard, but the message that’s displayed when they’re used, that seems reasonably feasible. I’m not an expert though.

You got a compiler and know how to use it (Code::Blocks works OK for me), all you gotta do is change the print_msg. (#4 in the below example.)

Example: line 936 or so of iuse.cpp. Let’s say you drink a beast mutagen?

g->add_msg_if_player(p, _(“Your heart races and you see blood for a moment.”));
1 2 3 4 5

  1. This tells iuse to check in game.cpp. Needed so it knows where to stick the message. Otherwise, the compiler goes “WTF? I don’t know what you want me to do!” and stops.

  2. Actual action: stick in a message, if whatever triggered this code is the player. (Spoiler: it is. NPCs won’t be drinking mutagen for a while.)

  3. I presume this is similar syntax to 1. Leave it in and things don’t break.

  4. Here’s the actual text. The opening and closing parens & quotes are mandatory and tell the compiler that you want the text they enclose printed, not parsed as some weird syntax & commands it’s never heard of. Couple things to know: don’t just hit enter/return for a new line. Instead, type (without the quotes) “\n” and then either space or hit enter. Likewise, if you want to use “quote marks” you need to put in a slash first, like so: " . Otherwise the compiler will think those quotes represent the end of your text, and chances are a “WTF?” will follow.

  5. Close all parens and use a semicolon to indicate you’re done with that line. Missing parens are a great way to cause bugs; they happen to everyone. (Especially me.

…but that one was deliberate. Hoping this helps. :slight_smile: