Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
54 stars 43 forks source link

Remove internal message for fail mining spots #1264

Closed ted182 closed 1 week ago

ted182 commented 1 month ago

When we are mining and fail to withdraw ore, we receive 2 messages:

There is no ore here to mine.
You loosen some rocks but fail to find any useable ore.

the first sentence comes internal (hardcoded) and the second comes from the file skill45_mining.scp (@fail trigger) I believe that it doesn't make much sense to receive the 2 sentences and the sentence that comes hardcoded is confusing if the prayer is over, I think that only the second sentence would be enough

I would like to suggest that a comment be placed in the server file: \src\game\chars\CCharSkill.cpp

the code is:

CItem *pItem = Skill_NaturalResource_Create(pResBit, SKILL_MINING);
if ( !pItem )
{
    SysMessageDefault(DEFMSG_MINING_3);
    return -SKTRIG_FAIL;
}

remove this DEFMSG_MINING_3 would be enough what do you think? it makes sense?

Soulless-1 commented 1 month ago

one indicates that there is no ore on the node, the other indicates a failure. it's two separate messages.

ted182 commented 1 month ago

and do you need 2 sentences? I think just indicating the failure is enough. The one coming from the internal server is confusing.

Soulless-1 commented 1 month ago

considering that they are two completely separate types of scenarios yes i believe two sentences would be required.

no ore doesn't mean you failed, and hearing that you failed doesn't mean there is no more ore left. just receiving a message that you have failed in both circumstances will lead to confusion.

ted182 commented 1 month ago

when there is no ore there is already a very clear sentence (internal server var DEFMSG_MINING_2): There is nothing here to mine for. I think it's confusing when the phrase appears: There is no ore here to mine.

For me, the 2 sentences above say the same thing, but appearing in different situations.

Soulless-1 commented 1 month ago

Ah, that's a little bit different there from the original comment i read.

one of those indicates that the region is not an area you can mine in, with the flag region_flag_nomining. a more clear version that indicates nothing would be there for you to mine for in any instance it would seem. noting that these situations are different i see no issue with the messages having nuances that inform the player of this. Though one could easily use the skf_craft flag and edit this to work in any fashion they wished.

  const CRegion *pArea = GetRegion();
    if (pArea->IsFlag(REGION_FLAG_NOMINING))
    {
        SysMessageDefault(DEFMSG_MINING_2);
        return -SKTRIG_QTY;
    }
ted182 commented 1 month ago

I agree that you are right in the code snippet you showed, but it also appears in this situation:

if ( pResBit->GetAmount() == 0 )
{
 SysMessageDefault(DEFMSG_MINING_2);
 return -SKTRIG_QTY;
}

and here it would not be a non-minable area, but rather indicating that you have zeroed the mining spot. This message appears in mineable zones after you have mined all the respawn

Tolokio commented 1 month ago

hmm Have been testing it a little. System works fine for me.

I think 2 messages at same time can appear only in rare circunstances (not tested) For example, if someone empty a spot where u were already mining. Skill will @fail and skill should tell there is no mine before it fails. That or u have a script that remove amount on spot when u fail.

Do u say it is happening everytime you fail?

Soulless-1 commented 1 month ago

Ah I believe i must of misunderstood you Ted, you are receiving both messages at once during failure? I agree completely that is confusing to the player 👍 I will try to recreate on a fresh sphere X

ted182 commented 1 month ago

Sorry for the delay friends, time is a little busy here. The 2 messages always appear when there is a failure to capture the ore. You can try to download the fresh server and put it to mine and whenever it fails, the 2 appear.

ted182 commented 1 month ago

hmm Have been testing it a little. System works fine for me.

I think 2 messages at same time can appear only in rare circunstances (not tested) For example, if someone empty a spot where u were already mining. Skill will @fail and skill should tell there is no mine before it fails. That or u have a script that remove amount on spot when u fail.

Do u say it is happening everytime you fail?

I will try to do other tests here (as soon as I have time) to ensure and provide more accurate information

Tolokio commented 1 month ago

Sorry for the delay friends, time is a little busy here. The 2 messages always appear when there is a failure to capture the ore. You can try to download the fresh server and put it to mine and whenever it fails, the 2 appear.

Tested on fresh build. I just get one message when I fail by low skill.

Another thing that could b happeningto you is that the mining_spawn is being created empty. (amount 0) I know this were happening years ago, but can't remember why. MAybe regions got something to do there but I dont know.

Check if ur spawn are being created empty using this way: -First activate: .gm .debug .resend -Once you see there is no spawn created in the spot u are going to mine. -Do again .gm .debug.resend -Then mine as a normal player just once. If u receive the 2 messages then: -Do .gm .debug .resend and check the "amount" of the spawn.

If that is not the reason, maybe ur script or sphere is using morex morey more1 or whatever instead amount and always thing it is empty even if amount is 25

By my part, I have not been able to reproduce it.

ted182 commented 1 month ago

I'm not even able to reproduce this error, after restarting the server apparently this stopped happening, but I'm still trying to check. As soon as I can reproduce it in a more concrete way, I will comment again here.

Soulless-1 commented 1 month ago

i did try this myself on a fresh shard also just now and cannot recreate either. let us know what you find when trying again. thanks!

Tolokio commented 1 week ago

Lets close this Red182! As u created the issue u can close. Plz do it. U can reopen it later if it happens again.