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

feature: Replace all Ok. messages with useful messages #46 #178

Merged
merged 4 commits into from
Mar 13, 2020

Conversation

rhoxie21
Copy link
Contributor

@rhoxie21 rhoxie21 commented Mar 1, 2020

Addressing issue #46 and had also made one small change to wizhelp; let me know if you want me to take that out...

@blakepell
Copy link
Contributor

blakepell commented Mar 4, 2020

I have one comment/thought on a few of these (apologies if I ramble). Some of the spells like detect invis generally can only be cast on yourself, however they had code in them that would seem to support a case where they were changed to be cast on others. Here's a snippet and below my comment:

printf_to_char(victim, "Your eyes tingle.\n\r");
    
if (ch != victim)
{
	printf_to_char(ch, "%s's eyes begin to glow.\n\r.", victim->name);
}

In the above, the victim is generally the character but then there's the extra block for if the target of the spell was ever opened to be able to cast on others. printf_to_char using the victims name directly could 'out' the victim if they're cloaked because it always shows their name. Using an ACT function or whatever the equivalent in this version would fix that.

Imagine a player who might be cloaked as a vampire or put a mask on as a swashbuckler where you wouldn't see "Blake is here" but rather "A swashbuckler is here.". The act message would take care of these scenarios (the old function/macro that used to handle this was PERS, I'd have to lookup what it is here).

An example of where a printf with the ch->name could go wrong:

If an immortal is Wizi in the room and cast a spell you would see "Blake utters the words 'detect invis'" instead of "(An Imm) utters the words 'detect invis'".

This isn't so much an issue on immortal commands.

@blakepell
Copy link
Contributor

blakepell commented Mar 4, 2020

Here's an example with printf's from this pull request I just put in, the immortal sees the person no matter what but the player will see an item taken by whatever PERS_AW returns (that could be the imms name, or if they're wizi (An Imm)):

    printf_to_char(ch, "You have confiscated %s from %s.\r\n", obj->short_descr, victim->name);
    printf_to_char(victim, "%s has confiscated %s from you.\r\n", PERS_AW(ch, victim), obj->short_descr);

Thumbs up on the "wizhelp" changes also. Being able to see the level of the commands are highly useful.

@Synival
Copy link
Owner

Synival commented Mar 4, 2020

@rhoxie21 @blakepell Just a heads up, work & home life is keeping me extremely busy this week, so I'll have to review all of these contributions more seriously this weekend - I'll just drop some quick comments before I go to bed...

By the way, a VERY LARGE update is in the works that I want to release this weekend. It's taken a while because a lot of the database loading has been effected, so there's been a lot to test. Many, many cool things are coming soon :D Well, at least I think they're cool ;)

@Synival
Copy link
Owner

Synival commented Mar 4, 2020

@rhoxie21 Thanks for taking care of the wiz commands issue, I'll merge it this weekend. I like that change to wizhelp, I vote we toss it in.

@Synival
Copy link
Owner

Synival commented Mar 4, 2020

@blakepell

I have one comment/thought on a few of these (apologies if I ramble). Some of the spells like detect invis generally can only be cast on yourself, however they had code in them that would seem to support a case where they were changed to be cast on others.

Hmm, that's an interesting case. One of the original goals of the project was to keep the gameplay as vanilla as possible, but maybe this could be a compilation flag, or at least something more easily configurable. I've seen other spells like "word of recall" that have the same case (seriously, why would you ever use this spell?).

Imagine a player who might be cloaked as a vampire or put a mask on as a swashbuckler where you wouldn't see "Blake is here" but rather "A swashbuckler is here.". The act message would take care of these scenarios (the old function/macro that used to handle this was PERS, I'd have to lookup what it is here).

Good call - I just created an issue to address this: #179

Thumbs up on the "wizhelp" changes also. Being able to see the level of the commands are highly useful.

Agree! :)

@rhoxie21
Copy link
Contributor Author

rhoxie21 commented Mar 5, 2020

Good stuff, thanks for the comments; updated to act so the context is handled when the player maybe cloaked, etc...

@blakepell
Copy link
Contributor

Looks great @rhoxie21. :)

@rhoxie21
Copy link
Contributor Author

rhoxie21 commented Mar 6, 2020

@blakepell - Thanks! What next? :P

src/wiz_im.c Outdated
@@ -55,13 +55,13 @@ DEFINE_DO_FUN (do_wizhelp) {
if (cmd_table[cmd].level >= LEVEL_HERO &&
cmd_table[cmd].level <= char_get_trust (ch) && cmd_table[cmd].show)
{
printf_to_char (ch, "%-12s", cmd_table[cmd].name);
printf_to_char(ch, "(%2d) %-12s", cmd_table[cmd].level, cmd_table[cmd].name);
if (++col % 6 == 0)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rhoxie21 If we have the wiz levels levels in here, I think the number of commands per line will need to be reduced to fit an 80-column terminal. Everything else still fits in 80 columns, so I think it should be a rule.

This looks good to me:

  • Reduce command space from 12 chars to 11
  • Show 5 commands per row instead of 6

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected!

src/wiz_l1.c Outdated
wiznetf (ch, NULL, WIZ_PENALTIES, WIZ_SECURE, 0,
"$N denies access to %s", victim->name);
send_to_char ("Ok.\n\r", ch);
printf_to_char(ch, "$s has been denied and will be escorted out.\n\r", victim->name);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: should be "%s", not "$s"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Synival - ugh! Resolved this and validated.

<20hp 100m 100mv> Test has been denied and will be escorted out.
Test has left the game.

src/wiz_l3.c Outdated
@@ -55,7 +55,7 @@ DEFINE_DO_FUN (do_disconnect) {
for (d = descriptor_list; d != NULL; d = d->next) {
if (d->descriptor == desc) {
close_socket (d);
send_to_char ("Ok.\n\r", ch);
printf_to_char(ch, "%s has been disconnected.\n\r", d->descriptor);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This currently crashes D: "%s" is for a string, d->descriptor is of type sh_int. Something like this would work:

printf_to_char (ch, "Connection #%d has been disconnected.\n\r", d->descriptor);
// Connection #8 has been disconnected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected!

src/wiz_l4.c Outdated
@@ -359,7 +359,7 @@ DEFINE_DO_FUN (do_oload) {
obj_give_to_char (obj, ch);
else
obj_give_to_room (obj, ch->in_room);
send_to_char ("Ok.\n\r", ch);
printf_to_char(ch, "You created %p!\n\r", obj);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<1010hp 1000m 1000mv> load obj 3001
You created 0x7f3ccc236d70!

We can probably use an object name here instead ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resorted to using obj->short_desc

<20hp 100m 100mv> You created a bottle of beer!

@Synival
Copy link
Owner

Synival commented Mar 8, 2020

@rhoxie21 I found a few bugs in your changes but everything is otherwise good 👍 As soon as those are patched, I'll merge the PR :)

@rhoxie21
Copy link
Contributor Author

@Synival - corrected the items; I will be more thorough in my validation post change. Setting up docker with a few more player files so I can test a bit quicker.

@Synival
Copy link
Owner

Synival commented Mar 13, 2020

@rhoxie21 Looks good :) Merging pull request!

@Synival Synival merged commit ea0d104 into Synival:unstable Mar 13, 2020
@rhoxie21 rhoxie21 deleted the remove_ok branch March 28, 2020 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants